summaryrefslogtreecommitdiff
path: root/src/ui/inputwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-03-13 19:59:41 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-03-13 19:59:41 +0200
commitf18c5e9a259c88f7bc3bbc9cf8afcf805ba00a60 (patch)
treee7838b803cad78eb1b0c5c0d15b4f6d639b0d400 /src/ui/inputwidget.c
parent379f8cea2044854be02622a561dd3c9cd9fb06c2 (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/inputwidget.c')
-rw-r--r--src/ui/inputwidget.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c
index 27f0217c..06e6373e 100644
--- a/src/ui/inputwidget.c
+++ b/src/ui/inputwidget.c
@@ -256,10 +256,12 @@ static iString *visText_InputWidget_(const iInputWidget *d) {
256} 256}
257 257
258static void updateBuffered_InputWidget_(iInputWidget *d) { 258static void updateBuffered_InputWidget_(iInputWidget *d) {
259 invalidateBuffered_InputWidget_(d); 259 if (isFinishedLaunching_App()) {
260 iString *visText = visText_InputWidget_(d); 260 invalidateBuffered_InputWidget_(d);
261 d->buffered = new_TextBuf(d->font, cstr_String(visText)); 261 iString *visText = visText_InputWidget_(d);
262 delete_String(visText); 262 d->buffered = new_TextBuf(d->font, cstr_String(visText));
263 delete_String(visText);
264 }
263} 265}
264 266
265void setText_InputWidget(iInputWidget *d, const iString *text) { 267void setText_InputWidget(iInputWidget *d, const iString *text) {