diff --git a/src/cairo-image-compositor.c b/src/cairo-image-compositor.c index 98f3a35b6..88bb90ce3 100644 --- a/src/cairo-image-compositor.c +++ b/src/cairo-image-compositor.c @@ -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);