[Pixman] Pixman glyph compositing

Søren Sandmann sandmann at cs.au.dk
Thu Jan 24 07:11:45 PST 2013


David Herrmann <dh.herrmann at googlemail.com> writes:

>> You could speed this up by caching the glyphs in a pixman_glyphs_t
>> structure and then using pixman_composite_glyphs(), or if you are sure
>> that your glyphs will never overlap each other,
>> pixman_composite_glyphs_no_mask().
>
> I already cache the glyphs in a hash-table that works pretty well.
> Also "perf" shows me that the glyph-lookup makes only 2% of the
> rendering-time. Does the pixman_glyph cache do more than that? Any
> other magic I am not aware of? Or is it a simple hash table? Because
> then I will probably stick with my own implementation.

The benefit of pixman_glyph_cache_t is that it avoids some overhead in
pixman_image_composite32(). For example, it only computes the composite
region once, and usually only does the fast path lookup once. For small
images like glyphs such overhead can be significant compared to the
actual compositing.


Søren


More information about the Pixman mailing list