aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-07-07 20:03:08 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-07-07 20:03:08 +0000
commit98db7f58cb1787c0ba135025005ac1effba24035 (patch)
treef4757e92ba07cdf7a075dad39cc1748fc998ec2a
parentrender: collect glyphs over *all* update damages (diff)
cell: packing the cell struct seems to help performance
-rw-r--r--terminal.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/terminal.h b/terminal.h
index 235108af..ddc37410 100644
--- a/terminal.h
+++ b/terminal.h
@@ -36,9 +36,10 @@ struct wayland {
struct xdg_toplevel *xdg_toplevel;
};
-struct rgba { double r, g, b, a; };
+struct rgba { double r, g, b, a; } __attribute__((packed));
struct attributes {
+#if 0
bool bold;
bool italic;
bool underline;
@@ -48,14 +49,25 @@ struct attributes {
bool reverse;
bool have_foreground;
bool have_background;
+#else
+ uint8_t bold:1;
+ uint8_t italic:1;
+ uint8_t underline:1;
+ uint8_t strikethrough:1;
+ uint8_t blink:1;
+ uint8_t conceal:1;
+ uint8_t reverse:1;
+ uint8_t have_foreground:1;
+ uint8_t have_background:1;
+#endif
struct rgba foreground; /* Only valid when have_foreground == true */
struct rgba background; /* Only valid when have_background == true */
-};
+} __attribute__((packed));
struct cell {
- char c[5];
struct attributes attrs;
-};
+ char c[5];
+} __attribute__((packed));
struct scroll_region {
int start;