Re: [patch] gl: skip using mask surface when source pattern is solid
"Henry (Yu) Song - SISA" <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <3955FA337689574EB32F94B12A7E6E9E246E0BC8@sisaex01sj> |
Hi, Chris I might not be too familiar with traps compositor. Does cairo always use A1/A8 for CAIRO_ANTIALIAS_DEFAULT/FAST/GOOD? I am sure antialias default generate A8 images. For alpha-only image, can we skip using mask surface? Thanks Henry ________________________________________ From: Chris Wilson [[email protected]] Sent: Tuesday, October 09, 2012 9:37 AM To: Henry (Yu) Song - SISA; [email protected] Subject: RE: [cairo] [patch] gl: skip using mask surface when source pattern is solid 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