diff options
author | Phil Jones <philj56@gmail.com> | 2022-06-25 14:03:27 +0100 |
---|---|---|
committer | Phil Jones <philj56@gmail.com> | 2022-06-25 14:03:27 +0100 |
commit | a6c20eb3713fc5e4b2c8f4075762b899bf9c1857 (patch) | |
tree | 3917d4528964fc8a24a518cc0401efe1e2e47508 /src/entry_backend/harfbuzz.c | |
parent | eacb7c80619dd0c2d8bf601215374f64779373b6 (diff) |
Don't double-draw background colour on first draw.
This improves start-up performance for large windows.
Diffstat (limited to 'src/entry_backend/harfbuzz.c')
-rw-r--r-- | src/entry_backend/harfbuzz.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/entry_backend/harfbuzz.c b/src/entry_backend/harfbuzz.c index ed15e82..f0a04e0 100644 --- a/src/entry_backend/harfbuzz.c +++ b/src/entry_backend/harfbuzz.c @@ -196,6 +196,10 @@ void entry_backend_harfbuzz_update(struct entry *entry) hb_buffer_t *buffer = entry->harfbuzz.hb_buffer; uint32_t width; + cairo_save(cr); + struct color color = entry->foreground_color; + cairo_set_source_rgba(cr, color.r, color.g, color.b, color.a); + /* Render the entry text */ hb_buffer_clear_contents(buffer); setup_hb_buffer(buffer); @@ -221,7 +225,7 @@ void entry_backend_harfbuzz_update(struct entry *entry) hb_shape(entry->harfbuzz.hb_font, buffer, NULL, 0); if (i == entry->selection) { cairo_save(cr); - struct color color = entry->selection_color; + color = entry->selection_color; cairo_set_source_rgba(cr, color.r, color.g, color.b, color.a); } width = render_hb_buffer(cr, buffer); @@ -229,4 +233,6 @@ void entry_backend_harfbuzz_update(struct entry *entry) cairo_restore(cr); } } + + cairo_restore(cr); } |