From ccc8ef9606d90e7b032f6b20f965758df1774a58 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Tue, 16 Jul 2019 13:17:51 +0200 Subject: terminal: foreground/background in cell attributes are now uint32_t This reduces the cell size, and thus improves the cache behavour --- terminal.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'terminal.h') diff --git a/terminal.h b/terminal.h index b2aaee67..5975be85 100644 --- a/terminal.h +++ b/terminal.h @@ -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; -- cgit v1.3