summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2010-06-08 16:14:09 -0700
committerJamey Sharp <jamey@minilop.net>2011-12-14 17:15:41 -0800
commitc1e65b6eee53484d49bc10074927c8a6e28a8cde (patch)
tree1450484720ad880e078905e2b32042b687012e2a
parentf7ea7a324520844beaac8be7503ac50e20da5ab1 (diff)
Quit wrapping ChangeClip, CopyClip, and DestroyClip in GCFuncs.
Use the mi implementation of these functions instead, moving them to dix/gc.c. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
-rw-r--r--Xext/panoramiX.c32
-rw-r--r--dix/gc.c87
-rw-r--r--doc/Xserver-spec.xml76
-rw-r--r--exa/exa.c48
-rw-r--r--fb/fbgc.c3
-rw-r--r--hw/dmx/dmxgc.c123
-rw-r--r--hw/dmx/dmxgc.h3
-rw-r--r--hw/xfree86/common/xf86VGAarbiter.c31
-rw-r--r--hw/xfree86/common/xf86VGAarbiterPriv.h4
-rw-r--r--hw/xfree86/shadowfb/shadow.c35
-rw-r--r--hw/xfree86/xaa/xaaGC.c31
-rw-r--r--hw/xnest/GC.c186
-rw-r--r--hw/xnest/XNGC.h4
-rw-r--r--hw/xwin/wingc.c42
-rw-r--r--include/gcstruct.h20
-rw-r--r--mi/mibitblt.c4
-rw-r--r--mi/migc.c70
-rw-r--r--mi/migc.h16
-rw-r--r--miext/cw/cw.c52
-rw-r--r--miext/damage/damage.c31
-rw-r--r--miext/rootless/rootlessGC.c29
-rw-r--r--render/mirect.c2
-rw-r--r--xfixes/region.c2
23 files changed, 177 insertions, 754 deletions
diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index fae7c81c9..668831f02 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 fc251dd01..e7568fc52 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 2b11828fc..1bd36971c 100644
--- a/doc/Xserver-spec.xml
+++ b/doc/Xserver-spec.xml
@@ -3794,7 +3794,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>
@@ -3865,78 +3865,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>
@@ -4934,7 +4862,6 @@ mi and fb implementations.</para>
<row><entry><function>AddScreen</function></entry><entry><literal>dix</literal></entry><entry><para></para></entry></row>
<row><entry><function>AdjustWaitForDelay</function></entry><entry><literal>os</literal></entry><entry><para></para></entry></row>
<row><entry><function>Bell</function></entry><entry><literal>hd</literal></entry><entry><para>Device</para></entry></row>
-<row><entry><function>ChangeClip</function></entry><entry><literal>mi</literal></entry><entry><para>GC func</para></entry></row>
<row><entry><function>ChangeGC</function></entry><entry><literal></literal></entry><entry><para>GC func</para></entry></row>
<row><entry><function>ChangeWindowAttributes</function></entry><entry><literal>ddx</literal></entry><entry><para>Screen</para></entry></row>
<row><entry><function>ClearToBackground</function></entry><entry><literal>ddx</literal></entry><entry><para>Window</para></entry></row>
@@ -4960,7 +4887,6 @@ mi and fb implementations.</para>
<row><entry><function>DEALLOCATE_LOCAL</function></entry><entry><literal>os</literal></entry><entry><para></para></entry></row>
<row><entry><function>DeleteCallback</function></entry><entry><literal>dix</literal></entry><entry><para></para></entry></row>
<row><entry><function>DeleteCallbackList</function></entry><entry><literal>dix</literal></entry><entry><para></para></entry></row>
-<row><entry><function>DestroyClip</function></entry><entry><literal>ddx</literal></entry><entry><para>GC func</para></entry></row>
<row><entry><function>DestroyGC</function></entry><entry><literal>ddx</literal></entry><entry><para>GC func</para></entry></row>
<row><entry><function>DestroyPixmap</function></entry><entry><literal>ddx</literal></entry><entry><para>Screen</para></entry></row>
<row><entry><function>DestroyWindow</function></entry><entry><literal>ddx</literal></entry><entry><para>Screen</para></entry></row>
diff --git a/exa/exa.c b/exa/exa.c
index 4ce983bc3..17cded0b3 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 8108c3acb..aa75d7a00 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 f10f9a074..b1347c106 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 4ff3cd800..7b2b435a5 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 819ad6e7c..02e30452f 100644
--- a/hw/xfree86/common/xf86VGAarbiter.c
+++ b/hw/xfree86/common/xf86VGAarbiter.c
@@ -39,8 +39,7 @@
static GCFuncs VGAarbiterGCFuncs = {
VGAarbiterValidateGC, VGAarbiterChangeGC, VGAarbiterCopyGC,
- VGAarbiterDestroyGC, VGAarbiterChangeClip, VGAarbiterDestroyClip,
- VGAarbiterCopyClip
+ VGAarbiterDestroyGC,
};
static GCOps VGAarbiterGCOps = {
@@ -621,34 +620,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 848e45da7..2db20453c 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 5cc476a24..499bbc384 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 1bc35d9f3..30a1e0071 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;
@@ -281,34 +277,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 48fe4dcbc..579350b19 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 c4a6cef77..ec115d7e2 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 e351c502d..09e996878 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 4fea02cb4..fb9ee0df9 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 2dfff1451..d701e0e9e 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 6d734e1b6..dce1f3070 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 df5805f4d..1762f0d1b 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 3da3bc3e1..6402f1b51 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 d79121165..a24b6cccc 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 68a9dc764..93080c746 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 4fb347a93..73a165126 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 4c2263702..606bf7ada 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;
}