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

Henry (Yu) Song - SISA hsong at sisa.samsung.com
Tue Oct 9 13:34:23 PDT 2012

Hi, Chris

I re-read code again.  Unless it is antialias_subpixel/best, cairo generates alpha-only images.  Currently, in msaa compositor, we can skip using mask surface with certain operators with alpha-image glyphs.  in cairogles repo we are maintaining, I also did some optimization on checking overlapping bounding boxes to avoid setting overlapping to be true.  Use mask surface kills performance. 

I am not familiar with other backends, just worry about setting overlapping in core composite-rectangles might affect other backends.



From: Chris Wilson [chris at chris-wilson.co.uk]
Sent: Tuesday, October 09, 2012 10:24 AM
To: Henry (Yu) Song - SISA; cairo at cairographics.org
Subject: RE: [cairo] [patch] gl: skip using mask surface when source pattern is solid

On Tue, 9 Oct 2012 17:06:07 +0000, "Henry (Yu) Song - SISA" <hsong at sisa.samsung.com> wrote:
> 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?

There's no hard and fast rule, as the glyph surfaces are generated by
freetype more or less irrespective of the font's antialiasing options.
So the only presumption that I think is safe is that if antialiasing is
disabled then we know that the glyph pixels are either completely opaque
or clear, and only under those circumstances can we drop the mask given
overlapping glyphs. (Something to check is whether the glyph bounding
box is as tight as it should be coming out of freetype.)

One thing to think about is whether an antialias hint should override
the quality concern (i.e. if the geometry antialias hint was FAST skip
the mask).

Chris Wilson, Intel Open Source Technology Centre

More information about the cairo mailing list