[PATCH resend 1/3] Quit wrapping ChangeClip, CopyClip, and DestroyClip in GCFuncs.

Jamey Sharp jamey at minilop.net
Mon Sep 26 22:53:12 PDT 2011


Use the mi implementation of these functions instead, moving them to
dix/gc.c.

Signed-off-by: Jamey Sharp <jamey at minilop.net>
---
 Xext/panoramiX.c                       |   32 ------
 dix/gc.c                               |   87 +++++++++++++--
 doc/Xserver-spec.xml                   |   74 +-------------
 exa/exa.c                              |   48 --------
 fb/fbgc.c                              |    3 -
 hw/dmx/dmxgc.c                         |  123 ++++++++-------------
 hw/dmx/dmxgc.h                         |    3 -
 hw/xfree86/common/xf86VGAarbiter.c     |   31 +-----
 hw/xfree86/common/xf86VGAarbiterPriv.h |    4 -
 hw/xfree86/shadowfb/shadow.c           |   35 ------
 hw/xfree86/xaa/xaaGC.c                 |   31 ------
 hw/xnest/GC.c                          |  186 +++++++-------------------------
 hw/xnest/XNGC.h                        |    4 -
 hw/xwin/wingc.c                        |   42 -------
 include/gcstruct.h                     |   20 ++---
 mi/mibitblt.c                          |    4 +-
 mi/migc.c                              |   70 ------------
 mi/migc.h                              |   16 ---
 miext/cw/cw.c                          |   52 +---------
 miext/damage/damage.c                  |   31 ------
 miext/rootless/rootlessGC.c            |   29 -----
 render/mirect.c                        |    2 +-
 xfixes/region.c                        |    2 +-
 23 files changed, 177 insertions(+), 752 deletions(-)

diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index fae7c81..668831f 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -129,13 +129,9 @@ static void XineramaValidateGC(GCPtr, unsigned long, DrawablePtr);
 static void XineramaChangeGC(GCPtr, unsigned long);
 static void XineramaCopyGC(GCPtr, unsigned long, GCPtr);
 static void XineramaDestroyGC(GCPtr);
-static void XineramaChangeClip(GCPtr, int, pointer, int);
-static void XineramaDestroyClip(GCPtr);
-static void XineramaCopyClip(GCPtr, GCPtr);
 
 static GCFuncs XineramaGCFuncs = {
     XineramaValidateGC, XineramaChangeGC, XineramaCopyGC, XineramaDestroyGC,
-    XineramaChangeClip, XineramaDestroyClip, XineramaCopyClip
 };
 
 #define Xinerama_GC_FUNC_PROLOGUE(pGC)\
@@ -299,34 +295,6 @@ XineramaCopyGC (
     Xinerama_GC_FUNC_EPILOGUE (pGCDst);
 }
 
-static void
-XineramaChangeClip (
-    GCPtr   pGC,
-    int		type,
-    pointer	pvalue,
-    int		nrects 
-){
-    Xinerama_GC_FUNC_PROLOGUE (pGC);
-    (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
-    Xinerama_GC_FUNC_EPILOGUE (pGC);
-}
-
-static void
-XineramaCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
-{
-    Xinerama_GC_FUNC_PROLOGUE (pgcDst);
-    (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
-    Xinerama_GC_FUNC_EPILOGUE (pgcDst);
-}
-
-static void
-XineramaDestroyClip(GCPtr pGC)
-{
-    Xinerama_GC_FUNC_PROLOGUE (pGC);
-    (* pGC->funcs->DestroyClip)(pGC);
-    Xinerama_GC_FUNC_EPILOGUE (pGC);
-}
-
 int
 XineramaDeleteResource(pointer data, XID id)
 {
diff --git a/dix/gc.c b/dix/gc.c
index fc251dd..e7568fc 100644
--- a/dix/gc.c
+++ b/dix/gc.c
@@ -70,6 +70,8 @@ SOFTWARE.
 extern FontPtr defaultFont;
 
 static Bool CreateDefaultTile(GCPtr pGC);
+static void DestroyClip(GCPtr pGC);
+static void CopyClip(GCPtr pgcDst, GCPtr pgcSrc);
 
 static unsigned char DefaultDash[2] = {4, 4};
 
@@ -338,8 +340,7 @@ ChangeGC(ClientPtr client, GC *pGC, BITS32 mask, ChangeGCValPtr pUnion)
 		    }
 		    pPixmap->refcnt++;
 		}
-		(*pGC->funcs->ChangeClip)(pGC, pPixmap ? CT_PIXMAP : CT_NONE,
-					  (pointer)pPixmap, 0);
+		ChangeClip(pGC, pPixmap ? CT_PIXMAP : CT_NONE, pPixmap, 0);
 		break;
 	    case GCDashOffset:
 		NEXTVAL(INT16, pGC->dashOffset);
@@ -708,7 +709,7 @@ CopyGC(GC *pgcSrc, GC *pgcDst, BITS32 mask)
 		pgcDst->clipOrg.y = pgcSrc->clipOrg.y;
 		break;
 	    case GCClipMask:
-		(* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
+		CopyClip(pgcDst, pgcSrc);
 		break;
 	    case GCDashOffset:
 		pgcDst->dashOffset = pgcSrc->dashOffset;
@@ -772,7 +773,7 @@ FreeGC(pointer value, XID gid)
     GCPtr pGC = (GCPtr)value;
 
     CloseFont(pGC->font, (Font)0);
-    (* pGC->funcs->DestroyClip)(pGC);
+    DestroyClip(pGC);
 
     if (!pGC->tileIsPixel)
 	(* pGC->pScreen->DestroyPixmap)(pGC->tile.pixmap);
@@ -1077,12 +1078,81 @@ SetClipRects(GCPtr pGC, int xOrigin, int yOrigin, int nrects,
 
     if (size)
 	memmove((char *)prectsNew, (char *)prects, size);
-    (*pGC->funcs->ChangeClip)(pGC, newct, (pointer)prectsNew, nrects);
+    ChangeClip(pGC, newct, prectsNew, nrects);
     if (pGC->funcs->ChangeGC)
 	(*pGC->funcs->ChangeGC) (pGC, GCClipXOrigin|GCClipYOrigin|GCClipMask);
     return Success;
 }
 
+static void
+DestroyClip(GCPtr pGC)
+{
+    if (pGC->clientClipType == CT_NONE)
+	return;
+    else if (pGC->clientClipType == CT_PIXMAP)
+    {
+	(*pGC->pScreen->DestroyPixmap) ((PixmapPtr) (pGC->clientClip));
+    }
+    else
+    {
+	/*
+	 * we know we'll never have a list of rectangles, since ChangeClip
+	 * immediately turns them into a region
+	 */
+	RegionDestroy(pGC->clientClip);
+    }
+    pGC->clientClip = NULL;
+    pGC->clientClipType = CT_NONE;
+}
+
+void
+ChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects)
+{
+    DestroyClip(pGC);
+    if (type == CT_PIXMAP)
+    {
+	/* convert the pixmap to a region */
+	pGC->clientClip = (pointer) BitmapToRegion(pGC->pScreen,
+							(PixmapPtr) pvalue);
+	(*pGC->pScreen->DestroyPixmap) (pvalue);
+    }
+    else if (type == CT_REGION)
+    {
+	/* stuff the region in the GC */
+	pGC->clientClip = pvalue;
+    }
+    else if (type != CT_NONE)
+    {
+	pGC->clientClip = (pointer) RegionFromRects(nrects,
+						      (xRectangle *) pvalue,
+								    type);
+	free(pvalue);
+    }
+    pGC->clientClipType = (type != CT_NONE && pGC->clientClip) ? CT_REGION : CT_NONE;
+    pGC->stateChanges |= GCClipMask;
+}
+
+static void
+CopyClip(GCPtr pgcDst, GCPtr pgcSrc)
+{
+    RegionPtr prgnNew;
+
+    switch (pgcSrc->clientClipType)
+    {
+	case CT_PIXMAP:
+	    ((PixmapPtr) pgcSrc->clientClip)->refcnt++;
+	    /* Fall through !! */
+	case CT_NONE:
+	    ChangeClip(pgcDst, (int) pgcSrc->clientClipType,
+		    pgcSrc->clientClip, 0);
+	    break;
+	case CT_REGION:
+	    prgnNew = RegionCreate(NULL, 1);
+	    RegionCopy(prgnNew, (RegionPtr) (pgcSrc->clientClip));
+	    ChangeClip(pgcDst, CT_REGION, prgnNew, 0);
+	    break;
+    }
+}
 
 /*
    sets reasonable defaults 
@@ -1121,8 +1191,6 @@ GetScratchGC(unsigned depth, ScreenPtr pScreen)
 	    pGC->graphicsExposures = FALSE;
 	    pGC->clipOrg.x = 0;
 	    pGC->clipOrg.y = 0;
-	    if (pGC->clientClipType != CT_NONE)
-		(*pGC->funcs->ChangeClip) (pGC, CT_NONE, NULL, 0);
 	    pGC->stateChanges = GCAllBits;
 	    return pGC;
 	}
@@ -1142,8 +1210,9 @@ mark it as available.
 void
 FreeScratchGC(GCPtr pGC)
 {
-    if (pGC->scratch_inuse)
+    if (pGC->scratch_inuse) {
+	DestroyClip(pGC);
 	pGC->scratch_inuse = FALSE;
-    else
+    } else
 	FreeGC(pGC, (GContext)0);
 }
diff --git a/doc/Xserver-spec.xml b/doc/Xserver-spec.xml
index b14e489..22406ad 100644
--- a/doc/Xserver-spec.xml
+++ b/doc/Xserver-spec.xml
@@ -3799,7 +3799,7 @@ functions will be called before the GC has been validated,
 but the others (dealing with allocating of clip regions,
 changing and destroying the GC, etc.) might be.</para>
 <para>
-The GC funcs vector contains pointers to 7
+The GC funcs vector contains pointers to 4
 routines and a devPrivate field:
 <blockquote><programlisting>
 
@@ -3870,78 +3870,6 @@ This routine is called before the GC is destroyed for the
 entity interested in this GC to clean up after itself.
 This routine is responsible for freeing any auxiliary storage allocated.</para>
 </section>
-<section>
-  <title>GC Clip Region Routines</title>
-<para>
-The GC clientClip field requires three procedures to manage it.  These
-procedures are in the GC funcs vector.  The underlying principle is that dix
-knows nothing about the internals of the clipping information, (except when
-it has come from the client), and so calls ddX whenever it needs to copy,
-set, or destroy such information.  It could have been possible for dix not
-to allow ddX to touch the field in the GC, and require it to keep its own
-copy in devPriv, but since clip masks can be very large, this seems like a
-bad idea.  Thus, the server allows ddX to do whatever it wants to the
-clientClip field of the GC, but requires it to do all manipulation itself.</para>
-<para>
-<blockquote><programlisting>
-
-	void pGC->funcs->ChangeClip(pGC, type, pValue, nrects)
-		GCPtr pGC;
-		int type;
-		char *pValue;
-		int nrects;
-
-</programlisting></blockquote>
-This routine is called whenever the client changes the client clip
-region.  The pGC points to the GC involved, the type tells what form
-the region has been sent in.  If type is CT_NONE, then there is no
-client clip.  If type is CT_UNSORTED, CT_YBANDED or CT_YXBANDED, then
-pValue pointer to a list of rectangles, nrects long.  If type is
-CT_REGION, then pValue pointer to a RegionRec from the mi region code.
-If type is CT_PIXMAP pValue is a pointer to a pixmap.  (The defines
-for CT_NONE, etc. are in Xserver/include/gc.h.)  This routine is
-responsible for incrementing any necessary reference counts (e.g. for
-a pixmap clip mask) for the new clipmask and freeing anything that
-used to be in the GC's clipMask field.  The lists of rectangles passed
-in can be freed with Xfree(), the regions can be destroyed with the
-RegionDestroy field in the screen, and pixmaps can be destroyed by
-calling the screen's DestroyPixmap function.  DIX and MI code expect
-what they pass in to this to be freed or otherwise inaccessible, and
-will never look inside what's been put in the GC.  This is a good
-place to be wary of storage leaks.</para>
-<para>
-In the sample server, this routine transforms either the bitmap or the
-rectangle list into a region, so that future routines will have a more
-predictable starting point to work from.  (The validate routine must
-take this client clip region and merge it with other regions to arrive
-at a composite clip region before any drawing is done.)</para>
-<para>
-<blockquote><programlisting>
-
-	void pGC->funcs->DestroyClip(pGC)
-		GCPtr pGC;
-
-</programlisting></blockquote>
-This routine is called whenever the client clip region must be destroyed.
-The pGC points to the GC involved.  This call should set the clipType
-field of the GC to CT_NONE.
-In the sample server, the pointer to the client clip region is set to NULL
-by this routine after destroying the region, so that other software
-(including ChangeClip() above) will recognize that there is no client clip region.</para>
-<para>
-<blockquote><programlisting>
-
-	void pGC->funcs->CopyClip(pgcDst, pgcSrc)
-		GCPtr pgcDst, pgcSrc;
-
-</programlisting></blockquote>
-This routine makes a copy of the clipMask and clipType from pgcSrc
-into pgcDst.  It is responsible for destroying any previous clipMask
-in pgcDst.  The clip mask in the source can be the same as the
-clip mask in the dst (clients do the strangest things), so care must
-be taken when destroying things.  This call is required because dix
-does not know how to copy the clip mask from pgcSrc.</para>
-</section>
 </section>
 <section>
   <title>Drawing Primitives</title>
diff --git a/exa/exa.c b/exa/exa.c
index 4ce983b..17cded0 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -480,29 +480,11 @@ exaCopyGC (GCPtr pGCSrc,
 	      unsigned long mask,
 	      GCPtr	 pGCDst);
 
-static void
-exaChangeClip (GCPtr pGC,
-		int type,
-		pointer pvalue,
-		int nrects);
-
-static void
-exaCopyClip(GCPtr pGCDst, GCPtr pGCSrc);
-
-static void
-exaCopyClip(GCPtr pGCDst, GCPtr pGCSrc);
-
-static void
-exaDestroyClip(GCPtr pGC);
-
 const GCFuncs exaGCFuncs = {
     exaValidateGC,
     exaChangeGC,
     exaCopyGC,
     exaDestroyGC,
-    exaChangeClip,
-    exaDestroyClip,
-    exaCopyClip
 };
 
 static void
@@ -590,36 +572,6 @@ exaCopyGC (GCPtr pGCSrc,
     swap(pExaGC, pGCDst, funcs);
 }
 
-static void
-exaChangeClip (GCPtr pGC,
-		int type,
-		pointer pvalue,
-		int nrects)
-{
-    ExaGCPriv(pGC);
-    swap(pExaGC, pGC, funcs);
-    (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
-    swap(pExaGC, pGC, funcs);
-}
-
-static void
-exaCopyClip(GCPtr pGCDst, GCPtr pGCSrc)
-{
-    ExaGCPriv(pGCDst);
-    swap(pExaGC, pGCDst, funcs);
-    (*pGCDst->funcs->CopyClip)(pGCDst, pGCSrc);
-    swap(pExaGC, pGCDst, funcs);
-}
-
-static void
-exaDestroyClip(GCPtr pGC)
-{
-    ExaGCPriv(pGC);
-    swap(pExaGC, pGC, funcs);
-    (*pGC->funcs->DestroyClip)(pGC);
-    swap(pExaGC, pGC, funcs);
-}
-
 /**
  * exaCreateGC makes a new GC and hooks up its funcs handler, so that
  * exaValidateGC() will get called.
diff --git a/fb/fbgc.c b/fb/fbgc.c
index 8108c3a..aa75d7a 100644
--- a/fb/fbgc.c
+++ b/fb/fbgc.c
@@ -33,9 +33,6 @@ const GCFuncs fbGCFuncs = {
     miChangeGC,
     miCopyGC,
     miDestroyGC,
-    miChangeClip,
-    miDestroyClip,
-    miCopyClip,
 };
 
 const GCOps	fbGCOps = {
diff --git a/hw/dmx/dmxgc.c b/hw/dmx/dmxgc.c
index f10f9a0..b1347c1 100644
--- a/hw/dmx/dmxgc.c
+++ b/hw/dmx/dmxgc.c
@@ -54,9 +54,6 @@ static GCFuncs dmxGCFuncs = {
     dmxChangeGC,
     dmxCopyGC,
     dmxDestroyGC,
-    dmxChangeClip,
-    dmxDestroyClip,
-    dmxCopyClip,
 };
 
 static GCOps dmxGCOps = {
@@ -185,6 +182,46 @@ void dmxValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
     DMX_GC_FUNC_EPILOGUE(pGC);
 }
 
+/** Change the clip rects for a GC. */
+static void dmxBEChangeClip(GCPtr pGC)
+{
+    ScreenPtr      pScreen = pGC->pScreen;
+    DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+    dmxGCPrivPtr   pGCPriv = DMX_GET_GC_PRIV(pGC);
+    XRectangle    *pRects;
+    BoxPtr         pBox;
+    int            i, nRects;
+
+    /* Set the client clip on the back-end server */
+    switch (pGC->clientClipType) {
+    case CT_NONE:
+	if (dmxScreen->beDisplay)
+	    XSetClipMask(dmxScreen->beDisplay, pGCPriv->gc, None);
+	break;
+
+    case CT_REGION:
+	if (dmxScreen->beDisplay) {
+	    nRects = RegionNumRects((RegionPtr)pGC->clientClip);
+	    pRects = malloc(nRects * sizeof(*pRects));
+	    pBox   = RegionRects((RegionPtr)pGC->clientClip);
+
+	    for (i = 0; i < nRects; i++) {
+		pRects[i].x      = pBox[i].x1;
+		pRects[i].y      = pBox[i].y1;
+		pRects[i].width  = pBox[i].x2 - pBox[i].x1;
+		pRects[i].height = pBox[i].y2 - pBox[i].y1;
+	    }
+
+	    XSetClipRectangles(dmxScreen->beDisplay, pGCPriv->gc,
+			       pGC->clipOrg.x, pGC->clipOrg.y,
+			       pRects, nRects, Unsorted);
+
+	    free(pRects);
+	}
+	break;
+    }
+}
+
 /** Set the values in the graphics context on the back-end server
  *  associated with \a pGC's screen. */
 void dmxChangeGC(GCPtr pGC, unsigned long mask)
@@ -270,7 +307,11 @@ void dmxChangeGC(GCPtr pGC, unsigned long mask)
 
     if (mask & GCClipXOrigin)       v.clip_x_origin = pGC->clipOrg.x;
     if (mask & GCClipYOrigin)       v.clip_y_origin = pGC->clipOrg.y;
-    if (mask & GCClipMask)          mask &= ~GCClipMask; /* See ChangeClip */
+    if (mask & GCClipMask) {
+	mask &= ~GCClipMask;
+	if (dmxScreen->beDisplay)
+	    dmxBEChangeClip(pGC);
+    }
     if (mask & GCDashOffset)        v.dash_offset = pGC->dashOffset;
     if (mask & GCDashList) {
 	mask &= ~GCDashList;
@@ -340,77 +381,3 @@ void dmxDestroyGC(GCPtr pGC)
     pGC->funcs->DestroyGC(pGC);
     DMX_GC_FUNC_EPILOGUE(pGC);
 }
-
-/** Change the clip rects for a GC. */
-void dmxChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects)
-{
-    ScreenPtr      pScreen = pGC->pScreen;
-    DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
-    dmxGCPrivPtr   pGCPriv = DMX_GET_GC_PRIV(pGC);
-    XRectangle    *pRects;
-    BoxPtr         pBox;
-    int            i, nRects;
-
-    DMX_GC_FUNC_PROLOGUE(pGC);
-    pGC->funcs->ChangeClip(pGC, type, pvalue, nrects);
-
-    /* Set the client clip on the back-end server */
-    switch (pGC->clientClipType) {
-    case CT_NONE:
-	if (dmxScreen->beDisplay)
-	    XSetClipMask(dmxScreen->beDisplay, pGCPriv->gc, None);
-	break;
-
-    case CT_REGION:
-	if (dmxScreen->beDisplay) {
-	    nRects = RegionNumRects((RegionPtr)pGC->clientClip);
-	    pRects = malloc(nRects * sizeof(*pRects));
-	    pBox   = RegionRects((RegionPtr)pGC->clientClip);
-
-	    for (i = 0; i < nRects; i++) {
-		pRects[i].x      = pBox[i].x1;
-		pRects[i].y      = pBox[i].y1;
-		pRects[i].width  = pBox[i].x2 - pBox[i].x1;
-		pRects[i].height = pBox[i].y2 - pBox[i].y1;
-	    }
-
-	    XSetClipRectangles(dmxScreen->beDisplay, pGCPriv->gc,
-			       pGC->clipOrg.x, pGC->clipOrg.y,
-			       pRects, nRects, Unsorted);
-
-	    free(pRects);
-	}
-	break;
-
-    case CT_PIXMAP:
-	/* Condensed down to REGION in the mi code */
-	break;
-    }
-
-    DMX_GC_FUNC_EPILOGUE(pGC);
-}
-
-/** Destroy a GC's clip rects. */
-void dmxDestroyClip(GCPtr pGC)
-{
-    ScreenPtr      pScreen = pGC->pScreen;
-    DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
-    dmxGCPrivPtr   pGCPriv = DMX_GET_GC_PRIV(pGC);
-
-    DMX_GC_FUNC_PROLOGUE(pGC);
-    pGC->funcs->DestroyClip(pGC);
-
-    /* Set the client clip on the back-end server to None */
-    if (dmxScreen->beDisplay)
-	XSetClipMask(dmxScreen->beDisplay, pGCPriv->gc, None);
-
-    DMX_GC_FUNC_EPILOGUE(pGC);
-}
-
-/** Copy a GC's clip rects. */
-void dmxCopyClip(GCPtr pGCDst, GCPtr pGCSrc)
-{
-    DMX_GC_FUNC_PROLOGUE(pGCDst);
-    pGCDst->funcs->CopyClip(pGCDst, pGCSrc);
-    DMX_GC_FUNC_EPILOGUE(pGCDst);
-}
diff --git a/hw/dmx/dmxgc.h b/hw/dmx/dmxgc.h
index 4ff3cd8..7b2b435 100644
--- a/hw/dmx/dmxgc.h
+++ b/hw/dmx/dmxgc.h
@@ -56,9 +56,6 @@ extern void dmxValidateGC(GCPtr pGC, unsigned long changes,
 extern void dmxChangeGC(GCPtr pGC, unsigned long mask);
 extern void dmxCopyGC(GCPtr pGCSrc, unsigned long changes, GCPtr pGCDst);
 extern void dmxDestroyGC(GCPtr pGC);
-extern void dmxChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects);
-extern void dmxDestroyClip(GCPtr pGC);
-extern void dmxCopyClip(GCPtr pGCDst, GCPtr pGCSrc);
 
 extern void dmxBECreateGC(ScreenPtr pScreen, GCPtr pGC);
 extern Bool dmxBEFreeGC(GCPtr pGC);
diff --git a/hw/xfree86/common/xf86VGAarbiter.c b/hw/xfree86/common/xf86VGAarbiter.c
index 215e845..658cf4e 100644
--- a/hw/xfree86/common/xf86VGAarbiter.c
+++ b/hw/xfree86/common/xf86VGAarbiter.c
@@ -41,8 +41,7 @@
 
 static GCFuncs VGAarbiterGCFuncs = {
     VGAarbiterValidateGC, VGAarbiterChangeGC, VGAarbiterCopyGC,
-    VGAarbiterDestroyGC, VGAarbiterChangeClip, VGAarbiterDestroyClip,
-    VGAarbiterCopyClip
+    VGAarbiterDestroyGC,
 };
 
 static GCOps VGAarbiterGCOps = {
@@ -623,34 +622,6 @@ VGAarbiterCopyGC (
     GC_WRAP (pGCDst);
 }
 
-static void
-VGAarbiterChangeClip (
-    GCPtr   pGC,
-    int     type,
-    pointer pvalue,
-    int     nrects )
-{
-    GC_UNWRAP (pGC);
-    (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
-    GC_WRAP (pGC);
-}
-
-static void
-VGAarbiterCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
-{
-    GC_UNWRAP (pgcDst);
-    (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
-    GC_WRAP (pgcDst);
-}
-
-static void
-VGAarbiterDestroyClip(GCPtr pGC)
-{
-    GC_UNWRAP (pGC);
-    (* pGC->funcs->DestroyClip)(pGC);
-    GC_WRAP (pGC);
-}
-
 /* GC Ops */
 static void
 VGAarbiterFillSpans(
diff --git a/hw/xfree86/common/xf86VGAarbiterPriv.h b/hw/xfree86/common/xf86VGAarbiterPriv.h
index 848e45d..2db2045 100644
--- a/hw/xfree86/common/xf86VGAarbiterPriv.h
+++ b/hw/xfree86/common/xf86VGAarbiterPriv.h
@@ -182,10 +182,6 @@ static void VGAarbiterValidateGC(GCPtr pGC, unsigned long changes,
 static void VGAarbiterChangeGC(GCPtr pGC, unsigned long mask);
 static void VGAarbiterCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
 static void VGAarbiterDestroyGC(GCPtr pGC);
-static void VGAarbiterChangeClip(GCPtr pGC, int type, pointer pvalue,
-    int nrects);
-static void VGAarbiterDestroyClip(GCPtr pGC);
-static void VGAarbiterCopyClip(GCPtr pgcDst, GCPtr pgcSrc);
 
 /* GC ops */
 static void VGAarbiterFillSpans( DrawablePtr pDraw, GC *pGC, int nInit,
diff --git a/hw/xfree86/shadowfb/shadow.c b/hw/xfree86/shadowfb/shadow.c
index 5cc476a..499bbc3 100644
--- a/hw/xfree86/shadowfb/shadow.c
+++ b/hw/xfree86/shadowfb/shadow.c
@@ -359,13 +359,9 @@ static void ShadowValidateGC(GCPtr, unsigned long, DrawablePtr);
 static void ShadowChangeGC(GCPtr, unsigned long);
 static void ShadowCopyGC(GCPtr, unsigned long, GCPtr);
 static void ShadowDestroyGC(GCPtr);
-static void ShadowChangeClip(GCPtr, int, pointer, int);
-static void ShadowDestroyClip(GCPtr);
-static void ShadowCopyClip(GCPtr, GCPtr);
 
 GCFuncs ShadowGCFuncs = {
     ShadowValidateGC, ShadowChangeGC, ShadowCopyGC, ShadowDestroyGC,
-    ShadowChangeClip, ShadowDestroyClip, ShadowCopyClip
 };
 
 
@@ -436,37 +432,6 @@ ShadowCopyGC (
     SHADOW_GC_FUNC_EPILOGUE (pGCDst);
 }
 
-static void
-ShadowChangeClip (
-    GCPtr   pGC,
-    int		type,
-    pointer	pvalue,
-    int		nrects 
-){
-    SHADOW_GC_FUNC_PROLOGUE (pGC);
-    (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
-    SHADOW_GC_FUNC_EPILOGUE (pGC);
-}
-
-static void
-ShadowCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
-{
-    SHADOW_GC_FUNC_PROLOGUE (pgcDst);
-    (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
-    SHADOW_GC_FUNC_EPILOGUE (pgcDst);
-}
-
-static void
-ShadowDestroyClip(GCPtr pGC)
-{
-    SHADOW_GC_FUNC_PROLOGUE (pGC);
-    (* pGC->funcs->DestroyClip)(pGC);
-    SHADOW_GC_FUNC_EPILOGUE (pGC);
-}
-
-
-
-
 /**********************************************************/
 
 
diff --git a/hw/xfree86/xaa/xaaGC.c b/hw/xfree86/xaa/xaaGC.c
index 44d50e6..34e0119 100644
--- a/hw/xfree86/xaa/xaaGC.c
+++ b/hw/xfree86/xaa/xaaGC.c
@@ -23,13 +23,9 @@ static void XAAValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDraw);
 static void XAAChangeGC(GCPtr pGC, unsigned long mask);
 static void XAACopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
 static void XAADestroyGC(GCPtr pGC);
-static void XAAChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects);
-static void XAADestroyClip(GCPtr pGC);
-static void XAACopyClip(GCPtr pgcDst, GCPtr pgcSrc);
 
 GCFuncs XAAGCFuncs = {
     XAAValidateGC, XAAChangeGC, XAACopyGC, XAADestroyGC,
-    XAAChangeClip, XAADestroyClip, XAACopyClip
 };
 
 extern GCOps XAAPixmapOps;
@@ -280,34 +276,7 @@ XAACopyGC (
     (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
     XAA_GC_FUNC_EPILOGUE (pGCDst);
 }
-static void
-XAAChangeClip (
-    GCPtr   pGC,
-    int		type,
-    pointer	pvalue,
-    int		nrects )
-{
-    XAA_GC_FUNC_PROLOGUE (pGC);
-    (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
-    XAA_GC_FUNC_EPILOGUE (pGC);
-}
 
-static void
-XAACopyClip(GCPtr pgcDst, GCPtr pgcSrc)
-{
-    XAA_GC_FUNC_PROLOGUE (pgcDst);
-    (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
-    XAA_GC_FUNC_EPILOGUE (pgcDst);
-}
-
-static void
-XAADestroyClip(GCPtr pGC)
-{
-    XAA_GC_FUNC_PROLOGUE (pGC);
-    (* pGC->funcs->DestroyClip)(pGC);
-    XAA_GC_FUNC_EPILOGUE (pGC);
-}
- 
 /**** Pixmap Wrappers ****/
 
 
diff --git a/hw/xnest/GC.c b/hw/xnest/GC.c
index 48fe4dc..579350b 100644
--- a/hw/xnest/GC.c
+++ b/hw/xnest/GC.c
@@ -42,9 +42,6 @@ static GCFuncs xnestFuncs = {
   xnestChangeGC,
   xnestCopyGC,
   xnestDestroyGC,
-  xnestChangeClip,
-  xnestDestroyClip,
-  xnestCopyClip,
 };
 
 static GCOps xnestOps = {
@@ -90,6 +87,42 @@ xnestValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
 {
 }
 
+static void
+xnestChangeClip(GCPtr pGC)
+{
+  int i, size, nRects;
+  BoxPtr pBox;
+  XRectangle *pRects;
+
+  switch(pGC->clientClipType)
+    {
+    case CT_NONE:
+      XSetClipMask(xnestDisplay, xnestGC(pGC), None);
+      break;
+
+    case CT_REGION:
+      nRects = RegionNumRects((RegionPtr) pGC->clientClip);
+      size = nRects * sizeof(*pRects);
+      pRects = (XRectangle *) malloc(size);
+      pBox = RegionRects((RegionPtr) pGC->clientClip);
+      for (i = nRects; i-- > 0; ) {
+	pRects[i].x = pBox[i].x1;
+	pRects[i].y = pBox[i].y1;
+	pRects[i].width = pBox[i].x2 - pBox[i].x1;
+	pRects[i].height = pBox[i].y2 - pBox[i].y1;
+      }
+      XSetClipRectangles(xnestDisplay, xnestGC(pGC), 0, 0,
+			 pRects, nRects, Unsorted);
+      free((char *) pRects);
+      break;
+
+    case CT_PIXMAP:
+      XSetClipMask(xnestDisplay, xnestGC(pGC),
+		   xnestPixmap((PixmapPtr) pGC->clientClip));
+      break;
+    }
+}
+
 void
 xnestChangeGC(GCPtr pGC, unsigned long mask)
 {
@@ -156,8 +189,10 @@ xnestChangeGC(GCPtr pGC, unsigned long mask)
   if (mask & GCClipYOrigin)
     values.clip_y_origin = pGC->clipOrg.y;
 
-  if (mask & GCClipMask) /* this is handled in change clip */
+  if (mask & GCClipMask) {
     mask &= ~GCClipMask;
+    xnestChangeClip(pGC);
+  }
 
   if (mask & GCDashOffset)
     values.dash_offset = pGC->dashOffset;
@@ -179,6 +214,7 @@ void
 xnestCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst)
 {
   XCopyGC(xnestDisplay, xnestGC(pGCSrc), mask, xnestGC(pGCDst));
+  pGCDst->stateChanges &= ~mask;
 }
 
 void
@@ -186,145 +222,3 @@ xnestDestroyGC(GCPtr pGC)
 {
   XFreeGC(xnestDisplay, xnestGC(pGC));
 }
-
-void
-xnestChangeClip(GCPtr pGC, int type, pointer pValue, int nRects)
-{
-  int i, size;
-  BoxPtr pBox;
-  XRectangle *pRects;
-
-  xnestDestroyClipHelper(pGC);
-
-  switch(type) 
-    {
-    case CT_NONE:
-      XSetClipMask(xnestDisplay, xnestGC(pGC), None);
-      break;
-      
-    case CT_REGION:
-      nRects = RegionNumRects((RegionPtr)pValue);
-      size = nRects * sizeof(*pRects);
-      pRects = (XRectangle *) malloc(size);
-      pBox = RegionRects((RegionPtr)pValue);
-      for (i = nRects; i-- > 0; ) {
-	pRects[i].x = pBox[i].x1;
-	pRects[i].y = pBox[i].y1;
-	pRects[i].width = pBox[i].x2 - pBox[i].x1;
-	pRects[i].height = pBox[i].y2 - pBox[i].y1;
-      }
-      XSetClipRectangles(xnestDisplay, xnestGC(pGC), 0, 0,
-			 pRects, nRects, Unsorted);
-      free((char *) pRects);
-      break;
-
-    case CT_PIXMAP:
-      XSetClipMask(xnestDisplay, xnestGC(pGC), 
-		   xnestPixmap((PixmapPtr)pValue));
-      /*
-       * Need to change into region, so subsequent uses are with
-       * current pixmap contents.
-       */
-      pGC->clientClip = (pointer) (*pGC->pScreen->BitmapToRegion)((PixmapPtr)pValue);
-      (*pGC->pScreen->DestroyPixmap)((PixmapPtr)pValue);
-      pValue = pGC->clientClip;
-      type = CT_REGION;
-      break;
-
-    case CT_UNSORTED:
-      XSetClipRectangles(xnestDisplay, xnestGC(pGC), 
-			 pGC->clipOrg.x, pGC->clipOrg.y,
-			 (XRectangle *)pValue, nRects, Unsorted);
-      break;
-
-    case CT_YSORTED:
-      XSetClipRectangles(xnestDisplay, xnestGC(pGC), 
-			 pGC->clipOrg.x, pGC->clipOrg.y,
-			 (XRectangle *)pValue, nRects, YSorted);
-      break;
-
-    case CT_YXSORTED:
-      XSetClipRectangles(xnestDisplay, xnestGC(pGC), 
-			 pGC->clipOrg.x, pGC->clipOrg.y,
-			 (XRectangle *)pValue, nRects, YXSorted);
-      break;
-
-    case CT_YXBANDED:
-      XSetClipRectangles(xnestDisplay, xnestGC(pGC), 
-			 pGC->clipOrg.x, pGC->clipOrg.y,
-			 (XRectangle *)pValue, nRects, YXBanded);
-      break;
-    }
-
-  switch(type) 
-    {
-    default:
-      break;
-
-    case CT_UNSORTED:
-    case CT_YSORTED:
-    case CT_YXSORTED:
-    case CT_YXBANDED:
-      
-      /*
-       * other parts of server can only deal with CT_NONE,
-       * CT_PIXMAP and CT_REGION client clips.
-       */
-      pGC->clientClip = (pointer) RegionFromRects(nRects,
-						  (xRectangle *)pValue, type);
-      free(pValue);
-      pValue = pGC->clientClip;
-      type = CT_REGION;
-
-      break;
-    }
-
-  pGC->clientClipType = type;
-  pGC->clientClip = pValue;
-}
-
-void
-xnestDestroyClip(GCPtr pGC)
-{
-  xnestDestroyClipHelper(pGC);
-
-  XSetClipMask(xnestDisplay, xnestGC(pGC), None);
- 
-  pGC->clientClipType = CT_NONE;
-  pGC->clientClip = NULL;
-}
-
-void
-xnestDestroyClipHelper(GCPtr pGC)
-{
-  switch (pGC->clientClipType)
-    {
-    default:
-    case CT_NONE:
-      break;
-      
-    case CT_REGION:
-      RegionDestroy(pGC->clientClip);
-      break;
-    }
-}
-
-void
-xnestCopyClip(GCPtr pGCDst, GCPtr pGCSrc)
-{
-  RegionPtr pRgn;
-
-  switch (pGCSrc->clientClipType)
-    {
-    default:
-    case CT_NONE:
-      xnestDestroyClip(pGCDst);
-      break;
-
-    case CT_REGION:
-      pRgn = RegionCreate(NULL, 1);
-      RegionCopy(pRgn, pGCSrc->clientClip);
-      xnestChangeClip(pGCDst, CT_REGION, pRgn, 0);
-      break;
-    }
-}
diff --git a/hw/xnest/XNGC.h b/hw/xnest/XNGC.h
index c4a6cef..ec115d7 100644
--- a/hw/xnest/XNGC.h
+++ b/hw/xnest/XNGC.h
@@ -34,9 +34,5 @@ void xnestValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable);
 void xnestChangeGC(GCPtr pGC, unsigned long mask);
 void xnestCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
 void xnestDestroyGC(GCPtr pGC);
-void xnestChangeClip(GCPtr pGC, int type, pointer pValue, int nRects);
-void xnestDestroyClip(GCPtr pGC);
-void xnestDestroyClipHelper(GCPtr pGC);
-void xnestCopyClip(GCPtr pGCDst, GCPtr pGCSrc);
 
 #endif /* XNESTGC_H */
diff --git a/hw/xwin/wingc.c b/hw/xwin/wingc.c
index e351c50..09e9968 100644
--- a/hw/xwin/wingc.c
+++ b/hw/xwin/wingc.c
@@ -60,26 +60,12 @@ static void
 winDestroyGCNativeGDI (GCPtr pGC);
 
 #if 0
-static void
-winChangeClipNativeGDI (GCPtr pGC, int nType, pointer pValue, int nRects);
-
-static void
-winDestroyClipNativeGDI (GCPtr pGC);
-
-static void
-winCopyClipNativeGDI (GCPtr pGCdst, GCPtr pGCsrc);
-#endif
-
-#if 0
 /* GC Handling Routines */
 const GCFuncs winGCFuncs = {
   winValidateGCNativeGDI,
   winChangeGCNativeGDI,
   winCopyGCNativeGDI,
   winDestroyGCNativeGDI,
-  winChangeClipNativeGDI,
-  winDestroyClipNativeGDI,
-  winCopyClipNativeGDI,
 };
 #else
 const GCFuncs winGCFuncs = {
@@ -87,9 +73,6 @@ const GCFuncs winGCFuncs = {
   miChangeGC,
   miCopyGC,
   winDestroyGCNativeGDI,
-  miChangeClip,
-  miDestroyClip,
-  miCopyClip,
 };
 #endif
 
@@ -224,28 +207,3 @@ winDestroyGCNativeGDI (GCPtr pGC)
   /* Invalidate the GC privates pointer */
   winSetGCPriv (pGC, NULL);
 }
-
-#if 0
-/* See Porting Layer Definition - p. 46 */
-static void
-winChangeClipNativeGDI (GCPtr pGC, int nType, pointer pValue, int nRects)
-{
-
-}
-
-
-/* See Porting Layer Definition - p. 47 */
-static void
-winDestroyClipNativeGDI (GCPtr pGC)
-{
-
-}
-
-
-/* See Porting Layer Definition - p. 47 */
-static void
-winCopyClipNativeGDI (GCPtr pGCdst, GCPtr pGCsrc)
-{
-
-}
-#endif
diff --git a/include/gcstruct.h b/include/gcstruct.h
index 4fea02c..fb9ee0d 100644
--- a/include/gcstruct.h
+++ b/include/gcstruct.h
@@ -65,6 +65,13 @@ SOFTWARE.
  * functions which modify the state of the GC
  */
 
+extern _X_EXPORT void ChangeClip(
+    GCPtr   /*pGC*/,
+    int     /*type*/,
+    pointer /*pvalue*/,
+    int     /*nrects*/
+);
+
 typedef struct _GCFuncs {
     void	(* ValidateGC)(
 		GCPtr /*pGC*/,
@@ -82,19 +89,6 @@ typedef struct _GCFuncs {
 
     void	(* DestroyGC)(
 		GCPtr /*pGC*/);
-
-    void	(* ChangeClip)(
-		GCPtr /*pGC*/,
-		int /*type*/,
-		pointer /*pvalue*/,
-		int /*nrects*/);
-
-    void	(* DestroyClip)(
-		GCPtr /*pGC*/);
-
-    void	(* CopyClip)(
-		GCPtr /*pgcDst*/,
-		GCPtr /*pgcSrc*/);
 } GCFuncs;
 
 /*
diff --git a/mi/mibitblt.c b/mi/mibitblt.c
index 49e17bd..e302960 100644
--- a/mi/mibitblt.c
+++ b/mi/mibitblt.c
@@ -443,7 +443,7 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
     prgnSrcClip = RegionCreate(NULL, 0);
     RegionCopy(prgnSrcClip, prgnSrc);
     RegionTranslate(prgnSrcClip, srcx, 0);
-    (*pGCT->funcs->ChangeClip)(pGCT, CT_REGION, prgnSrcClip, 0);
+    ChangeClip(pGCT, CT_REGION, prgnSrcClip, 0);
     ValidateGC((DrawablePtr)pPixmap, pGCT);
 
     /* Since we know pDraw is always a pixmap, we never need to think
@@ -527,8 +527,6 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
 	GCTileStipXOrigin | GCTileStipYOrigin, gcv);
 
     ValidateGC(pDraw, pGC);
-    /* put what we hope is a smaller clip region back in the scratch gc */
-    (*pGCT->funcs->ChangeClip)(pGCT, CT_NONE, NULL, 0);
     FreeScratchGC(pGCT);
     (*pDraw->pScreen->DestroyPixmap)(pPixmap);
 
diff --git a/mi/migc.c b/mi/migc.c
index 6d734e1..dce1f30 100644
--- a/mi/migc.c
+++ b/mi/migc.c
@@ -53,76 +53,6 @@ miDestroyGC(GCPtr pGC)
 	RegionDestroy(pGC->pCompositeClip);
 }
 
-void
-miDestroyClip(GCPtr pGC)
-{
-    if (pGC->clientClipType == CT_NONE)
-	return;
-    else if (pGC->clientClipType == CT_PIXMAP)
-    {
-	(*pGC->pScreen->DestroyPixmap) ((PixmapPtr) (pGC->clientClip));
-    }
-    else
-    {
-	/*
-	 * we know we'll never have a list of rectangles, since ChangeClip
-	 * immediately turns them into a region
-	 */
-	RegionDestroy(pGC->clientClip);
-    }
-    pGC->clientClip = NULL;
-    pGC->clientClipType = CT_NONE;
-}
-
-void
-miChangeClip( GCPtr pGC, int type, pointer pvalue, int nrects)
-{
-    (*pGC->funcs->DestroyClip) (pGC);
-    if (type == CT_PIXMAP)
-    {
-	/* convert the pixmap to a region */
-	pGC->clientClip = (pointer) BitmapToRegion(pGC->pScreen,
-							(PixmapPtr) pvalue);
-	(*pGC->pScreen->DestroyPixmap) (pvalue);
-    }
-    else if (type == CT_REGION)
-    {
-	/* stuff the region in the GC */
-	pGC->clientClip = pvalue;
-    }
-    else if (type != CT_NONE)
-    {
-	pGC->clientClip = (pointer) RegionFromRects(nrects,
-						      (xRectangle *) pvalue,
-								    type);
-	free(pvalue);
-    }
-    pGC->clientClipType = (type != CT_NONE && pGC->clientClip) ? CT_REGION : CT_NONE;
-    pGC->stateChanges |= GCClipMask;
-}
-
-void
-miCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
-{
-    RegionPtr       prgnNew;
-
-    switch (pgcSrc->clientClipType)
-    {
-      case CT_PIXMAP:
-	((PixmapPtr) pgcSrc->clientClip)->refcnt++;
-	/* Fall through !! */
-      case CT_NONE:
-	(*pgcDst->funcs->ChangeClip) (pgcDst, (int) pgcSrc->clientClipType,
-				   pgcSrc->clientClip, 0);
-	break;
-      case CT_REGION:
-	prgnNew = RegionCreate(NULL, 1);
-	RegionCopy(prgnNew, (RegionPtr) (pgcSrc->clientClip));
-	(*pgcDst->funcs->ChangeClip) (pgcDst, CT_REGION, (pointer) prgnNew, 0);
-	break;
-    }
-}
-
 /* ARGSUSED */
 void
 miCopyGC(GCPtr pGCSrc, unsigned long changes, GCPtr pGCDst)
diff --git a/mi/migc.h b/mi/migc.h
index df5805f..1762f0d 100644
--- a/mi/migc.h
+++ b/mi/migc.h
@@ -36,22 +36,6 @@ extern _X_EXPORT void miDestroyGC(
     GCPtr  /*pGC*/
 );
 
-extern _X_EXPORT void miDestroyClip(
-    GCPtr /*pGC*/
-);
-
-extern _X_EXPORT void miChangeClip(
-    GCPtr   /*pGC*/,
-    int     /*type*/,
-    pointer /*pvalue*/,
-    int     /*nrects*/
-);
-
-extern _X_EXPORT void miCopyClip(
-    GCPtr /*pgcDst*/,
-    GCPtr /*pgcSrc*/
-);
-
 extern _X_EXPORT void miCopyGC(
     GCPtr /*pGCSrc*/,
     unsigned long /*changes*/,
diff --git a/miext/cw/cw.c b/miext/cw/cw.c
index 3da3bc3..6402f1b 100644
--- a/miext/cw/cw.c
+++ b/miext/cw/cw.c
@@ -61,21 +61,12 @@ static void
 cwCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
 static void
 cwDestroyGC(GCPtr pGC);
-static void
-cwChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects);
-static void
-cwCopyClip(GCPtr pgcDst, GCPtr pgcSrc);
-static void
-cwDestroyClip(GCPtr pGC);
 
 GCFuncs cwGCFuncs = {
     cwValidateGC,
     cwChangeGC,
     cwCopyGC,
     cwDestroyGC,
-    cwChangeClip,
-    cwDestroyClip,
-    cwCopyClip,
 };
 
 /* Find the real drawable to draw to, and provide offsets that will translate
@@ -196,8 +187,7 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable)
 	 * offset for it.
 	 */
 	
-	(*pBackingGC->funcs->ChangeClip) (pBackingGC, CT_REGION,
-					  (pointer) pCompositeClip, 0);
+	ChangeClip(pBackingGC, CT_REGION, pCompositeClip, 0);
 	
 	vals[0].val = x_off - pDrawable->x;
 	vals[1].val = y_off - pDrawable->y;
@@ -270,42 +260,6 @@ cwDestroyGC(GCPtr pGC)
     /* leave it unwrapped */
 }
 
-static void
-cwChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects)
-{
-    cwGCPtr pPriv = (cwGCPtr)dixLookupPrivate(&pGC->devPrivates, cwGCKey);
-
-    FUNC_PROLOGUE(pGC, pPriv);
-
-    (*pGC->funcs->ChangeClip)(pGC, type, pvalue, nrects);
-
-    FUNC_EPILOGUE(pGC, pPriv);
-}
-
-static void
-cwCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
-{
-    cwGCPtr pPriv = (cwGCPtr)dixLookupPrivate(&pgcDst->devPrivates, cwGCKey);
-
-    FUNC_PROLOGUE(pgcDst, pPriv);
-
-    (*pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
-
-    FUNC_EPILOGUE(pgcDst, pPriv);
-}
-
-static void
-cwDestroyClip(GCPtr pGC)
-{
-    cwGCPtr pPriv = (cwGCPtr)dixLookupPrivate(&pGC->devPrivates, cwGCKey);
-
-    FUNC_PROLOGUE(pGC, pPriv);
-
-    (*pGC->funcs->DestroyClip)(pGC);
-
-    FUNC_EPILOGUE(pGC, pPriv);
-}
-
 /*
  * Screen wrappers.
  */
@@ -424,7 +378,7 @@ cwCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
 			 -pBackingPixmap->screen_x,
 			 -pBackingPixmap->screen_y);
 	
-	(*pGC->funcs->ChangeClip) (pGC, CT_REGION, pClip, 0);
+	ChangeClip(pGC, CT_REGION, pClip, 0);
 
 	ValidateGC(&pBackingPixmap->drawable, pGC);
 
@@ -432,8 +386,6 @@ cwCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
 			       &pBackingPixmap->drawable, pGC,
 			       src_x, src_y, w, h, dst_x, dst_y);
 
-	(*pGC->funcs->DestroyClip) (pGC);
-
 	FreeScratchGC(pGC);
     }
 	
diff --git a/miext/damage/damage.c b/miext/damage/damage.c
index d791211..a24b6cc 100644
--- a/miext/damage/damage.c
+++ b/miext/damage/damage.c
@@ -383,13 +383,9 @@ static void damageValidateGC(GCPtr, unsigned long, DrawablePtr);
 static void damageChangeGC(GCPtr, unsigned long);
 static void damageCopyGC(GCPtr, unsigned long, GCPtr);
 static void damageDestroyGC(GCPtr);
-static void damageChangeClip(GCPtr, int, pointer, int);
-static void damageDestroyClip(GCPtr);
-static void damageCopyClip(GCPtr, GCPtr);
 
 static GCFuncs damageGCFuncs = {
     damageValidateGC, damageChangeGC, damageCopyGC, damageDestroyGC,
-    damageChangeClip, damageDestroyClip, damageCopyClip
 };
 
 static GCOps damageGCOps;
@@ -470,33 +466,6 @@ damageCopyGC (GCPtr	    pGCSrc,
     DAMAGE_GC_FUNC_EPILOGUE (pGCDst);
 }
 
-static void
-damageChangeClip (GCPtr	    pGC,
-		  int	    type,
-		  pointer   pvalue,
-		  int	    nrects)
-{
-    DAMAGE_GC_FUNC_PROLOGUE (pGC);
-    (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
-    DAMAGE_GC_FUNC_EPILOGUE (pGC);
-}
-
-static void
-damageCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
-{
-    DAMAGE_GC_FUNC_PROLOGUE (pgcDst);
-    (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
-    DAMAGE_GC_FUNC_EPILOGUE (pgcDst);
-}
-
-static void
-damageDestroyClip(GCPtr pGC)
-{
-    DAMAGE_GC_FUNC_PROLOGUE (pGC);
-    (* pGC->funcs->DestroyClip)(pGC);
-    DAMAGE_GC_FUNC_EPILOGUE (pGC);
-}
-
 #define TRIM_BOX(box, pGC) if (pGC->pCompositeClip) { \
     BoxPtr extents = &pGC->pCompositeClip->extents;\
     if(box.x1 < extents->x1) box.x1 = extents->x1; \
diff --git a/miext/rootless/rootlessGC.c b/miext/rootless/rootlessGC.c
index 68a9dc7..93080c7 100644
--- a/miext/rootless/rootlessGC.c
+++ b/miext/rootless/rootlessGC.c
@@ -56,10 +56,6 @@ static void RootlessValidateGC(GCPtr pGC, unsigned long changes,
 static void RootlessChangeGC(GCPtr pGC, unsigned long mask);
 static void RootlessCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
 static void RootlessDestroyGC(GCPtr pGC);
-static void RootlessChangeClip(GCPtr pGC, int type, pointer pvalue,
-                               int nrects);
-static void RootlessDestroyClip(GCPtr pGC);
-static void RootlessCopyClip(GCPtr pgcDst, GCPtr pgcSrc);
 
 Bool RootlessCreateGC(GCPtr pGC);
 
@@ -68,9 +64,6 @@ GCFuncs rootlessGCFuncs = {
     RootlessChangeGC,
     RootlessCopyGC,
     RootlessDestroyGC,
-    RootlessChangeClip,
-    RootlessDestroyClip,
-    RootlessCopyClip,
 };
 
 // GC operations
@@ -371,28 +364,6 @@ static void RootlessDestroyGC(GCPtr pGC)
     GCFUNC_WRAP(pGC);
 }
 
-static void RootlessChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects)
-{
-    GCFUNC_UNWRAP(pGC);
-    pGC->funcs->ChangeClip(pGC, type, pvalue, nrects);
-    GCFUNC_WRAP(pGC);
-}
-
-static void RootlessDestroyClip(GCPtr pGC)
-{
-    GCFUNC_UNWRAP(pGC);
-    pGC->funcs->DestroyClip(pGC);
-    GCFUNC_WRAP(pGC);
-}
-
-static void RootlessCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
-{
-    GCFUNC_UNWRAP(pgcDst);
-    pgcDst->funcs->CopyClip(pgcDst, pgcSrc);
-    GCFUNC_WRAP(pgcDst);
-}
-
-
 /*
  * GC ops
  *
diff --git a/render/mirect.c b/render/mirect.c
index 4fb347a..73a1651 100644
--- a/render/mirect.c
+++ b/render/mirect.c
@@ -66,7 +66,7 @@ miColorRects (PicturePtr    pDst,
 	pClip = RegionCreate(NULL, 1);
 	RegionCopy(pClip,
 		     (RegionPtr) pClipPict->clientClip);
-	(*pGC->funcs->ChangeClip) (pGC, CT_REGION, pClip, 0);
+	ChangeClip(pGC, CT_REGION, pClip, 0);
     }
 
     ChangeGC (NullClient, pGC, mask, tmpval);
diff --git a/xfixes/region.c b/xfixes/region.c
index 4c22637..606bf7a 100644
--- a/xfixes/region.c
+++ b/xfixes/region.c
@@ -623,7 +623,7 @@ ProcXFixesSetGCClipRegion (ClientPtr client)
     vals[0].val = stuff->xOrigin;
     vals[1].val = stuff->yOrigin;
     ChangeGC (NullClient, pGC, GCClipXOrigin|GCClipYOrigin, vals);
-    (*pGC->funcs->ChangeClip)(pGC, pRegion ? CT_REGION : CT_NONE, (pointer)pRegion, 0);
+    ChangeClip(pGC, pRegion ? CT_REGION : CT_NONE, pRegion, 0);
 
     return Success;
 }
-- 
1.7.5.4



More information about the xorg-devel mailing list