summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-07-13 17:38:41 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-07-13 17:41:02 +0100
commitfbdbfaf38d4da5204750d91cf5a3f43307a6ac33 (patch)
tree0afbe8faaf815afd8d6f95ecf6a9e31b5055593a
parent12f52530db1727e2f835e55dc922e5efaf4d3a16 (diff)
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>
-rw-r--r--src/sna/sna_glyphs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index 224154e6..87a67192 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -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)