colors: store as doubles, rather than uint32_t

Since cairo uses doubles, we don't want to have to convert a uin32_t
to double values every time we render a cell.
This commit is contained in:
Daniel Eklöf 2019-06-26 20:33:32 +02:00
parent 54403738bb
commit 1dbddd7155
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 73 additions and 55 deletions

View file

@ -11,6 +11,8 @@
#include "tllist.h"
struct rgba { double r, g, b, a; };
struct attributes {
bool bold;
bool italic;
@ -21,8 +23,8 @@ struct attributes {
bool reverse;
bool have_foreground;
bool have_background;
uint32_t foreground; /* Only valid when have_foreground == true */
uint32_t background; /* Only valid when have_background == true */
struct rgba foreground; /* Only valid when have_foreground == true */
struct rgba background; /* Only valid when have_background == true */
};
struct cell {
@ -76,8 +78,8 @@ struct grid {
int col;
} alt_saved_cursor;
uint32_t foreground;
uint32_t background;
struct rgba foreground;
struct rgba background;
tll(struct damage) damage;
tll(struct damage) scroll_damage;