From a6c20eb3713fc5e4b2c8f4075762b899bf9c1857 Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Sat, 25 Jun 2022 14:03:27 +0100 Subject: Don't double-draw background colour on first draw. This improves start-up performance for large windows. --- src/entry_backend/harfbuzz.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/entry_backend/harfbuzz.c') 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); } -- cgit v1.2.3