[cairo] [PATCH] Use the new pixman_glyph_cache_t API that will be in pixman 0.28.0

Chris Wilson chris at chris-wilson.co.uk
Thu May 31 06:05:16 PDT 2012


On Thu, 31 May 2012 08:43:08 -0400, Behdad Esfahbod <behdad at behdad.org> wrote:
> On 05/31/2012 04:06 AM, Chris Wilson wrote:
> > On Thu, 31 May 2012 06:18:16 +0200, sandmann at cs.au.dk (=?utf-8?Q?S=C3=B8ren?= Sandmann) wrote:
> >> Behdad Esfahbod <behdad at behdad.org> writes:
> >>
> >>>> The *current* code - master as of today - doesn't do this, but I do
> >>>> remember that the code used to do this, and I agree it's the right thing
> >>>> to do.
> >>>
> >>> I see. I see the code is commented out.  Not sure where image show_glyphs is
> >>> happening these days.
> >>
> >> It eventually ends up in composite_glyphs() in cairo-image-compositor.c.
> >> If you look at composite_glyphs_via_mask() you'll see that when the mask
> >> is "upgraded" from a8 to a8r8g8b8, what happens is that first the
> >> original a8 mask is SRCed to the new mask (basically losing the
> >> content), and then new glyphs are ADDed directly without a white source.
> > 
> > Oh, we don't get component expansion without the white source. So
> > 
> > if (glyph->format == mask->format)
> >   add(glyph, NULL, dst);
> > else
> >   add(white, glyph, dst);
> > 
> > Or should we rely on pixman doing that reduction? Seems like an easier
> > task for cairo.
> 
> I'm not following the math very closely here, but old code suggests that using
> the white source should work in all cases?  What am I missing?

Yes, it works everywhere. Dropping the white source and adding the glyph
directly to the mask when the formats match is merely an optimisation to
hit the pixman fastpaths (or faster paths).
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the cairo mailing list