[PATCH xserver 2/2] Eliminate coordinate mode in PolyPoint, PolyLines and FillPolygon ops

Keith Packard keithp at keithp.com
Thu Sep 22 22:15:33 UTC 2016


Doing this in DIX makes the drivers all simpler and fixes bugs in
a couple of wrappers which got CoordModePrevious wrong.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 dix/dispatch.c                         |  36 ++++++++++--
 exa/exa_accel.c                        |  26 +++------
 exa/exa_priv.h                         |   4 +-
 exa/exa_unaccel.c                      |  10 ++--
 fb/fb.h                                |  15 ++---
 fb/fbbits.h                            |   5 +-
 fb/fbline.c                            |  27 ++-------
 fb/fbpoint.c                           |  15 +----
 fb/wfbrename.h                         |   1 -
 glamor/glamor_dash.c                   |   6 +-
 glamor/glamor_lines.c                  |  35 ++++--------
 glamor/glamor_points.c                 |  20 ++-----
 glamor/glamor_priv.h                   |   6 +-
 hw/dmx/dmxgcops.c                      |  12 ++--
 hw/dmx/dmxgcops.h                      |   6 +-
 hw/xfree86/common/xf86VGAarbiter.c     |  12 ++--
 hw/xfree86/common/xf86VGAarbiterPriv.h |   6 +-
 hw/xnest/GCOps.c                       |  12 ++--
 hw/xnest/GCOps.h                       |   6 +-
 include/gcstruct.h                     |   3 -
 mi/mi.h                                |   7 ---
 mi/mipoly.c                            |  14 +----
 mi/mipolypnt.c                         |  17 +-----
 mi/mipolyrect.c                        |   4 +-
 mi/mipolyseg.c                         |   2 +-
 mi/miwideline.c                        |  63 ++++-----------------
 mi/mizerarc.c                          |   4 +-
 mi/mizerline.c                         |  10 +---
 miext/damage/damage.c                  |  92 +++++++++---------------------
 miext/rootless/rootlessGC.c            | 100 ++++++++++-----------------------
 30 files changed, 182 insertions(+), 394 deletions(-)

diff --git a/dix/dispatch.c b/dix/dispatch.c
index 26a461b..277f821 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -1683,6 +1683,21 @@ SendGraphicsExpose(ClientPtr client, RegionPtr pRgn, XID drawable,
     }
 }
 
+static void
+FixCoordModePrevious(int npt, xPoint *ppt)
+{
+    int x, y;
+
+    x = ppt->x;
+    y = ppt->y;
+    npt--;
+    while (npt--) {
+        ppt++;
+        x = (ppt->x += x);
+        y = (ppt->y += y);
+    }
+}
+
 int
 ProcCopyArea(ClientPtr client)
 {
@@ -1785,9 +1800,12 @@ ProcPolyPoint(ClientPtr client)
     }
     VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
     npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyPointReq));
-    if (npoint)
-        (*pGC->ops->PolyPoint) (pDraw, pGC, stuff->coordMode, npoint,
+    if (npoint) {
+        if (stuff->coordMode == CoordModePrevious)
+            FixCoordModePrevious(npoint, (xPoint *) &stuff[1]);
+        (*pGC->ops->PolyPoint) (pDraw, pGC, npoint,
                                 (xPoint *) &stuff[1]);
+    }
     return Success;
 }
 
@@ -1808,9 +1826,12 @@ ProcPolyLine(ClientPtr client)
     }
     VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
     npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyLineReq));
-    if (npoint > 1)
-        (*pGC->ops->Polylines) (pDraw, pGC, stuff->coordMode, npoint,
+    if (npoint > 1) {
+        if (stuff->coordMode == CoordModePrevious)
+            FixCoordModePrevious(npoint, (xPoint *) &stuff[1]);
+        (*pGC->ops->Polylines) (pDraw, pGC, npoint,
                                 (DDXPointPtr) &stuff[1]);
+    }
     return Success;
 }
 
@@ -1898,10 +1919,13 @@ ProcFillPoly(ClientPtr client)
 
     VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
     things = bytes_to_int32((client->req_len << 2) - sizeof(xFillPolyReq));
-    if (things)
+    if (things > 2) {
+        if (stuff->coordMode == CoordModePrevious)
+            FixCoordModePrevious(things, (xPoint *) &stuff[1]);
         (*pGC->ops->FillPolygon) (pDraw, pGC, stuff->shape,
-                                  stuff->coordMode, things,
+                                  things,
                                   (DDXPointPtr) &stuff[1]);
+    }
     return Success;
 }
 
diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index b26d5c8..ae23928 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -611,7 +611,7 @@ exaCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC,
 }
 
 static void
-exaPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
+exaPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int npt,
              DDXPointPtr ppt)
 {
     ExaScreenPriv(pDrawable->pScreen);
@@ -622,7 +622,7 @@ exaPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
      * points.
      */
     if (pExaScr->fallback_counter || pGC->fillStyle != FillSolid) {
-        ExaCheckPolyPoint(pDrawable, pGC, mode, npt, ppt);
+        ExaCheckPolyPoint(pDrawable, pGC, npt, ppt);
         return;
     }
 
@@ -630,10 +630,6 @@ exaPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
     for (i = 0; i < npt; i++) {
         prect[i].x = ppt[i].x;
         prect[i].y = ppt[i].y;
-        if (i > 0 && mode == CoordModePrevious) {
-            prect[i].x += prect[i - 1].x;
-            prect[i].y += prect[i - 1].y;
-        }
         prect[i].width = 1;
         prect[i].height = 1;
     }
@@ -647,7 +643,7 @@ exaPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
  * acceleration if so.
  */
 static void
-exaPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
+exaPolylines(DrawablePtr pDrawable, GCPtr pGC, int npt,
              DDXPointPtr ppt)
 {
     ExaScreenPriv(pDrawable->pScreen);
@@ -656,14 +652,14 @@ exaPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
     int i;
 
     if (pExaScr->fallback_counter) {
-        ExaCheckPolylines(pDrawable, pGC, mode, npt, ppt);
+        ExaCheckPolylines(pDrawable, pGC, npt, ppt);
         return;
     }
 
     /* Don't try to do wide lines or non-solid fill style. */
     if (pGC->lineWidth != 0 || pGC->lineStyle != LineSolid ||
         pGC->fillStyle != FillSolid) {
-        ExaCheckPolylines(pDrawable, pGC, mode, npt, ppt);
+        ExaCheckPolylines(pDrawable, pGC, npt, ppt);
         return;
     }
 
@@ -672,18 +668,12 @@ exaPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
     y1 = ppt[0].y;
     /* If we have any non-horizontal/vertical, fall back. */
     for (i = 0; i < npt - 1; i++) {
-        if (mode == CoordModePrevious) {
-            x2 = x1 + ppt[i + 1].x;
-            y2 = y1 + ppt[i + 1].y;
-        }
-        else {
-            x2 = ppt[i + 1].x;
-            y2 = ppt[i + 1].y;
-        }
+        x2 = ppt[i + 1].x;
+        y2 = ppt[i + 1].y;
 
         if (x1 != x2 && y1 != y2) {
             free(prect);
-            ExaCheckPolylines(pDrawable, pGC, mode, npt, ppt);
+            ExaCheckPolylines(pDrawable, pGC, npt, ppt);
             return;
         }
 
diff --git a/exa/exa_priv.h b/exa/exa_priv.h
index ca4db72..ba0830a 100644
--- a/exa/exa_priv.h
+++ b/exa/exa_priv.h
@@ -393,13 +393,13 @@ ExaCheckCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
 
 void
 
-ExaCheckPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
+ExaCheckPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int npt,
                   DDXPointPtr pptInit);
 
 void
 
 ExaCheckPolylines(DrawablePtr pDrawable, GCPtr pGC,
-                  int mode, int npt, DDXPointPtr ppt);
+                  int npt, DDXPointPtr ppt);
 
 void
 
diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
index 73eada9..efee8d0 100644
--- a/exa/exa_unaccel.c
+++ b/exa/exa_unaccel.c
@@ -242,29 +242,29 @@ ExaCheckCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
 }
 
 void
-ExaCheckPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
+ExaCheckPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int npt,
                   DDXPointPtr pptInit)
 {
     EXA_PRE_FALLBACK_GC(pGC);
     EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
     exaPrepareAccess(pDrawable, EXA_PREPARE_DEST);
-    pGC->ops->PolyPoint(pDrawable, pGC, mode, npt, pptInit);
+    pGC->ops->PolyPoint(pDrawable, pGC, npt, pptInit);
     exaFinishAccess(pDrawable, EXA_PREPARE_DEST);
     EXA_POST_FALLBACK_GC(pGC);
 }
 
 void
 ExaCheckPolylines(DrawablePtr pDrawable, GCPtr pGC,
-                  int mode, int npt, DDXPointPtr ppt)
+                  int npt, DDXPointPtr ppt)
 {
     EXA_PRE_FALLBACK_GC(pGC);
     EXA_FALLBACK(("to %p (%c), width %d, mode %d, count %d\n",
                   pDrawable, exaDrawableLocation(pDrawable),
-                  pGC->lineWidth, mode, npt));
+                  pGC->lineWidth, npt));
 
     exaPrepareAccess(pDrawable, EXA_PREPARE_DEST);
     exaPrepareAccessGC(pGC);
-    pGC->ops->Polylines(pDrawable, pGC, mode, npt, ppt);
+    pGC->ops->Polylines(pDrawable, pGC, npt, ppt);
     exaFinishAccessGC(pGC);
     exaFinishAccess(pDrawable, EXA_PREPARE_DEST);
     EXA_POST_FALLBACK_GC(pGC);
diff --git a/fb/fb.h b/fb/fb.h
index c687aa7..c9b1a57 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -657,7 +657,7 @@ fbGlyph8(FbBits * dstLine,
 extern _X_EXPORT void
 
 fbPolyline8(DrawablePtr pDrawable,
-            GCPtr pGC, int mode, int npt, DDXPointPtr ptsOrig);
+            GCPtr pGC, int npt, DDXPointPtr ptsOrig);
 
 extern _X_EXPORT void
  fbPolySegment8(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg);
@@ -705,7 +705,7 @@ fbGlyph16(FbBits * dstLine,
 extern _X_EXPORT void
 
 fbPolyline16(DrawablePtr pDrawable,
-             GCPtr pGC, int mode, int npt, DDXPointPtr ptsOrig);
+             GCPtr pGC, int npt, DDXPointPtr ptsOrig);
 
 extern _X_EXPORT void
  fbPolySegment16(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg);
@@ -746,7 +746,7 @@ fbArc24(FbBits * dst,
 
 extern _X_EXPORT void
 fbPolyline24(DrawablePtr pDrawable,
-             GCPtr pGC, int mode, int npt, DDXPointPtr ptsOrig);
+             GCPtr pGC, int npt, DDXPointPtr ptsOrig);
 
 extern _X_EXPORT void
  fbPolySegment24(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg);
@@ -793,7 +793,7 @@ fbGlyph32(FbBits * dstLine,
 extern _X_EXPORT void
 
 fbPolyline32(DrawablePtr pDrawable,
-             GCPtr pGC, int mode, int npt, DDXPointPtr ptsOrig);
+             GCPtr pGC, int npt, DDXPointPtr ptsOrig);
 
 extern _X_EXPORT void
  fbPolySegment32(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg);
@@ -1094,10 +1094,7 @@ fbGetImage(DrawablePtr pDrawable,
 
 extern _X_EXPORT void
 fbPolyLine(DrawablePtr pDrawable,
-           GCPtr pGC, int mode, int npt, DDXPointPtr ppt);
-
-extern _X_EXPORT void
- fbFixCoordModePrevious(int npt, DDXPointPtr ppt);
+           GCPtr pGC, int npt, DDXPointPtr ppt);
 
 extern _X_EXPORT void
  fbPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg);
@@ -1141,7 +1138,7 @@ extern _X_EXPORT RegionPtr
 extern _X_EXPORT void
 
 fbPolyPoint(DrawablePtr pDrawable,
-            GCPtr pGC, int mode, int npt, xPoint * pptInit);
+            GCPtr pGC, int npt, xPoint * pptInit);
 
 /*
  * fbpush.c
diff --git a/fb/fbbits.h b/fb/fbbits.h
index be32d8c..7d7eb89 100644
--- a/fb/fbbits.h
+++ b/fb/fbbits.h
@@ -594,7 +594,7 @@ GLYPH(FbBits * dstBits,
 #ifdef POLYLINE
 void
 POLYLINE(DrawablePtr pDrawable,
-         GCPtr pGC, int mode, int npt, DDXPointPtr ptsOrig)
+         GCPtr pGC, int npt, DDXPointPtr ptsOrig)
 {
     INT32 *pts = (INT32 *) ptsOrig;
     int xoff = pDrawable->x;
@@ -620,9 +620,6 @@ POLYLINE(DrawablePtr pDrawable,
     int stepmajor, stepminor;
     int octant;
 
-    if (mode == CoordModePrevious)
-        fbFixCoordModePrevious(npt, ptsOrig);
-
     fbGetDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
     bitsStride = dstStride * (sizeof(FbBits) / sizeof(UNIT));
     bitsBase =
diff --git a/fb/fbline.c b/fb/fbline.c
index 3e582e6..07cd18e 100644
--- a/fb/fbline.c
+++ b/fb/fbline.c
@@ -27,7 +27,7 @@
 #include "fb.h"
 
 static void
-fbZeroLine(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ppt)
+fbZeroLine(DrawablePtr pDrawable, GCPtr pGC, int npt, DDXPointPtr ppt)
 {
     int x1, y1, x2, y2;
     int x, y;
@@ -42,10 +42,6 @@ fbZeroLine(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ppt)
         ++ppt;
         x2 = ppt->x;
         y2 = ppt->y;
-        if (mode == CoordModePrevious) {
-            x2 += x1;
-            y2 += y1;
-        }
         fbSegment(pDrawable, pGC, x1 + x, y1 + y,
                   x2 + x, y2 + y,
                   npt == 1 && pGC->capStyle != CapNotLast, &dashOffset);
@@ -73,24 +69,9 @@ fbZeroSegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pSegs)
 }
 
 void
-fbFixCoordModePrevious(int npt, DDXPointPtr ppt)
-{
-    int x, y;
-
-    x = ppt->x;
-    y = ppt->y;
-    npt--;
-    while (npt--) {
-        ppt++;
-        x = (ppt->x += x);
-        y = (ppt->y += y);
-    }
-}
-
-void
-fbPolyLine(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ppt)
+fbPolyLine(DrawablePtr pDrawable, GCPtr pGC, int npt, DDXPointPtr ppt)
 {
-    void (*line) (DrawablePtr, GCPtr, int mode, int npt, DDXPointPtr ppt);
+    void (*line) (DrawablePtr, GCPtr, int npt, DDXPointPtr ppt);
 
     if (pGC->lineWidth == 0) {
         line = fbZeroLine;
@@ -119,7 +100,7 @@ fbPolyLine(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ppt)
         else
             line = miWideLine;
     }
-    (*line) (pDrawable, pGC, mode, npt, ppt);
+    (*line) (pDrawable, pGC, npt, ppt);
 }
 
 void
diff --git a/fb/fbpoint.c b/fb/fbpoint.c
index be7c801..62c2b78 100644
--- a/fb/fbpoint.c
+++ b/fb/fbpoint.c
@@ -94,7 +94,7 @@ fbDots(FbBits * dstOrig,
 
 void
 fbPolyPoint(DrawablePtr pDrawable,
-            GCPtr pGC, int mode, int nptInit, xPoint * pptInit)
+            GCPtr pGC, int nptInit, xPoint * pptInit)
 {
     FbGCPrivPtr pPriv = fbGetGCPrivate(pGC);
     RegionPtr pClip = fbGetCompositeClip(pGC);
@@ -104,22 +104,9 @@ fbPolyPoint(DrawablePtr pDrawable,
     int dstXoff, dstYoff;
     FbDots dots;
     FbBits and, xor;
-    xPoint *ppt;
-    int npt;
     BoxPtr pBox;
     int nBox;
 
-    /* make pointlist origin relative */
-    ppt = pptInit;
-    npt = nptInit;
-    if (mode == CoordModePrevious) {
-        npt--;
-        while (npt--) {
-            ppt++;
-            ppt->x += (ppt - 1)->x;
-            ppt->y += (ppt - 1)->y;
-        }
-    }
     fbGetDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
     and = pPriv->and;
     xor = pPriv->xor;
diff --git a/fb/wfbrename.h b/fb/wfbrename.h
index baa80f8..dc53034 100644
--- a/fb/wfbrename.h
+++ b/fb/wfbrename.h
@@ -62,7 +62,6 @@
 #define fbFill wfbFill
 #define fbFillRegionSolid wfbFillRegionSolid
 #define fbFillSpans wfbFillSpans
-#define fbFixCoordModePrevious wfbFixCoordModePrevious
 #define fbGCFuncs wfbGCFuncs
 #define fbGCOps wfbGCOps
 #define fbGeneration wfbGeneration
diff --git a/glamor/glamor_dash.c b/glamor/glamor_dash.c
index 3c19dba..fe39b90 100644
--- a/glamor/glamor_dash.c
+++ b/glamor/glamor_dash.c
@@ -238,7 +238,7 @@ glamor_line_length(short x1, short y1, short x2, short y2)
 
 Bool
 glamor_poly_lines_dash_gl(DrawablePtr drawable, GCPtr gc,
-                          int mode, int n, DDXPointPtr points)
+                          int n, DDXPointPtr points)
 {
     ScreenPtr screen = drawable->pScreen;
     glamor_program *prog;
@@ -275,10 +275,6 @@ glamor_poly_lines_dash_gl(DrawablePtr drawable, GCPtr gc,
         int this_x = points[i].x;
         int this_y = points[i].y;
         if (i) {
-            if (mode == CoordModePrevious) {
-                this_x += prev_x;
-                this_y += prev_y;
-            }
             dash_pos += glamor_line_length(prev_x, prev_y,
                                            this_x, this_y);
         }
diff --git a/glamor/glamor_lines.c b/glamor/glamor_lines.c
index a2c9b1f..dc98841 100644
--- a/glamor/glamor_lines.c
+++ b/glamor/glamor_lines.c
@@ -34,7 +34,7 @@ static const glamor_facet glamor_facet_poly_lines = {
 
 static Bool
 glamor_poly_lines_solid_gl(DrawablePtr drawable, GCPtr gc,
-                           int mode, int n, DDXPointPtr points)
+                           int n, DDXPointPtr points)
 {
     ScreenPtr screen = drawable->pScreen;
     glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
@@ -77,18 +77,7 @@ glamor_poly_lines_solid_gl(DrawablePtr drawable, GCPtr gc,
     glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_SHORT, GL_FALSE,
                           sizeof (DDXPointRec), vbo_offset);
 
-    if (mode == CoordModePrevious) {
-        int i;
-        DDXPointRec here = { 0, 0 };
-
-        for (i = 0; i < n; i++) {
-            here.x += points[i].x;
-            here.y += points[i].y;
-            v[i] = here;
-        }
-    } else {
-        memcpy(v, points, n * sizeof (DDXPointRec));
-    }
+    memcpy(v, points, n * sizeof (DDXPointRec));
 
     if (add_last) {
         v[n].x = v[n-1].x + 1;
@@ -126,21 +115,21 @@ bail:
 
 static Bool
 glamor_poly_lines_gl(DrawablePtr drawable, GCPtr gc,
-                     int mode, int n, DDXPointPtr points)
+                     int n, DDXPointPtr points)
 {
     if (gc->lineWidth != 0)
         return FALSE;
 
     switch (gc->lineStyle) {
     case LineSolid:
-        return glamor_poly_lines_solid_gl(drawable, gc, mode, n, points);
+        return glamor_poly_lines_solid_gl(drawable, gc, n, points);
     case LineOnOffDash:
-        return glamor_poly_lines_dash_gl(drawable, gc, mode, n, points);
+        return glamor_poly_lines_dash_gl(drawable, gc, n, points);
     case LineDoubleDash:
         if (gc->fillStyle == FillTiled)
-            return glamor_poly_lines_solid_gl(drawable, gc, mode, n, points);
+            return glamor_poly_lines_solid_gl(drawable, gc, n, points);
         else
-            return glamor_poly_lines_dash_gl(drawable, gc, mode, n, points);
+            return glamor_poly_lines_dash_gl(drawable, gc, n, points);
     default:
         return FALSE;
     }
@@ -148,19 +137,19 @@ glamor_poly_lines_gl(DrawablePtr drawable, GCPtr gc,
 
 static void
 glamor_poly_lines_bail(DrawablePtr drawable, GCPtr gc,
-                       int mode, int n, DDXPointPtr points)
+                       int n, DDXPointPtr points)
 {
     glamor_fallback("to %p (%c)\n", drawable,
                     glamor_get_drawable_location(drawable));
 
-    miPolylines(drawable, gc, mode, n, points);
+    miPolylines(drawable, gc, n, points);
 }
 
 void
 glamor_poly_lines(DrawablePtr drawable, GCPtr gc,
-                  int mode, int n, DDXPointPtr points)
+                  int n, DDXPointPtr points)
 {
-    if (glamor_poly_lines_gl(drawable, gc, mode, n, points))
+    if (glamor_poly_lines_gl(drawable, gc, n, points))
         return;
-    glamor_poly_lines_bail(drawable, gc, mode, n, points);
+    glamor_poly_lines_bail(drawable, gc, n, points);
 }
diff --git a/glamor/glamor_points.c b/glamor/glamor_points.c
index facfe82..5027ade 100644
--- a/glamor/glamor_points.c
+++ b/glamor/glamor_points.c
@@ -36,7 +36,7 @@ static const glamor_facet glamor_facet_point = {
 };
 
 static Bool
-glamor_poly_point_gl(DrawablePtr drawable, GCPtr gc, int mode, int npt, DDXPointPtr ppt)
+glamor_poly_point_gl(DrawablePtr drawable, GCPtr gc, int npt, DDXPointPtr ppt)
 {
     ScreenPtr screen = drawable->pScreen;
     glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
@@ -71,17 +71,7 @@ glamor_poly_point_gl(DrawablePtr drawable, GCPtr gc, int mode, int npt, DDXPoint
     vbo_ppt = glamor_get_vbo_space(screen, npt * (2 * sizeof (INT16)), &vbo_offset);
     glEnableVertexAttribArray(GLAMOR_VERTEX_POS);
     glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_SHORT, GL_FALSE, 0, vbo_offset);
-    if (mode == CoordModePrevious) {
-        int n = npt;
-        INT16 x = 0, y = 0;
-        while (n--) {
-            vbo_ppt[0] = (x += ppt->x);
-            vbo_ppt[1] = (y += ppt->y);
-            vbo_ppt += 2;
-            ppt++;
-        }
-    } else
-        memcpy(vbo_ppt, ppt, npt * (2 * sizeof (INT16)));
+    memcpy(vbo_ppt, ppt, npt * (2 * sizeof (INT16)));
     glamor_put_vbo_space(screen);
 
     glEnable(GL_SCISSOR_TEST);
@@ -113,10 +103,10 @@ bail:
 }
 
 void
-glamor_poly_point(DrawablePtr drawable, GCPtr gc, int mode, int npt,
+glamor_poly_point(DrawablePtr drawable, GCPtr gc, int npt,
                   DDXPointPtr ppt)
 {
-    if (glamor_poly_point_gl(drawable, gc, mode, npt, ppt))
+    if (glamor_poly_point_gl(drawable, gc, npt, ppt))
         return;
-    miPolyPoint(drawable, gc, mode, npt, ppt);
+    miPolyPoint(drawable, gc, npt, ppt);
 }
diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h
index 2e491a6..5af7336 100644
--- a/glamor/glamor_priv.h
+++ b/glamor/glamor_priv.h
@@ -767,7 +767,7 @@ glamor_get_image(DrawablePtr pDrawable, int x, int y, int w, int h,
 /* glamor_dash.c */
 Bool
 glamor_poly_lines_dash_gl(DrawablePtr drawable, GCPtr gc,
-                          int mode, int n, DDXPointPtr points);
+                          int n, DDXPointPtr points);
 
 Bool
 glamor_poly_segment_dash_gl(DrawablePtr drawable, GCPtr gc,
@@ -776,7 +776,7 @@ glamor_poly_segment_dash_gl(DrawablePtr drawable, GCPtr gc,
 /* glamor_lines.c */
 void
 glamor_poly_lines(DrawablePtr drawable, GCPtr gc,
-                  int mode, int n, DDXPointPtr points);
+                  int n, DDXPointPtr points);
 
 /*  glamor_segs.c */
 void
@@ -818,7 +818,7 @@ void glamor_poly_glyph_blt(DrawablePtr pDrawable, GCPtr pGC,
 void glamor_push_pixels(GCPtr pGC, PixmapPtr pBitmap,
                         DrawablePtr pDrawable, int w, int h, int x, int y);
 
-void glamor_poly_point(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
+void glamor_poly_point(DrawablePtr pDrawable, GCPtr pGC, int npt,
                        DDXPointPtr ppt);
 
 void glamor_composite_rectangles(CARD8 op,
diff --git a/hw/dmx/dmxgcops.c b/hw/dmx/dmxgcops.c
index 0ebd69a..f699088 100644
--- a/hw/dmx/dmxgcops.c
+++ b/hw/dmx/dmxgcops.c
@@ -225,7 +225,7 @@ dmxCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
  *  partially visible. */
 void
 dmxPolyPoint(DrawablePtr pDrawable, GCPtr pGC,
-             int mode, int npt, DDXPointPtr pptInit)
+             int npt, DDXPointPtr pptInit)
 {
     DMXScreenInfo *dmxScreen = &dmxScreens[pDrawable->pScreen->myNum];
     dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
@@ -237,7 +237,7 @@ dmxPolyPoint(DrawablePtr pDrawable, GCPtr pGC,
     DMX_GCOPS_SET_DRAWABLE(pDrawable, draw);
 
     XDrawPoints(dmxScreen->beDisplay, draw, pGCPriv->gc,
-                (XPoint *) pptInit, npt, mode);
+                (XPoint *) pptInit, npt, CoordModeOrigin);
     dmxSync(dmxScreen, FALSE);
 }
 
@@ -247,7 +247,7 @@ dmxPolyPoint(DrawablePtr pDrawable, GCPtr pGC,
  *  least partially visible. */
 void
 dmxPolylines(DrawablePtr pDrawable, GCPtr pGC,
-             int mode, int npt, DDXPointPtr pptInit)
+             int npt, DDXPointPtr pptInit)
 {
     DMXScreenInfo *dmxScreen = &dmxScreens[pDrawable->pScreen->myNum];
     dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
@@ -259,7 +259,7 @@ dmxPolylines(DrawablePtr pDrawable, GCPtr pGC,
     DMX_GCOPS_SET_DRAWABLE(pDrawable, draw);
 
     XDrawLines(dmxScreen->beDisplay, draw, pGCPriv->gc,
-               (XPoint *) pptInit, npt, mode);
+               (XPoint *) pptInit, npt, CoordModeOrigin);
     dmxSync(dmxScreen, FALSE);
 }
 
@@ -333,7 +333,7 @@ dmxPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc * parcs)
  *  partially visible. */
 void
 dmxFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
-               int shape, int mode, int count, DDXPointPtr pPts)
+               int shape, int count, DDXPointPtr pPts)
 {
     DMXScreenInfo *dmxScreen = &dmxScreens[pDrawable->pScreen->myNum];
     dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
@@ -345,7 +345,7 @@ dmxFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
     DMX_GCOPS_SET_DRAWABLE(pDrawable, draw);
 
     XFillPolygon(dmxScreen->beDisplay, draw, pGCPriv->gc,
-                 (XPoint *) pPts, count, shape, mode);
+                 (XPoint *) pPts, count, shape, CoordModeOrigin);
     dmxSync(dmxScreen, FALSE);
 }
 
diff --git a/hw/dmx/dmxgcops.h b/hw/dmx/dmxgcops.h
index 529b6ff..bebe1c9 100644
--- a/hw/dmx/dmxgcops.h
+++ b/hw/dmx/dmxgcops.h
@@ -53,9 +53,9 @@ extern RegionPtr dmxCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
                               int srcx, int srcy, int width, int height,
                               int dstx, int dsty, unsigned long bitPlane);
 extern void dmxPolyPoint(DrawablePtr pDrawable, GCPtr pGC,
-                         int mode, int npt, DDXPointPtr pptInit);
+                         int npt, DDXPointPtr pptInit);
 extern void dmxPolylines(DrawablePtr pDrawable, GCPtr pGC,
-                         int mode, int npt, DDXPointPtr pptInit);
+                         int npt, DDXPointPtr pptInit);
 extern void dmxPolySegment(DrawablePtr pDrawable, GCPtr pGC,
                            int nseg, xSegment * pSegs);
 extern void dmxPolyRectangle(DrawablePtr pDrawable, GCPtr pGC,
@@ -63,7 +63,7 @@ extern void dmxPolyRectangle(DrawablePtr pDrawable, GCPtr pGC,
 extern void dmxPolyArc(DrawablePtr pDrawable, GCPtr pGC,
                        int narcs, xArc * parcs);
 extern void dmxFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
-                           int shape, int mode, int count, DDXPointPtr pPts);
+                           int shape, int count, DDXPointPtr pPts);
 extern void dmxPolyFillRect(DrawablePtr pDrawable, GCPtr pGC,
                             int nrectFill, xRectangle *prectInit);
 extern void dmxPolyFillArc(DrawablePtr pDrawable, GCPtr pGC,
diff --git a/hw/xfree86/common/xf86VGAarbiter.c b/hw/xfree86/common/xf86VGAarbiter.c
index 40f241a..7b88d08 100644
--- a/hw/xfree86/common/xf86VGAarbiter.c
+++ b/hw/xfree86/common/xf86VGAarbiter.c
@@ -697,26 +697,26 @@ VGAarbiterCopyPlane(DrawablePtr pSrc,
 
 static void
 VGAarbiterPolyPoint(DrawablePtr pDraw,
-                    GCPtr pGC, int mode, int npt, xPoint * pptInit)
+                    GCPtr pGC, int npt, xPoint * pptInit)
 {
     ScreenPtr pScreen = pGC->pScreen;
 
     GC_UNWRAP(pGC);
     VGAGet(pScreen);
-    (*pGC->ops->PolyPoint) (pDraw, pGC, mode, npt, pptInit);
+    (*pGC->ops->PolyPoint) (pDraw, pGC, npt, pptInit);
     VGAPut();
     GC_WRAP(pGC);
 }
 
 static void
 VGAarbiterPolylines(DrawablePtr pDraw,
-                    GCPtr pGC, int mode, int npt, DDXPointPtr pptInit)
+                    GCPtr pGC, int npt, DDXPointPtr pptInit)
 {
     ScreenPtr pScreen = pGC->pScreen;
 
     GC_UNWRAP(pGC);
     VGAGet(pScreen);
-    (*pGC->ops->Polylines) (pDraw, pGC, mode, npt, pptInit);
+    (*pGC->ops->Polylines) (pDraw, pGC, npt, pptInit);
     VGAPut();
     GC_WRAP(pGC);
 }
@@ -761,13 +761,13 @@ VGAarbiterPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs)
 static void
 VGAarbiterFillPolygon(DrawablePtr pDraw,
                       GCPtr pGC,
-                      int shape, int mode, int count, DDXPointPtr ptsIn)
+                      int shape, int count, DDXPointPtr ptsIn)
 {
     ScreenPtr pScreen = pGC->pScreen;
 
     GC_UNWRAP(pGC);
     VGAGet(pScreen);
-    (*pGC->ops->FillPolygon) (pDraw, pGC, shape, mode, count, ptsIn);
+    (*pGC->ops->FillPolygon) (pDraw, pGC, shape, count, ptsIn);
     VGAPut();
     GC_WRAP(pGC);
 }
diff --git a/hw/xfree86/common/xf86VGAarbiterPriv.h b/hw/xfree86/common/xf86VGAarbiterPriv.h
index 09be10a..2b43b68 100644
--- a/hw/xfree86/common/xf86VGAarbiterPriv.h
+++ b/hw/xfree86/common/xf86VGAarbiterPriv.h
@@ -212,9 +212,9 @@ static RegionPtr VGAarbiterCopyPlane(DrawablePtr pSrc, DrawablePtr pDst,
                                      GCPtr pGC, int srcx, int srcy, int width,
                                      int height, int dstx, int dsty,
                                      unsigned long bitPlane);
-static void VGAarbiterPolyPoint(DrawablePtr pDraw, GCPtr pGC, int mode, int npt,
+static void VGAarbiterPolyPoint(DrawablePtr pDraw, GCPtr pGC, int npt,
                                 xPoint * pptInit);
-static void VGAarbiterPolylines(DrawablePtr pDraw, GCPtr pGC, int mode, int npt,
+static void VGAarbiterPolylines(DrawablePtr pDraw, GCPtr pGC, int npt,
                                 DDXPointPtr pptInit);
 static void VGAarbiterPolySegment(DrawablePtr pDraw, GCPtr pGC, int nseg,
                                   xSegment * pSeg);
@@ -223,7 +223,7 @@ static void VGAarbiterPolyRectangle(DrawablePtr pDraw, GCPtr pGC,
 static void VGAarbiterPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs,
                               xArc * parcs);
 static void VGAarbiterFillPolygon(DrawablePtr pDraw, GCPtr pGC, int shape,
-                                  int mode, int count, DDXPointPtr ptsIn);
+                                  int count, DDXPointPtr ptsIn);
 static void VGAarbiterPolyFillRect(DrawablePtr pDraw, GCPtr pGC, int nrectFill,
                                    xRectangle *prectInit);
 static void VGAarbiterPolyFillArc(DrawablePtr pDraw, GCPtr pGC, int narcs,
diff --git a/hw/xnest/GCOps.c b/hw/xnest/GCOps.c
index e1cf9d6..4bdb813 100644
--- a/hw/xnest/GCOps.c
+++ b/hw/xnest/GCOps.c
@@ -200,19 +200,19 @@ xnestCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
 }
 
 void
-xnestPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int nPoints,
+xnestPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int nPoints,
                DDXPointPtr pPoints)
 {
     XDrawPoints(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
-                (XPoint *) pPoints, nPoints, mode);
+                (XPoint *) pPoints, nPoints, CoordModeOrigin);
 }
 
 void
-xnestPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int nPoints,
+xnestPolylines(DrawablePtr pDrawable, GCPtr pGC, int nPoints,
                DDXPointPtr pPoints)
 {
     XDrawLines(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
-               (XPoint *) pPoints, nPoints, mode);
+               (XPoint *) pPoints, nPoints, CoordModeOrigin);
 }
 
 void
@@ -239,11 +239,11 @@ xnestPolyArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc * pArcs)
 }
 
 void
-xnestFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape, int mode,
+xnestFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape,
                  int nPoints, DDXPointPtr pPoints)
 {
     XFillPolygon(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC),
-                 (XPoint *) pPoints, nPoints, shape, mode);
+                 (XPoint *) pPoints, nPoints, shape, CoordModeOrigin);
 }
 
 void
diff --git a/hw/xnest/GCOps.h b/hw/xnest/GCOps.h
index fd1f6bf..40a3d6f 100644
--- a/hw/xnest/GCOps.h
+++ b/hw/xnest/GCOps.h
@@ -33,16 +33,16 @@ RegionPtr xnestCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
 RegionPtr xnestCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
                          GCPtr pGC, int srcx, int srcy, int width, int height,
                          int dstx, int dsty, unsigned long plane);
-void xnestPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int nPoints,
+void xnestPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int nPoints,
                     DDXPointPtr pPoints);
-void xnestPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int nPoints,
+void xnestPolylines(DrawablePtr pDrawable, GCPtr pGC, int nPoints,
                     DDXPointPtr pPoints);
 void xnestPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nSegments,
                       xSegment * pSegments);
 void xnestPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nRectangles,
                         xRectangle *pRectangles);
 void xnestPolyArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc * pArcs);
-void xnestFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape, int mode,
+void xnestFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape,
                       int nPoints, DDXPointPtr pPoints);
 void xnestPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nRectangles,
                        xRectangle *pRectangles);
diff --git a/include/gcstruct.h b/include/gcstruct.h
index e28950f..1a590aa 100644
--- a/include/gcstruct.h
+++ b/include/gcstruct.h
@@ -140,13 +140,11 @@ typedef struct _GCOps {
                             unsigned long /*bitPlane */ );
     void (*PolyPoint) (DrawablePtr /*pDrawable */ ,
                        GCPtr /*pGC */ ,
-                       int /*mode */ ,
                        int /*npt */ ,
                        DDXPointPtr /*pptInit */ );
 
     void (*Polylines) (DrawablePtr /*pDrawable */ ,
                        GCPtr /*pGC */ ,
-                       int /*mode */ ,
                        int /*npt */ ,
                        DDXPointPtr /*pptInit */ );
 
@@ -168,7 +166,6 @@ typedef struct _GCOps {
     void (*FillPolygon) (DrawablePtr /*pDrawable */ ,
                          GCPtr /*pGC */ ,
                          int /*shape */ ,
-                         int /*mode */ ,
                          int /*count */ ,
                          DDXPointPtr /*pPts */ );
 
diff --git a/mi/mi.h b/mi/mi.h
index db62c91..da6570d 100644
--- a/mi/mi.h
+++ b/mi/mi.h
@@ -283,7 +283,6 @@ extern _X_EXPORT void miImageGlyphBlt(DrawablePtr pDrawable,
 extern _X_EXPORT void miFillPolygon(DrawablePtr /*dst */ ,
                                     GCPtr /*pgc */ ,
                                     int /*shape */ ,
-                                    int /*mode */ ,
                                     int /*count */ ,
                                     DDXPointPtr /*pPts */
     );
@@ -292,7 +291,6 @@ extern _X_EXPORT void miFillPolygon(DrawablePtr /*dst */ ,
 
 extern _X_EXPORT void miPolyPoint(DrawablePtr /*pDrawable */ ,
                                   GCPtr /*pGC */ ,
-                                  int /*mode */ ,
                                   int /*npt */ ,
                                   xPoint *      /*pptInit */
     );
@@ -408,21 +406,18 @@ extern _X_EXPORT int miValidateTree(WindowPtr /*pParent */ ,
 
 extern _X_EXPORT void miWideLine(DrawablePtr /*pDrawable */ ,
                                  GCPtr /*pGC */ ,
-                                 int /*mode */ ,
                                  int /*npt */ ,
                                  DDXPointPtr    /*pPts */
     );
 
 extern _X_EXPORT void miWideDash(DrawablePtr /*pDrawable */ ,
                                  GCPtr /*pGC */ ,
-                                 int /*mode */ ,
                                  int /*npt */ ,
                                  DDXPointPtr    /*pPts */
     );
 
 extern _X_EXPORT void miPolylines(DrawablePtr pDrawable,
                                   GCPtr pGC,
-                                  int mode,
                                   int npt,
                                   DDXPointPtr pPts);
 
@@ -494,14 +489,12 @@ extern _X_EXPORT void miZeroPolyArc(DrawablePtr /*pDraw */ ,
 
 extern _X_EXPORT void miZeroLine(DrawablePtr /*dst */ ,
                                  GCPtr /*pgc */ ,
-                                 int /*mode */ ,
                                  int /*nptInit */ ,
                                  DDXPointRec *  /*pptInit */
     );
 
 extern _X_EXPORT void miZeroDashLine(DrawablePtr /*dst */ ,
                                      GCPtr /*pgc */ ,
-                                     int /*mode */ ,
                                      int /*nptInit */ ,
                                      DDXPointRec *      /*pptInit */
     );
diff --git a/mi/mipoly.c b/mi/mipoly.c
index 12fdf01..46b6967 100644
--- a/mi/mipoly.c
+++ b/mi/mipoly.c
@@ -674,23 +674,11 @@ miFillGeneralPoly(DrawablePtr dst, GCPtr pgc, int count, DDXPointPtr ptsIn)
  */
 void
 miFillPolygon(DrawablePtr dst, GCPtr pgc,
-              int shape, int mode, int count, DDXPointPtr pPts)
+              int shape, int count, DDXPointPtr pPts)
 {
-    int i;
-    DDXPointPtr ppt;
-
     if (count == 0)
         return;
 
-    ppt = pPts;
-    if (mode == CoordModePrevious) {
-        ppt++;
-        for (i = 1; i < count; i++) {
-            ppt->x += (ppt - 1)->x;
-            ppt->y += (ppt - 1)->y;
-            ppt++;
-        }
-    }
     if (shape == Convex)
         miFillConvexPoly(dst, pgc, count, pPts);
     else
diff --git a/mi/mipolypnt.c b/mi/mipolypnt.c
index 0b3adfb..d857869 100644
--- a/mi/mipolypnt.c
+++ b/mi/mipolypnt.c
@@ -55,31 +55,16 @@ SOFTWARE.
 #include "mi.h"
 
 void
-miPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, /* Origin or Previous */
+miPolyPoint(DrawablePtr pDrawable, GCPtr pGC,
             int npt, xPoint * pptInit)
 {
-
-    int nptTmp;
     ChangeGCVal fsOld, fsNew;
     int *pwidthInit, *pwidth;
     int i;
-    xPoint *ppt;
 
     if (!(pwidthInit = xallocarray(npt, sizeof(int))))
         return;
 
-    /* make pointlist origin relative */
-    if (mode == CoordModePrevious) {
-        ppt = pptInit;
-        nptTmp = npt;
-        nptTmp--;
-        while (nptTmp--) {
-            ppt++;
-            ppt->x += (ppt - 1)->x;
-            ppt->y += (ppt - 1)->y;
-        }
-    }
-
     fsOld.val = pGC->fillStyle;
     fsNew.val = FillSolid;
     if (pGC->fillStyle != FillSolid) {
diff --git a/mi/mipolyrect.c b/mi/mipolyrect.c
index 7ebf9db..db4c6a8 100644
--- a/mi/mipolyrect.c
+++ b/mi/mipolyrect.c
@@ -103,7 +103,7 @@ miPolyRectangle(DrawablePtr pDraw, GCPtr pGC, int nrects, xRectangle *pRects)
                 rect[0].y = y;
                 rect[1].x = x;
                 rect[1].y = y;
-                (*pGC->ops->Polylines) (pDraw, pGC, CoordModeOrigin, 2, rect);
+                (*pGC->ops->Polylines) (pDraw, pGC, 2, rect);
             }
             else if (height < offset2 || width < offset1) {
                 if (height == 0) {
@@ -168,7 +168,7 @@ miPolyRectangle(DrawablePtr pDraw, GCPtr pGC, int nrects, xRectangle *pRects)
             rect[4].x = rect[0].x;
             rect[4].y = rect[0].y;
 
-            (*pGC->ops->Polylines) (pDraw, pGC, CoordModeOrigin, 5, rect);
+            (*pGC->ops->Polylines) (pDraw, pGC, 5, rect);
             pR++;
         }
     }
diff --git a/mi/mipolyseg.c b/mi/mipolyseg.c
index 7909b39..dc69135 100644
--- a/mi/mipolyseg.c
+++ b/mi/mipolyseg.c
@@ -70,7 +70,7 @@ miPolySegment(DrawablePtr pDraw, GCPtr pGC, int nseg, xSegment * pSegs)
     int i;
 
     for (i = 0; i < nseg; i++) {
-        (*pGC->ops->Polylines) (pDraw, pGC, CoordModeOrigin, 2,
+        (*pGC->ops->Polylines) (pDraw, pGC, 2,
                                 (DDXPointPtr) pSegs);
         pSegs++;
     }
diff --git a/mi/miwideline.c b/mi/miwideline.c
index 9c49eb8..7d42dbb 100644
--- a/mi/miwideline.c
+++ b/mi/miwideline.c
@@ -945,7 +945,7 @@ miLineOnePoint(DrawablePtr pDrawable,
     if (pGC->fillStyle == FillSolid) {
         pt.x = x;
         pt.y = y;
-        (*pGC->ops->PolyPoint) (pDrawable, pGC, CoordModeOrigin, 1, &pt);
+        (*pGC->ops->PolyPoint) (pDrawable, pGC, 1, &pt);
     }
     else {
         wid = 1;
@@ -1872,7 +1872,7 @@ miCleanupSpanData(DrawablePtr pDrawable, GCPtr pGC, SpanDataPtr spanData)
 
 void
 miWideLine(DrawablePtr pDrawable, GCPtr pGC,
-           int mode, int npt, DDXPointPtr pPts)
+           int npt, DDXPointPtr pPts)
 {
     int x1, y1, x2, y2;
     SpanDataRec spanDataRec;
@@ -1892,23 +1892,7 @@ miWideLine(DrawablePtr pDrawable, GCPtr pGC,
     first = TRUE;
     selfJoin = FALSE;
     if (npt > 1) {
-        if (mode == CoordModePrevious) {
-            int nptTmp;
-            DDXPointPtr pPtsTmp;
-
-            x1 = x2;
-            y1 = y2;
-            nptTmp = npt;
-            pPtsTmp = pPts + 1;
-            while (--nptTmp) {
-                x1 += pPtsTmp->x;
-                y1 += pPtsTmp->y;
-                ++pPtsTmp;
-            }
-            if (x2 == x1 && y2 == y1)
-                selfJoin = TRUE;
-        }
-        else if (x2 == pPts[npt - 1].x && y2 == pPts[npt - 1].y) {
+        if (x2 == pPts[npt - 1].x && y2 == pPts[npt - 1].y) {
             selfJoin = TRUE;
         }
     }
@@ -1920,10 +1904,6 @@ miWideLine(DrawablePtr pDrawable, GCPtr pGC,
         ++pPts;
         x2 = pPts->x;
         y2 = pPts->y;
-        if (mode == CoordModePrevious) {
-            x2 += x1;
-            y2 += y1;
-        }
         if (x1 != x2 || y1 != y2) {
             somethingDrawn = TRUE;
             if (npt == 1 && pGC->capStyle == CapProjecting && !selfJoin)
@@ -2312,7 +2292,7 @@ miWideDashSegment(DrawablePtr pDrawable,
 
 void
 miWideDash(DrawablePtr pDrawable, GCPtr pGC,
-           int mode, int npt, DDXPointPtr pPts)
+           int npt, DDXPointPtr pPts)
 {
     int x1, y1, x2, y2;
     unsigned long pixel;
@@ -2332,13 +2312,13 @@ miWideDash(DrawablePtr pDrawable, GCPtr pGC,
 #if 0
     /* XXX backward compatibility */
     if (pGC->lineWidth == 0) {
-        miZeroDashLine(pDrawable, pGC, mode, npt, pPts);
+        miZeroDashLine(pDrawable, pGC, npt, pPts);
         return;
     }
 #endif
     if (pGC->lineStyle == LineDoubleDash &&
         (pGC->fillStyle == FillOpaqueStippled || pGC->fillStyle == FillTiled)) {
-        miWideLine(pDrawable, pGC, mode, npt, pPts);
+        miWideLine(pDrawable, pGC, npt, pPts);
         return;
     }
     if (npt == 0)
@@ -2348,23 +2328,7 @@ miWideDash(DrawablePtr pDrawable, GCPtr pGC,
     y2 = pPts->y;
     first = TRUE;
     selfJoin = FALSE;
-    if (mode == CoordModePrevious) {
-        int nptTmp;
-        DDXPointPtr pPtsTmp;
-
-        x1 = x2;
-        y1 = y2;
-        nptTmp = npt;
-        pPtsTmp = pPts + 1;
-        while (--nptTmp) {
-            x1 += pPtsTmp->x;
-            y1 += pPtsTmp->y;
-            ++pPtsTmp;
-        }
-        if (x2 == x1 && y2 == y1)
-            selfJoin = TRUE;
-    }
-    else if (x2 == pPts[npt - 1].x && y2 == pPts[npt - 1].y) {
+    if (x2 == pPts[npt - 1].x && y2 == pPts[npt - 1].y) {
         selfJoin = TRUE;
     }
     projectLeft = pGC->capStyle == CapProjecting && !selfJoin;
@@ -2379,10 +2343,6 @@ miWideDash(DrawablePtr pDrawable, GCPtr pGC,
         ++pPts;
         x2 = pPts->x;
         y2 = pPts->y;
-        if (mode == CoordModePrevious) {
-            x2 += x1;
-            y2 += y1;
-        }
         if (x1 != x2 || y1 != y2) {
             somethingDrawn = TRUE;
             if (npt == 1 && pGC->capStyle == CapProjecting &&
@@ -2473,19 +2433,18 @@ miWideDash(DrawablePtr pDrawable, GCPtr pGC,
 void
 miPolylines(DrawablePtr drawable,
             GCPtr gc,
-            int mode,
             int n,
             DDXPointPtr points)
 {
     if (gc->lineWidth == 0) {
         if (gc->lineStyle == LineSolid)
-            miZeroLine(drawable, gc, mode, n, points);
+            miZeroLine(drawable, gc, n, points);
         else
-            miZeroDashLine(drawable, gc, mode, n, points);
+            miZeroDashLine(drawable, gc, n, points);
     } else {
         if (gc->lineStyle == LineSolid)
-            miWideLine(drawable, gc, mode, n, points);
+            miWideLine(drawable, gc, n, points);
         else
-            miWideDash(drawable, gc, mode, n, points);
+            miWideDash(drawable, gc, n, points);
     }
 }
diff --git a/mi/mizerarc.c b/mi/mizerarc.c
index 85e12f0..9f6ea97 100644
--- a/mi/mizerarc.c
+++ b/mi/mizerarc.c
@@ -707,7 +707,7 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs)
             }
             n = pts - points;
             if (!dospans)
-                (*pGC->ops->PolyPoint) (pDraw, pGC, CoordModeOrigin, n, points);
+                (*pGC->ops->PolyPoint) (pDraw, pGC, n, points);
             else {
                 if (n > maxw) {
                     while (maxw < n)
@@ -729,7 +729,7 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs)
             oddPts++;
             n = pts - oddPts;
             if (!dospans)
-                (*pGC->ops->PolyPoint) (pDraw, pGC, CoordModeOrigin, n, oddPts);
+                (*pGC->ops->PolyPoint) (pDraw, pGC, n, oddPts);
             else {
                 if (n > maxw) {
                     while (maxw < n)
diff --git a/mi/mizerline.c b/mi/mizerline.c
index e36e080..3deb059 100644
--- a/mi/mizerline.c
+++ b/mi/mizerline.c
@@ -97,7 +97,7 @@ SOFTWARE.
 }
 
 void
-miZeroLine(DrawablePtr pDraw, GCPtr pGC, int mode,      /* Origin or Previous */
+miZeroLine(DrawablePtr pDraw, GCPtr pGC,
            int npt,             /* number of points */
            DDXPointPtr pptInit)
 {
@@ -174,10 +174,6 @@ miZeroLine(DrawablePtr pDraw, GCPtr pGC, int mode,      /* Origin or Previous */
 
         x2 = ppt->x;
         y2 = ppt->y;
-        if (mode == CoordModePrevious) {
-            x2 += x1;
-            y2 += y1;
-        }
 
         oc2 = 0;
         MIOUTCODES(oc2, x2, y2, xleft, ytop, xright, ybottom);
@@ -331,12 +327,12 @@ miZeroLine(DrawablePtr pDraw, GCPtr pGC, int mode,      /* Origin or Previous */
 }
 
 void
-miZeroDashLine(DrawablePtr dst, GCPtr pgc, int mode, int nptInit,       /* number of points in polyline */
+miZeroDashLine(DrawablePtr dst, GCPtr pgc, int nptInit,       /* number of points in polyline */
                DDXPointRec * pptInit    /* points in the polyline */
     )
 {
     /* XXX kludge until real zero-width dash code is written */
     pgc->lineWidth = 1;
-    miWideDash(dst, pgc, mode, nptInit, pptInit);
+    miWideDash(dst, pgc, nptInit, pptInit);
     pgc->lineWidth = 0;
 }
diff --git a/miext/damage/damage.c b/miext/damage/damage.c
index c9ddeea..2f26f06 100644
--- a/miext/damage/damage.c
+++ b/miext/damage/damage.c
@@ -802,7 +802,7 @@ damageCopyPlane(DrawablePtr pSrc,
 
 static void
 damagePolyPoint(DrawablePtr pDrawable,
-                GCPtr pGC, int mode, int npt, xPoint * ppt)
+                GCPtr pGC, int npt, xPoint * ppt)
 {
     DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
 
@@ -835,14 +835,14 @@ damagePolyPoint(DrawablePtr pDrawable,
         if (BOX_NOT_EMPTY(box))
             damageDamageBox(pDrawable, &box, pGC->subWindowMode);
     }
-    (*pGC->ops->PolyPoint) (pDrawable, pGC, mode, npt, ppt);
+    (*pGC->ops->PolyPoint) (pDrawable, pGC, npt, ppt);
     damageRegionProcessPending(pDamage);
     DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
 }
 
 static void
 damagePolylines(DrawablePtr pDrawable,
-                GCPtr pGC, int mode, int npt, DDXPointPtr ppt)
+                GCPtr pGC, int npt, DDXPointPtr ppt)
 {
     DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
 
@@ -862,36 +862,16 @@ damagePolylines(DrawablePtr pDrawable,
                 extra = pGC->lineWidth;
         }
 
-        if (mode == CoordModePrevious) {
-            int x = box.x1;
-            int y = box.y1;
-
-            while (--nptTmp) {
-                pptTmp++;
-                x += pptTmp->x;
-                y += pptTmp->y;
-                if (box.x1 > x)
-                    box.x1 = x;
-                else if (box.x2 < x)
-                    box.x2 = x;
-                if (box.y1 > y)
-                    box.y1 = y;
-                else if (box.y2 < y)
-                    box.y2 = y;
-            }
-        }
-        else {
-            while (--nptTmp) {
-                pptTmp++;
-                if (box.x1 > pptTmp->x)
-                    box.x1 = pptTmp->x;
-                else if (box.x2 < pptTmp->x)
-                    box.x2 = pptTmp->x;
-                if (box.y1 > pptTmp->y)
-                    box.y1 = pptTmp->y;
-                else if (box.y2 < pptTmp->y)
-                    box.y2 = pptTmp->y;
-            }
+        while (--nptTmp) {
+            pptTmp++;
+            if (box.x1 > pptTmp->x)
+                box.x1 = pptTmp->x;
+            else if (box.x2 < pptTmp->x)
+                box.x2 = pptTmp->x;
+            if (box.y1 > pptTmp->y)
+                box.y1 = pptTmp->y;
+            else if (box.y2 < pptTmp->y)
+                box.y2 = pptTmp->y;
         }
 
         box.x2++;
@@ -908,7 +888,7 @@ damagePolylines(DrawablePtr pDrawable,
         if (BOX_NOT_EMPTY(box))
             damageDamageBox(pDrawable, &box, pGC->subWindowMode);
     }
-    (*pGC->ops->Polylines) (pDrawable, pGC, mode, npt, ppt);
+    (*pGC->ops->Polylines) (pDrawable, pGC, npt, ppt);
     damageRegionProcessPending(pDamage);
     DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
 }
@@ -1100,7 +1080,7 @@ damagePolyArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc * pArcs)
 
 static void
 damageFillPolygon(DrawablePtr pDrawable,
-                  GCPtr pGC, int shape, int mode, int npt, DDXPointPtr ppt)
+                  GCPtr pGC, int shape, int npt, DDXPointPtr ppt)
 {
     DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
 
@@ -1112,36 +1092,16 @@ damageFillPolygon(DrawablePtr pDrawable,
         box.x2 = box.x1 = pptTmp->x;
         box.y2 = box.y1 = pptTmp->y;
 
-        if (mode != CoordModeOrigin) {
-            int x = box.x1;
-            int y = box.y1;
-
-            while (--nptTmp) {
-                pptTmp++;
-                x += pptTmp->x;
-                y += pptTmp->y;
-                if (box.x1 > x)
-                    box.x1 = x;
-                else if (box.x2 < x)
-                    box.x2 = x;
-                if (box.y1 > y)
-                    box.y1 = y;
-                else if (box.y2 < y)
-                    box.y2 = y;
-            }
-        }
-        else {
-            while (--nptTmp) {
-                pptTmp++;
-                if (box.x1 > pptTmp->x)
-                    box.x1 = pptTmp->x;
-                else if (box.x2 < pptTmp->x)
-                    box.x2 = pptTmp->x;
-                if (box.y1 > pptTmp->y)
-                    box.y1 = pptTmp->y;
-                else if (box.y2 < pptTmp->y)
-                    box.y2 = pptTmp->y;
-            }
+        while (--nptTmp) {
+            pptTmp++;
+            if (box.x1 > pptTmp->x)
+                box.x1 = pptTmp->x;
+            else if (box.x2 < pptTmp->x)
+                box.x2 = pptTmp->x;
+            if (box.y1 > pptTmp->y)
+                box.y1 = pptTmp->y;
+            else if (box.y2 < pptTmp->y)
+                box.y2 = pptTmp->y;
         }
 
         box.x2++;
@@ -1152,7 +1112,7 @@ damageFillPolygon(DrawablePtr pDrawable,
             damageDamageBox(pDrawable, &box, pGC->subWindowMode);
     }
 
-    (*pGC->ops->FillPolygon) (pDrawable, pGC, shape, mode, npt, ppt);
+    (*pGC->ops->FillPolygon) (pDrawable, pGC, shape, npt, ppt);
     damageRegionProcessPending(pDamage);
     DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
 }
diff --git a/miext/rootless/rootlessGC.c b/miext/rootless/rootlessGC.c
index 235b3ab..94cb1b7 100644
--- a/miext/rootless/rootlessGC.c
+++ b/miext/rootless/rootlessGC.c
@@ -88,16 +88,16 @@ static RegionPtr RootlessCopyPlane(DrawablePtr pSrc, DrawablePtr dst,
                                    int w, int h, int dstx, int dsty,
                                    unsigned long plane);
 static void RootlessPolyPoint(DrawablePtr dst, GCPtr pGC,
-                              int mode, int npt, DDXPointPtr pptInit);
+                              int npt, DDXPointPtr pptInit);
 static void RootlessPolylines(DrawablePtr dst, GCPtr pGC,
-                              int mode, int npt, DDXPointPtr pptInit);
+                              int npt, DDXPointPtr pptInit);
 static void RootlessPolySegment(DrawablePtr dst, GCPtr pGC,
                                 int nseg, xSegment * pSeg);
 static void RootlessPolyRectangle(DrawablePtr dst, GCPtr pGC,
                                   int nRects, xRectangle *pRects);
 static void RootlessPolyArc(DrawablePtr dst, GCPtr pGC, int narcs,
                             xArc * parcs);
-static void RootlessFillPolygon(DrawablePtr dst, GCPtr pGC, int shape, int mode,
+static void RootlessFillPolygon(DrawablePtr dst, GCPtr pGC, int shape,
                                 int count, DDXPointPtr pptInit);
 static void RootlessPolyFillRect(DrawablePtr dst, GCPtr pGC, int nRectsInit,
                                  xRectangle *pRectsInit);
@@ -624,13 +624,13 @@ RootlessCopyPlane(DrawablePtr pSrc, DrawablePtr dst,
 /* changed area is box around all points */
 static void
 RootlessPolyPoint(DrawablePtr dst, GCPtr pGC,
-                  int mode, int npt, DDXPointPtr pptInit)
+                  int npt, DDXPointPtr pptInit)
 {
     GCOP_UNWRAP(pGC);
     RL_DEBUG_MSG("polypoint start ");
 
     RootlessStartDrawing((WindowPtr) dst);
-    pGC->ops->PolyPoint(dst, pGC, mode, npt, pptInit);
+    pGC->ops->PolyPoint(dst, pGC, npt, pptInit);
 
     if (npt > 0) {
 #if ROOTLESS_CHANGED_AREA==0
@@ -722,13 +722,13 @@ RootlessPolyPoint(DrawablePtr dst, GCPtr pGC,
 /* changed area is box around each line */
 static void
 RootlessPolylines(DrawablePtr dst, GCPtr pGC,
-                  int mode, int npt, DDXPointPtr pptInit)
+                  int npt, DDXPointPtr pptInit)
 {
     GCOP_UNWRAP(pGC);
     RL_DEBUG_MSG("poly lines start ");
 
     RootlessStartDrawing((WindowPtr) dst);
-    pGC->ops->Polylines(dst, pGC, mode, npt, pptInit);
+    pGC->ops->Polylines(dst, pGC, npt, pptInit);
 
     if (npt > 0) {
         BoxRec box;
@@ -744,36 +744,16 @@ RootlessPolylines(DrawablePtr dst, GCPtr pGC,
                 extra = pGC->lineWidth;
         }
 
-        if (mode == CoordModePrevious) {
-            int x = box.x1;
-            int y = box.y1;
-
-            while (--npt) {
-                pptInit++;
-                x += pptInit->x;
-                y += pptInit->y;
-                if (box.x1 > x)
-                    box.x1 = x;
-                else if (box.x2 < x)
-                    box.x2 = x;
-                if (box.y1 > y)
-                    box.y1 = y;
-                else if (box.y2 < y)
-                    box.y2 = y;
-            }
-        }
-        else {
-            while (--npt) {
-                pptInit++;
-                if (box.x1 > pptInit->x)
-                    box.x1 = pptInit->x;
-                else if (box.x2 < pptInit->x)
-                    box.x2 = pptInit->x;
-                if (box.y1 > pptInit->y)
-                    box.y1 = pptInit->y;
-                else if (box.y2 < pptInit->y)
-                    box.y2 = pptInit->y;
-            }
+        while (--npt) {
+            pptInit++;
+            if (box.x1 > pptInit->x)
+                box.x1 = pptInit->x;
+            else if (box.x2 < pptInit->x)
+                box.x2 = pptInit->x;
+            if (box.y1 > pptInit->y)
+                box.y1 = pptInit->y;
+            else if (box.y2 < pptInit->y)
+                box.y2 = pptInit->y;
         }
 
         box.x2++;
@@ -994,7 +974,7 @@ RootlessPolyArc(DrawablePtr dst, GCPtr pGC, int narcs, xArc * parcs)
 /* changed area is box around each poly */
 static void
 RootlessFillPolygon(DrawablePtr dst, GCPtr pGC,
-                    int shape, int mode, int count, DDXPointPtr pptInit)
+                    int shape, int count, DDXPointPtr pptInit)
 {
     GC_SAVE(pGC);
     GCOP_UNWRAP(pGC);
@@ -1002,7 +982,7 @@ RootlessFillPolygon(DrawablePtr dst, GCPtr pGC,
                  pGC->fillStyle);
 
     if (count <= 2) {
-        pGC->ops->FillPolygon(dst, pGC, shape, mode, count, pptInit);
+        pGC->ops->FillPolygon(dst, pGC, shape, count, pptInit);
     }
     else {
         DDXPointPtr ppt = pptInit;
@@ -1012,36 +992,16 @@ RootlessFillPolygon(DrawablePtr dst, GCPtr pGC,
         box.x2 = box.x1 = ppt->x;
         box.y2 = box.y1 = ppt->y;
 
-        if (mode != CoordModeOrigin) {
-            int x = box.x1;
-            int y = box.y1;
-
-            while (--i) {
-                ppt++;
-                x += ppt->x;
-                y += ppt->y;
-                if (box.x1 > x)
-                    box.x1 = x;
-                else if (box.x2 < x)
-                    box.x2 = x;
-                if (box.y1 > y)
-                    box.y1 = y;
-                else if (box.y2 < y)
-                    box.y2 = y;
-            }
-        }
-        else {
-            while (--i) {
-                ppt++;
-                if (box.x1 > ppt->x)
-                    box.x1 = ppt->x;
-                else if (box.x2 < ppt->x)
-                    box.x2 = ppt->x;
-                if (box.y1 > ppt->y)
-                    box.y1 = ppt->y;
-                else if (box.y2 < ppt->y)
-                    box.y2 = ppt->y;
-            }
+        while (--i) {
+            ppt++;
+            if (box.x1 > ppt->x)
+                box.x1 = ppt->x;
+            else if (box.x2 < ppt->x)
+                box.x2 = ppt->x;
+            if (box.y1 > ppt->y)
+                box.y1 = ppt->y;
+            else if (box.y2 < ppt->y)
+                box.y2 = ppt->y;
         }
 
         box.x2++;
@@ -1053,7 +1013,7 @@ RootlessFillPolygon(DrawablePtr dst, GCPtr pGC,
             GC_UNSET_PM(pGC, dst);
         }
 
-        pGC->ops->FillPolygon(dst, pGC, shape, mode, count, pptInit);
+        pGC->ops->FillPolygon(dst, pGC, shape, count, pptInit);
 
         TRIM_AND_TRANSLATE_BOX(box, dst, pGC);
         if (BOX_NOT_EMPTY(box))
-- 
2.9.3



More information about the xorg-devel mailing list