From 903b0de539844c144c63ea57c30e84a23360c290 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 17 Dec 2017 21:24:53 -0500 Subject: [PATCH] Fix a logic error in color glyph compositing When a color glyph is completely clipped away, we get the non-zero status 'nothing to do'. In that case, we must not exit early, since there might still be work to do for the other color glyphs. This bug was showing up as color glyphs stopping to render in GTK+ entries that are scrolled to the right, and also as color glyphs not rendering inside the selection sometimes. See https://bugzilla.gnome.org/show_bug.cgi?id=790255 and https://bugzilla.gnome.org/show_bug.cgi?id=788071. --- src/cairo-surface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cairo-surface.c b/src/cairo-surface.c index 961894a14..18f63df30 100644 --- a/src/cairo-surface.c +++ b/src/cairo-surface.c @@ -2742,7 +2742,7 @@ composite_color_glyphs (cairo_surface_t *surface, status = composite_one_color_glyph (surface, op, source, clip, &glyphs[gp], scaled_glyph); - if (unlikely (status)) + if (unlikely (status && status != CAIRO_INT_STATUS_NOTHING_TO_DO)) goto UNLOCK; } @@ -2776,7 +2776,7 @@ composite_color_glyphs (cairo_surface_t *surface, status = composite_one_color_glyph (surface, op, source, clip, &glyphs[glyph_pos], scaled_glyph); - if (unlikely (status)) + if (unlikely (status && status != CAIRO_INT_STATUS_NOTHING_TO_DO)) goto UNLOCK; } @@ -2854,7 +2854,7 @@ _cairo_surface_show_text_glyphs (cairo_surface_t *surface, scaled_font, clip); - if (unlikely (status)) + if (unlikely (status && status != CAIRO_INT_STATUS_NOTHING_TO_DO)) goto DONE; if (num_glyphs == 0)