diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-12-27 15:26:46 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-12-27 15:33:51 +0000 |
commit | 8fc21328a0bdf87fde35d68d2b27834011acde7b (patch) | |
tree | fb6306d5dfde32fb9ee61e601ac3a41eb340629d | |
parent | 726290ea2a54716d3d8fb998fe7d2ab252421de7 (diff) |
sna: Don't discard empty glyphs, just skip them
A space is encoded as a 1x1 blank glyph, but we still need to advance by
its character width and so we cannot simply discard the glyph.
References: https://bugs.freedesktop.org/show_bug.cgi?id=44091id=44091
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index a03e0bc7..746464b8 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -7786,6 +7786,9 @@ sna_glyph_blt(DrawablePtr drawable, GCPtr gc, int w8 = (w + 7) >> 3; int x1, y1, len; + if (c->bits == (void *)1) + goto skip; + len = (w8 * h + 7) >> 3 << 1; DBG(("%s glyph: (%d, %d) x (%d[%d], %d), len=%d\n" ,__FUNCTION__, x,y, w, w8, h, len)); @@ -7920,9 +7923,9 @@ static bool sna_set_glyph(CharInfoPtr in, CharInfoPtr out) } /* Skip empty glyphs */ - if (w == 1 && h == 1 && (in->bits[0] & 1) == 0) { - out->bits = (void *)-1; - return false; + if ((w|h) == 1 && (in->bits[0] & 1) == 0) { + out->bits = (void *)1; + return true; } w = (w + 7) >> 3; |