[cairo] [patch] gl: skip using mask surface when source pattern is solid

Chris Wilson chris at chris-wilson.co.uk
Tue Oct 9 09:37:01 PDT 2012


On Tue, 9 Oct 2012 16:02:31 +0000, "Henry (Yu) Song - SISA" <hsong at sisa.samsung.com> wrote:
> Hi, Chris
> 
> My apology, you are right, how about following?

I think we can move the optimisation up into the core
cairo-composite-rectangles.c. I actually thought I had already done so!

Something like:

diff --git a/src/cairo-composite-rectangles.c
b/src/cairo-composite-rectangles.c
index c792985..c26098a 100644
--- a/src/cairo-composite-rectangles.c
+++ b/src/cairo-composite-rectangles.c
@@ -444,6 +444,13 @@ _cairo_composite_rectangles_init_for_glyphs (cairo_composit
     if (unlikely (status))
        return status;
 
+    if (overlap && *overlap &&
+       scaled_font->options.antialias == CAIRO_ANTIALIAS_NONE &&
+       _cairo_pattern_is_opaque_solid (&extents->source_pattern.base))
+    {
+       *overlap = FALSE;
+    }
+
     return _cairo_composite_rectangles_intersect (extents, clip);
 }

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the cairo mailing list