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.
This commit is contained in:
Paul Mackerras 2006-07-01 11:10:18 -07:00 committed by Keith Packard
parent caad8b724b
commit d3d6c5f4d0

View File

@ -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;