diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-13 19:59:41 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-13 19:59:41 +0200 |
commit | f18c5e9a259c88f7bc3bbc9cf8afcf805ba00a60 (patch) | |
tree | e7838b803cad78eb1b0c5c0d15b4f6d639b0d400 /src/ui/text.h | |
parent | 379f8cea2044854be02622a561dd3c9cd9fb06c2 (diff) |
Text: Separate glyph caching procedure
Previously glyph caching was done during text rendering, but that would mean lots of swapping between rendering stuff to the cache and then immediately afterward rendering to the display. There would be a swap per each new glyph.
Now the entire document's glyphs are precached at once when a request is finished. Glyphs are also cached in larger batches when new text needs to be drawn.
Diffstat (limited to 'src/ui/text.h')
-rw-r--r-- | src/ui/text.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ui/text.h b/src/ui/text.h index 897dfed0..606096b6 100644 --- a/src/ui/text.h +++ b/src/ui/text.h | |||
@@ -192,6 +192,8 @@ enum iAlignment { | |||
192 | 192 | ||
193 | void setOpacity_Text (float opacity); | 193 | void setOpacity_Text (float opacity); |
194 | 194 | ||
195 | void cache_Text (int fontId, iRangecc text); /* pre-render glyphs */ | ||
196 | |||
195 | void draw_Text (int fontId, iInt2 pos, int color, const char *text, ...); | 197 | void draw_Text (int fontId, iInt2 pos, int color, const char *text, ...); |
196 | void drawAlign_Text (int fontId, iInt2 pos, int color, enum iAlignment align, const char *text, ...); | 198 | void drawAlign_Text (int fontId, iInt2 pos, int color, enum iAlignment align, const char *text, ...); |
197 | void drawCentered_Text (int fontId, iRect rect, iBool alignVisual, int color, const char *text, ...); | 199 | void drawCentered_Text (int fontId, iRect rect, iBool alignVisual, int color, const char *text, ...); |