xf86-video-intel: src/sna/sna_accel.c
Chris Wilson
ickle at kemper.freedesktop.org
Thu Mar 22 14:55:23 PDT 2012
src/sna/sna_accel.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
New commits:
commit 83f98d6e5c303e52c1e0fb95b6237ebf62a8edfe
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Thu Mar 22 21:57:14 2012 +0000
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 at gmail.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47735
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index b8f5059..f6bbeab 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)) {
More information about the xorg-commit
mailing list