diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-03-12 17:37:01 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-03-12 17:37:01 +0000 |
commit | 4368a74b1c904625158f0b6baf98ef2a60bb54d4 (patch) | |
tree | d539601ca6ffd57b4e9b4772b780b1d1b6b6eabd /src/sna/sna_glyphs.c | |
parent | 08d73f1a4499cfe7c3121ff2ecdd36729c5f3544 (diff) |
sna: Add DBG around using pixman's glyph cache
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_glyphs.c')
-rw-r--r-- | src/sna/sna_glyphs.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c index 445d8b99..563bbb41 100644 --- a/src/sna/sna_glyphs.c +++ b/src/sna/sna_glyphs.c @@ -1030,6 +1030,8 @@ __sna_glyph_get_image(GlyphPtr g, ScreenPtr s) PicturePtr p; int dx, dy; + DBG(("%s: creating image cache for glyph %p (on screen %d)\n", __FUNCTION__, g, s->myNum)); + p = GetGlyphPicture(g, s); if (unlikely(p == NULL)) return NULL; @@ -1182,6 +1184,7 @@ glyphs_via_mask(struct sna *sna, if (glyph_image == NULL) goto next_pglyph; + DBG(("%s: inserting glyph %p into pixman cache\n", __FUNCTION__, g)); ptr = pixman_glyph_cache_insert(cache, g, NULL, g->info.x, g->info.y, @@ -1674,6 +1677,7 @@ glyphs_fallback(CARD8 op, if (glyph_image == NULL) goto next; + DBG(("%s: inserting glyph %p into pixman cache\n", __FUNCTION__, g)); ptr = pixman_glyph_cache_insert(cache, g, NULL, g->info.x, g->info.y, @@ -2103,6 +2107,7 @@ glyphs_via_image(struct sna *sna, if (glyph_image == NULL) goto next_pglyph; + DBG(("%s: inserting glyph %p into pixman cache\n", __FUNCTION__, g)); ptr = pixman_glyph_cache_insert(cache, g, NULL, g->info.x, g->info.y, @@ -2157,8 +2162,7 @@ next_pglyph: yi + g->info.height <= 0) goto next_image; - glyph_image = - sna_glyph_get_image(g, dst->pDrawable->pScreen); + glyph_image = sna_glyph_get_image(g, screen); if (glyph_image == NULL) goto next_image; @@ -2288,15 +2292,19 @@ sna_glyph_unrealize(ScreenPtr screen, GlyphPtr glyph) { struct sna_glyph *p = sna_glyph(glyph); - DBG(("%s: screen=%d, glyph(image?=%d, atlas?=%d)\n", - __FUNCTION__, screen->myNum, !!p->image, !!p->atlas)); + DBG(("%s: screen=%d, glyph=%p (image?=%d, atlas?=%d)\n", + __FUNCTION__, screen->myNum, glyph, !!p->image, + p->atlas && p->atlas != GetGlyphPicture(glyph, screen))); if (p->image) { #if HAS_PIXMAN_GLYPHS struct sna *sna = to_sna_from_screen(screen); - if (sna->render.glyph_cache) + if (sna->render.glyph_cache) { + DBG(("%s: removing glyph %p from pixman cache\n", + __FUNCTION__, glyph)); pixman_glyph_cache_remove(sna->render.glyph_cache, glyph, NULL); + } #endif pixman_image_unref(p->image); p->image = NULL; @@ -2311,4 +2319,9 @@ sna_glyph_unrealize(ScreenPtr screen, GlyphPtr glyph) cache->glyphs[p->pos >> 1] = NULL; p->atlas = NULL; } + +#if HAS_PIXMAN_GLYPHS + assert(to_sna_from_screen(screen)->render.glyph_cache == NULL || + pixman_glyph_cache_lookup(to_sna_from_screen(screen)->render.glyph_cache, glyph, NULL) == NULL); +#endif } |