summaryrefslogtreecommitdiff
path: root/exa/exa_accel.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2007-09-27 13:08:41 +0200
committerMichel Dänzer <michel@tungstengraphics.com>2007-09-27 13:30:58 +0200
commit006f6525057970a74382132237b2131286ad147c (patch)
treea317643b75118e67abe2ee026b3767127288a2b9 /exa/exa_accel.c
parentda7d9aa1fb60e13a59c9f842fed7aefc5b97c195 (diff)
EXA: Make sure tile offsets passed to drivers are never negative.
Thanks to Björn Steinbrink for pointing out the problem on IRC.
Diffstat (limited to 'exa/exa_accel.c')
-rw-r--r--exa/exa_accel.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index 142d556a0..908953589 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -1239,7 +1239,8 @@ exaFillRegionTiled (DrawablePtr pDrawable,
int dstY = pBox->y1;
int tileY;
- tileY = (dstY - yoff - pDrawable->y - pPatOrg->y) % tileHeight;
+ modulus(dstY - yoff - pDrawable->y - pPatOrg->y, tileHeight, tileY);
+
while (height > 0) {
int width = pBox->x2 - pBox->x1;
int dstX = pBox->x1;
@@ -1250,7 +1251,9 @@ exaFillRegionTiled (DrawablePtr pDrawable,
h = height;
height -= h;
- tileX = (dstX - xoff - pDrawable->x - pPatOrg->x) % tileWidth;
+ modulus(dstX - xoff - pDrawable->x - pPatOrg->x, tileWidth,
+ tileX);
+
while (width > 0) {
int w = tileWidth - tileX;
if (w > width)