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

Chris Wilson chris at chris-wilson.co.uk
Tue Oct 9 10:24:26 PDT 2012


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

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the cairo mailing list