diff options
author | Michel Dänzer <michel@tungstengraphics.com> | 2007-09-27 13:08:41 +0200 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2007-11-17 22:40:36 +0100 |
commit | 75b9dc907b332d64d074083cae0c6b099960f09b (patch) | |
tree | 040f6ab513cc8cde774985e37bea07415c5ef0c7 /exa | |
parent | 732d586b0919e57ed836999f4117db3e776e2934 (diff) |
EXA: Make sure tile offsets passed to drivers are never negative.
Thanks to Björn Steinbrink for pointing out the problem on IRC.
(cherry picked from commit 006f6525057970a74382132237b2131286ad147c with
modifications.)
Diffstat (limited to 'exa')
-rw-r--r-- | exa/exa_accel.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/exa/exa_accel.c b/exa/exa_accel.c index acc5dbee3..aed4e421c 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -1187,7 +1187,8 @@ exaFillRegionTiled (DrawablePtr pDrawable, int dstY = pBox->y1; int tileY; - tileY = (dstY - pDrawable->y - pPatOrg->y) % tileHeight; + modulus(dstY - pDrawable->y - pPatOrg->y, tileHeight, tileY); + while (height > 0) { int width = pBox->x2 - pBox->x1; int dstX = pBox->x1; @@ -1198,7 +1199,8 @@ exaFillRegionTiled (DrawablePtr pDrawable, h = height; height -= h; - tileX = (dstX - pDrawable->x - pPatOrg->x) % tileWidth; + modulus(dstX - pDrawable->x - pPatOrg->x, tileWidth, tileX); + while (width > 0) { int w = tileWidth - tileX; if (w > width) |