summaryrefslogtreecommitdiff
path: root/hw/xfree86/xaa
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2006-07-01 11:10:18 -0700
committerKeith Packard <keithp@neko.keithp.com>2006-07-01 11:10:18 -0700
commitd3d6c5f4d05e0ca5b566e19657e0fe2b3898482a (patch)
treecc43625e1664262c0991b44b25361a53fb96449c /hw/xfree86/xaa
parentcaad8b724b97074e41de447fe77dda189f287a26 (diff)
Bug #7381: Coordinates get wrapped in accelerated line drawing on pixmap
XAAPolylinesWideSolid was adding the drawable origin onto each element in the pPts array. Since the values got stored back into the pPts array, they got truncated to 16 bits, causing the overflow I saw. This patch avoids storing the coords back into the pPts array (and actually reduces the size of the code too :). Now the 32-bit sum of coords + origin doesn't get truncated to 16 bits, and the problem is solved.
Diffstat (limited to 'hw/xfree86/xaa')
-rw-r--r--hw/xfree86/xaa/xaaWideLine.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/hw/xfree86/xaa/xaaWideLine.c b/hw/xfree86/xaa/xaaWideLine.c
index fbec29e7d..369088e32 100644
--- a/hw/xfree86/xaa/xaaWideLine.c
+++ b/hw/xfree86/xaa/xaaWideLine.c
@@ -818,20 +818,6 @@ XAAPolylinesWideSolid (
return;
}
- if (mode == CoordModePrevious) {
- pPts->x += xorg;
- pPts->y += yorg;
- } else if(xorg | yorg) {
- register int n = npt;
- register DDXPointPtr pts = pPts;
-
- while(n--) {
- pts->x += xorg;
- pts->y += yorg;
- pts++;
- }
- }
-
x2 = pPts->x;
y2 = pPts->y;
if (npt > 1) {
@@ -869,6 +855,8 @@ XAAPolylinesWideSolid (
infoRec->ClipBox->x2 - 1, infoRec->ClipBox->y2 - 1);
}
+ x2 += xorg;
+ y2 += yorg;
while (--npt) {
x1 = x2;
y1 = y2;
@@ -878,6 +866,9 @@ XAAPolylinesWideSolid (
if (mode == CoordModePrevious) {
x2 += x1;
y2 += y1;
+ } else {
+ x2 += xorg;
+ y2 += yorg;
}
if ((x1 != x2) || (y1 != y2)) {
somethingDrawn = TRUE;