mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-20 05:33:47 -04:00
render: cache generated glyphs for regular ASCII characters
To avoid having to re-generate glyphs, cache the glyphs. For now, we only cache ASCII characters, as this allows us to lookup the cache by simply indexing with the character (into a 256-entry array).
This commit is contained in:
parent
c9803a2018
commit
6e55be1557
4 changed files with 47 additions and 8 deletions
|
|
@ -202,6 +202,11 @@ struct primary {
|
|||
uint32_t serial;
|
||||
};
|
||||
|
||||
struct glyph_cache {
|
||||
cairo_glyph_t *glyphs;
|
||||
int count;
|
||||
};
|
||||
|
||||
struct font {
|
||||
cairo_scaled_font_t *font;
|
||||
struct {
|
||||
|
|
@ -212,6 +217,8 @@ struct font {
|
|||
double position;
|
||||
double thickness;
|
||||
} strikeout;
|
||||
|
||||
struct glyph_cache glyph_cache[256];
|
||||
};
|
||||
|
||||
struct terminal {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue