From ad667d4afd9dc6d6a392a2abe1fe7475748e452a Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 21 Jan 2023 10:46:52 -0500 Subject: [PATCH] surface: Don't optimize away color glyphs The surface code was optimizing away show_text_glyphs based on the operator when the source pattern is clear. But if we are rendering color glyphs, that is not correct since we are using the glyphs as source. --- src/cairo-surface.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cairo-surface.c b/src/cairo-surface.c index 6f1a9b019..503a9a1c1 100644 --- a/src/cairo-surface.c +++ b/src/cairo-surface.c @@ -2933,8 +2933,12 @@ _cairo_surface_show_text_glyphs (cairo_surface_t *surface, if (unlikely (status)) return status; - if (nothing_to_do (surface, op, source)) - return CAIRO_STATUS_SUCCESS; + if (!(_cairo_scaled_font_has_color_glyphs (scaled_font) && + scaled_font->options.color_mode != CAIRO_COLOR_MODE_NO_COLOR)) + { + if (nothing_to_do (surface, op, source)) + return CAIRO_STATUS_SUCCESS; + } status = _cairo_surface_begin_modification (surface); if (unlikely (status))