mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-05 07:15:30 -04:00
cell: packing the cell struct seems to help performance
This commit is contained in:
parent
c35e10bd9a
commit
98db7f58cb
1 changed files with 16 additions and 4 deletions
20
terminal.h
20
terminal.h
|
|
@ -36,9 +36,10 @@ struct wayland {
|
||||||
struct xdg_toplevel *xdg_toplevel;
|
struct xdg_toplevel *xdg_toplevel;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rgba { double r, g, b, a; };
|
struct rgba { double r, g, b, a; } __attribute__((packed));
|
||||||
|
|
||||||
struct attributes {
|
struct attributes {
|
||||||
|
#if 0
|
||||||
bool bold;
|
bool bold;
|
||||||
bool italic;
|
bool italic;
|
||||||
bool underline;
|
bool underline;
|
||||||
|
|
@ -48,14 +49,25 @@ struct attributes {
|
||||||
bool reverse;
|
bool reverse;
|
||||||
bool have_foreground;
|
bool have_foreground;
|
||||||
bool have_background;
|
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 foreground; /* Only valid when have_foreground == true */
|
||||||
struct rgba background; /* Only valid when have_background == true */
|
struct rgba background; /* Only valid when have_background == true */
|
||||||
};
|
} __attribute__((packed));
|
||||||
|
|
||||||
struct cell {
|
struct cell {
|
||||||
char c[5];
|
|
||||||
struct attributes attrs;
|
struct attributes attrs;
|
||||||
};
|
char c[5];
|
||||||
|
} __attribute__((packed));
|
||||||
|
|
||||||
struct scroll_region {
|
struct scroll_region {
|
||||||
int start;
|
int start;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue