mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-19 05:20:44 +01:00
Don't cache glyphs with fine subpixel grid
Having up to 16x16 variants of each glyph in the cache is a bit too much, and GTK does not need any caching, since it is doing its own caching in a texture atlas.
This commit is contained in:
parent
a5ca8899e4
commit
024617e5ec
1 changed files with 14 additions and 0 deletions
|
|
@ -960,6 +960,20 @@ composite_glyphs (void *_dst,
|
|||
glyph_cache, pg - pglyphs, pglyphs);
|
||||
}
|
||||
|
||||
/* Don't keep 64x64 versions of each glyph in the cache */
|
||||
if (info->font->options.subpixel_positions == CAIRO_SUBPIXEL_POSITIONS_FINE) {
|
||||
int res = _cairo_subpixel_resolution (info->font->options.subpixel_positions);
|
||||
for (i = 0; i < info->num_glyphs; i++) {
|
||||
unsigned long index = info->glyphs[i].index;
|
||||
unsigned long xphase, yphase;
|
||||
xphase = _cairo_subpixel_phase (info->glyphs[i].x, res);
|
||||
yphase = _cairo_subpixel_phase (info->glyphs[i].y, res);
|
||||
index = index | (xphase << XSHIFT) | (yphase << YSHIFT);
|
||||
|
||||
pixman_glyph_cache_remove (glyph_cache, info->font, (void *)(uintptr_t)index);
|
||||
}
|
||||
}
|
||||
|
||||
out_thaw:
|
||||
pixman_glyph_cache_thaw (glyph_cache);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue