grid: attributes now track whether we've set a foreground/background color

This means we don't have to explicitly set the foreground/background
to the grid's default colors whenever we reset/clear a cell, and we
can instead simply memset() the entire cell to 0.

This also means the renderer has to get the default color when
rendering a cell without a foreground/background color set.
This commit is contained in:
Daniel Eklöf 2019-06-26 19:44:31 +02:00
parent 97420f13d8
commit 3a97fce6d0
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 25 additions and 21 deletions

View file

@ -19,8 +19,10 @@ struct attributes {
bool blink;
bool conceal;
bool reverse;
uint32_t foreground;
uint32_t background;
bool have_foreground;
bool have_background;
uint32_t foreground; /* Only valid when have_foreground == true */
uint32_t background; /* Only valid when have_background == true */
};
struct cell {