sna/glyphs: Discard GLYPH_PICTURE hint if the glyph doesn't fit into the cache

If the glyph is too big to fit into the cache, than ideally we do want
to keep an associated GPU bo around for future use. As it is too large
to fit into the cache, it of reasonable size and there is little wastage
in allocating indiviual GPU bo for each oversized glyph.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-07-13 17:38:41 +01:00
parent 12f52530db
commit fbdbfaf38d
1 changed files with 3 additions and 1 deletions

View File

@ -305,8 +305,10 @@ glyph_cache(ScreenPtr screen,
int size, mask, pos, s;
if (glyph->info.width > GLYPH_MAX_SIZE ||
glyph->info.height > GLYPH_MAX_SIZE)
glyph->info.height > GLYPH_MAX_SIZE) {
((PixmapPtr)glyph_picture->pDrawable)->usage_hint = 0;
return FALSE;
}
for (size = GLYPH_MIN_SIZE; size <= GLYPH_MAX_SIZE; size *= 2)
if (glyph->info.width <= size && glyph->info.height <= size)