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

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


Hi, Chris

Just want to clarify.  For alpha glyph image (generated by antialias_fast/default/good/gray using FT_RENDER_MODE_NORMAL in cairo-ft-font.c), the rendering principal is no difference from mask() operation with alpha-image as mask, except OPERATOR_CLEAR. There needs to be special case for OPERATOR_CLEAR.  For rgba image (generated by antialias_subpixel/best) text rendering, it is different from mask().  Please let me know if my understanding is wrong.

Thanks

Henry
________________________________________
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

--
Chris Wilson, Intel Open Source Technology Centre


More information about the cairo mailing list