terminal: foreground/background in cell attributes are now uint32_t

This reduces the cell size, and thus improves the cache behavour
This commit is contained in:
Daniel Eklöf 2019-07-16 13:17:51 +02:00
parent 2a1c4d29e9
commit ccc8ef9606
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
5 changed files with 123 additions and 62 deletions

View file

@ -55,14 +55,12 @@ struct attributes {
uint8_t italic:1;
uint8_t underline:1;
uint8_t strikethrough:1;
//uint8_t blink:1; /* Not supported yet, and removing it means all other attributes fit in a single uint8_t */
uint8_t blink:1;
uint8_t conceal:1;
uint8_t reverse:1;
uint8_t have_foreground:1;
uint8_t have_background:1;
struct rgb foreground; /* Only valid when have_foreground == true */
struct rgb background; /* Only valid when have_background == true */
uint32_t foreground;
uint32_t background;
} __attribute__((packed));
struct cell {
@ -236,8 +234,8 @@ struct terminal {
bool print_needs_wrap;
struct scroll_region scroll_region;
struct rgb foreground;
struct rgb background;
uint32_t foreground;
uint32_t background;
struct {
int col;