xserver: Branch 'master' - 2 commits

Keith Packard keithp at kemper.freedesktop.org
Sat Jul 1 21:14:52 EEST 2006


 hw/xfree86/xaa/xaaWideLine.c |   19 +++++--------------
 1 files changed, 5 insertions(+), 14 deletions(-)

New commits:
diff-tree 124a81eb389dfa510ac07ca93ee17c4c9d6e56ea (from parents)
Merge: d3d6c5f4d05e0ca5b566e19657e0fe2b3898482a 179737d4a07ed10a734fe017b5680f8e78ffda96
Author: Keith Packard <keithp at neko.keithp.com>
Date:   Sat Jul 1 11:12:50 2006 -0700

    Merge branch 'origin'

diff-tree d3d6c5f4d05e0ca5b566e19657e0fe2b3898482a (from caad8b724b97074e41de447fe77dda189f287a26)
Author: Paul Mackerras <paulus at samba.org>
Date:   Sat Jul 1 11:10:18 2006 -0700

    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.

diff --git a/hw/xfree86/xaa/xaaWideLine.c b/hw/xfree86/xaa/xaaWideLine.c
index fbec29e..369088e 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;



More information about the xorg-commit mailing list