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

Chris Wilson <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
On Tue, 9 Oct 2012 16:02:31 +0000, "Henry (Yu) Song - SISA" <[email protected]> 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
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.