aboutsummaryrefslogtreecommitdiff
path: root/terminal.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-07-16 11:17:51 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-07-16 11:17:51 +0000
commitccc8ef9606d90e7b032f6b20f965758df1774a58 (patch)
tree6d01522e25b5d88e05930b399a3d98f4c5a97d9f /terminal.h
parentcsi: implement \E[21m (disable bold) (diff)
terminal: foreground/background in cell attributes are now uint32_t
This reduces the cell size, and thus improves the cache behavour
Diffstat (limited to 'terminal.h')
-rw-r--r--terminal.h12
1 files changed, 5 insertions, 7 deletions
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;