diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-03-22 21:57:14 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-03-22 21:57:14 +0000 |
commit | 83f98d6e5c303e52c1e0fb95b6237ebf62a8edfe (patch) | |
tree | ce30f57a4bf67dfea31b686bf841b33b8c0ed882 /src/sna/sna_accel.c | |
parent | 86121a3af9a9fc9a2c76d7ac9f3ec17105d20d80 (diff) |
sna: Correctly test for clear glyphs when searching for ones to skip
With xterm, it is quite common for it to redraw itself by using lots of
spaces and so it is efficient for us if we ellide those clear glyphs and
only draw the backing boxes. However, we were only checking the first 8
pixels in each line because of a missing pointer increment.
Fixes absent '=' characters when using a compositor and ImageText.
Reported-by: Jiri Slaby <jirislaby@gmail.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47735
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_accel.c')
-rw-r--r-- | src/sna/sna_accel.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index b8f5059e..f6bbeab5 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -10964,10 +10964,15 @@ sna_reversed_glyph_blt(DrawablePtr drawable, GCPtr gc, x1 = x + c->metrics.leftSideBearing; y1 = y - c->metrics.ascent; - if (x1 >= extents->x2 || y1 >= extents->y2) - goto skip; - if (x1 + w <= extents->x1 || y1 + h <= extents->y1) + if (x1 >= extents->x2 || y1 >= extents->y2 || + x1 + w <= extents->x1 || y1 + h <= extents->y1) { + DBG(("%s: glyph is clipped (%d, %d)x(%d,%d) against extents (%d, %d), (%d, %d)\n", + __FUNCTION__, + x1, y1, w, h, + extents->x1, extents->y1, + extents->x2, extents->y2)); goto skip; + } if (!transparent) { int clear = 1, j = h; @@ -10976,12 +10981,15 @@ sna_reversed_glyph_blt(DrawablePtr drawable, GCPtr gc, do { i = w8; do { - clear = *g == 0; + clear = *g++ == 0; } while (clear && --i); g += stride - w8; } while (clear && --j); - if (clear) + if (clear) { + DBG(("%s: skipping clear glyph for ImageGlyph\n", + __FUNCTION__)); goto skip; + } } if (!kgem_check_batch(&sna->kgem, 3+len)) { |