Split the glyph cache
Do the glyph cache lookup in two steps: First find a cache for the given font+scale, then look up the glyph+flags. Since font+scale change much less frequently (in particular, they are the same for all glyphs in a text node), it makes sense to keep the result of the last lookup around and check if it still fits.
Here are changes in running widget-factory with no-vsync:
before | after | |
---|---|---|
gsk_gpu_device_lookup_glyph_image | 1.43% | 1.02% |
g_hash_table_lookup | 0.76% | 0.43% |
gsk_gpu_cached_glyph_equal | 0.28% | 0.21% |
This branch is on top of the scaled-font branch.
Edited by Matthias Clasen