From 92119ef0939897dd1850b417d04a2ba558aee8ca Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 24 Jun 2014 10:23:03 +0100 Subject: sna/glyphs: Clip damage to dst We only check if the hardware will automatically discard writes outside of the target pixmap, but we must manually clip the damage before adding it to our tracker. Reported-by: Jiri Slaby Reported-by: Zdenek Kabelac References: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c58 Signed-off-by: Chris Wilson --- src/sna/sna_glyphs.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c index 96279e66..28cb58df 100644 --- a/src/sna/sna_glyphs.c +++ b/src/sna/sna_glyphs.c @@ -548,7 +548,15 @@ static inline bool clipped_glyphs(PicturePtr dst, int nlist, GlyphListPtr list, if (dst->pCompositeClip->data == NULL && region_matches_pixmap(dst->pCompositeClip, get_drawable_pixmap(dst->pDrawable))) { - DBG(("%s: no, region matches drawable\n", __FUNCTION__)); + DBG(("%s: no, clip region (%d, %d), (%d, %d) matches drawable pixmap=%ld size=%dx%d\n", + __FUNCTION__, + dst->pCompositeClip->extents.x1, + dst->pCompositeClip->extents.y1, + dst->pCompositeClip->extents.x2, + dst->pCompositeClip->extents.y2, + get_drawable_pixmap(dst->pDrawable), + get_drawable_pixmap(dst->pDrawable)->drawable.width, + get_drawable_pixmap(dst->pDrawable)->drawable.height)); return false; } @@ -900,7 +908,7 @@ next_glyph_N: r.width, r.height)); tmp.blt(sna, &tmp, &r); - apply_damage(&tmp, &r); + apply_damage_clipped_to_dst(&tmp, &r, dst->pDrawable); next_glyph_0: x += glyph->info.xOff; -- cgit v1.2.3