sna: Fix typo in computation of texel offsets for tiled 8x8 blts

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53353
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-08-11 19:44:15 +01:00
parent b335d369bb
commit 44f848f9b2
1 changed files with 4 additions and 4 deletions

View File

@ -9458,10 +9458,10 @@ sna_poly_fill_rect_tiled_8x8_blt(DrawablePtr drawable,
sna_damage_add_rectangles(damage, r, n, dx, dy);
if (n == 1) {
tx = (r->x - origin->x) % 8;
if (tx < 8)
if (tx < 0)
tx = 8 - tx;
ty = (r->y - origin->y) % 8;
if (ty < 8)
if (ty < 0)
ty = 8 - ty;
assert(r->x + dx >= 0);
@ -9520,10 +9520,10 @@ sna_poly_fill_rect_tiled_8x8_blt(DrawablePtr drawable,
assert(r->y + dy + r->height <= pixmap->drawable.height);
tx = (r->x - origin->x) % 8;
if (tx < 8)
if (tx < 0)
tx = 8 - tx;
ty = (r->y - origin->y) % 8;
if (ty < 8)
if (ty < 0)
ty = 8 - ty;
b[0] = br00 | tx << 12 | ty << 8;