[cairo] [PATCH] Use the new pixman_glyph_cache_t API that will be in pixman 0.28.0
behdad at behdad.org
Wed May 30 18:36:50 PDT 2012
On 05/30/2012 08:30 PM, Søren Sandmann wrote:
> From: Søren Sandmann Pedersen <ssp at redhat.com>
> This new pixman API allows glyphs to be cached and composited in one
> go, which reduces overhead compared to individual calls to
Nice. Let me take a look. In the mean time, comments below.
> - There is an explicit call to _cairo_image_scaled_glyph_fini(). This
> could instead be done with a private, but I chose not to do that
> since we don't need to store any actual data; we only need
> notification when the glyph dies.
> - The mask format used with pixman_composite_glyphs() is that of the
> first glyph. This makes the implicit assumption that all the glyphs
> in the font have the same format, which I believe is true.
Keith thought so too. Wrong. See:
> Note that while the current code _looks_ like it will support both
> a8 and a8r8g8b8 glyphs within the same font, that is not actually
> the case since if the mask gets upgraded, adding a8 glyphs will
> produce the wrong result since the RGB channels are considered 0 in
> this format and so they will be drawn empty.
Again, wrong. I fixed and tested this. See:
The trick is:
status = _cairo_surface_composite (CAIRO_OPERATOR_ADD,
ie. use the glyph raster as mask, not source.
More information about the cairo