[PATCH 10/14] Kill ChangeGC in favor of dixChangeGC.

Jamey Sharp jamey at minilop.net
Sat May 8 16:39:25 PDT 2010


Signed-off-by: Jamey Sharp <jamey at minilop.net>
---
 dix/dixfonts.c               |    8 ++++----
 dix/gc.c                     |   15 +++------------
 dix/window.c                 |    2 +-
 hw/kdrive/ephyr/ephyr_draw.c |    5 ++---
 hw/kdrive/src/kxv.c          |    2 +-
 hw/xfree86/common/xf86xv.c   |    4 ++--
 include/gc.h                 |    5 -----
 mi/midispcur.c               |    6 +++---
 render/mirect.c              |    4 ++--
 9 files changed, 18 insertions(+), 33 deletions(-)

diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index 313d085..d28bc50 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -1261,7 +1261,7 @@ doPolyText(ClientPtr client, PTclosurePtr c)
 	    {
 		if (pFont != c->pGC->font && c->pDraw)
 		{
-		    ChangeGC( c->pGC, GCFont, &fid);
+		    dixChangeGC(NullClient, c->pGC, GCFont, &fid, NULL);
 		    ValidateGC(c->pDraw, c->pGC);
 		    if (c->reqType == X_PolyText8)
 			c->polyText = (PolyTextPtr) c->pGC->ops->PolyText8;
@@ -1404,7 +1404,7 @@ bail:
 	/* Step 4 */
 	if (pFont != origGC->font)
 	{
-	    ChangeGC(origGC, GCFont, &fid);
+	    dixChangeGC(NullClient, origGC, GCFont, &fid, NULL);
 	    ValidateGC(c->pDraw, origGC);
 	}
 
@@ -1423,7 +1423,7 @@ bail:
     if (c->slept)
     {
 	ClientWakeup(c->client);
-	ChangeGC(c->pGC, clearGCmask, clearGC);
+	dixChangeGC(NullClient, c->pGC, clearGCmask, clearGC, NULL);
 
 	/* Unreference the font from the scratch GC */
 	CloseFont(c->pGC->font, (Font)0);
@@ -1580,7 +1580,7 @@ bail:
     if (c->slept)
     {
 	ClientWakeup(c->client);
-	ChangeGC(c->pGC, clearGCmask, clearGC);
+	dixChangeGC(NullClient, c->pGC, clearGCmask, clearGC, NULL);
 
 	/* Unreference the font from the scratch GC */
 	CloseFont(c->pGC->font, (Font)0);
diff --git a/dix/gc.c b/dix/gc.c
index 88e6705..941fbb3 100644
--- a/dix/gc.c
+++ b/dix/gc.c
@@ -516,14 +516,6 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr
 #undef NEXTVAL
 #undef NEXT_PTR
 
-/* Publically defined entry to ChangeGC.  Just calls dixChangeGC and tells
- * it that all of the entries are constants or IDs */
-int
-ChangeGC(GC *pGC, BITS32 mask, XID *pval)
-{
-    return (dixChangeGC(NullClient, pGC, mask, pval, NULL));
-}
-
 /* CreateGC(pDrawable, mask, pval, pStatus)
    creates a default GC for the given drawable, using mask to fill
    in any non-default values.
@@ -607,7 +599,7 @@ CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus,
     if (!(*pGC->pScreen->CreateGC)(pGC))
 	*pStatus = BadAlloc;
     else if (mask)
-        *pStatus = ChangeGC(pGC, mask, pval);
+        *pStatus = dixChangeGC(NullClient, pGC, mask, pval, NULL);
     else
 	*pStatus = Success;
 
@@ -650,8 +642,7 @@ CreateDefaultTile (GCPtr pGC)
     tmpval[0] = GXcopy;
     tmpval[1] = pGC->tile.pixel;
     tmpval[2] = FillSolid;
-    (void)ChangeGC(pgcScratch, GCFunction | GCForeground | GCFillStyle, 
-		   tmpval);
+    (void)dixChangeGC(NullClient, pgcScratch, GCFunction | GCForeground | GCFillStyle, tmpval, NULL);
     ValidateGC((DrawablePtr)pTile, pgcScratch);
     rect.x = 0;
     rect.y = 0;
@@ -990,7 +981,7 @@ CreateDefaultStipple(int screenNum)
 	(*pScreen->DestroyPixmap)(pScreen->PixmapPerDepth[0]);
 	return FALSE;
     }
-    (void)ChangeGC(pgcScratch, GCFunction|GCForeground|GCFillStyle, tmpval);
+    (void)dixChangeGC(NullClient, pgcScratch, GCFunction|GCForeground|GCFillStyle, tmpval, NULL);
     ValidateGC((DrawablePtr)pScreen->PixmapPerDepth[0], pgcScratch);
     rect.x = 0;
     rect.y = 0;
diff --git a/dix/window.c b/dix/window.c
index 02451fc..84c514b 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -328,7 +328,7 @@ MakeRootTile(WindowPtr pWin)
 	attributes[0] = pScreen->whitePixel;
 	attributes[1] = pScreen->blackPixel;
 
-	(void)ChangeGC(pGC, GCForeground | GCBackground, attributes);
+	(void)dixChangeGC(NullClient, pGC, GCForeground | GCBackground, attributes, NULL);
     }
 
    ValidateGC((DrawablePtr)pWin->background.pixmap, pGC);
diff --git a/hw/kdrive/ephyr/ephyr_draw.c b/hw/kdrive/ephyr/ephyr_draw.c
index f9fac80..ffc96e6 100644
--- a/hw/kdrive/ephyr/ephyr_draw.c
+++ b/hw/kdrive/ephyr/ephyr_draw.c
@@ -107,8 +107,7 @@ ephyrPrepareSolid(PixmapPtr pPix, int alu, Pixel pm, Pixel fg)
     tmpval[0] = alu;
     tmpval[1] = pm;
     tmpval[2] = fg;
-    ChangeGC(fakexa->pGC, GCFunction | GCPlaneMask | GCForeground, 
-	     tmpval);
+    dixChangeGC(NullClient, fakexa->pGC, GCFunction | GCPlaneMask | GCForeground, tmpval, NULL);
 
     ValidateGC(&pPix->drawable, fakexa->pGC);
 
@@ -173,7 +172,7 @@ ephyrPrepareCopy(PixmapPtr pSrc, PixmapPtr pDst, int dx, int dy, int alu,
 
     tmpval[0] = alu;
     tmpval[1] = pm;
-    ChangeGC (fakexa->pGC, GCFunction | GCPlaneMask, tmpval);
+    dixChangeGC (NullClient, fakexa->pGC, GCFunction | GCPlaneMask, tmpval, NULL);
 
     ValidateGC(&pDst->drawable, fakexa->pGC);
 
diff --git a/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c
index 27ecc5d..4506c54 100644
--- a/hw/kdrive/src/kxv.c
+++ b/hw/kdrive/src/kxv.c
@@ -1892,7 +1892,7 @@ KXVPaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg)
 
     val[0] = fg;
     val[1] = IncludeInferiors;
-    ChangeGC (pGC, GCForeground|GCSubwindowMode, val);
+    dixChangeGC (NullClient, pGC, GCForeground|GCSubwindowMode, val, NULL);
 
     ValidateGC (pDraw, pGC);
 
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index 2cc2f60..6387184 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -1855,7 +1855,7 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes)
        if (pPriv) pPriv->pGC = pGC;
    } else if (key != pGC->fgPixel){
        pval[0] = key;
-       ChangeGC(pGC, GCForeground, pval);
+       dixChangeGC(NullClient, pGC, GCForeground, pval, NULL);
        ValidateGC(pDraw, pGC);
    }
 
@@ -1892,7 +1892,7 @@ xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
    gc = GetScratchGC(root->depth, pScreen);
    pval[0] = key;
    pval[1] = IncludeInferiors;
-   (void) ChangeGC(gc, GCForeground|GCSubwindowMode, pval);
+   (void) dixChangeGC(NullClient, gc, GCForeground|GCSubwindowMode, pval, NULL);
    ValidateGC(root, gc);
 
    rects = xalloc (nbox * sizeof(xRectangle));
diff --git a/include/gc.h b/include/gc.h
index 7f481c3..3fa953d 100644
--- a/include/gc.h
+++ b/include/gc.h
@@ -88,11 +88,6 @@ extern _X_EXPORT void ValidateGC(
     DrawablePtr /*pDraw*/,
     GCPtr /*pGC*/);
 
-extern _X_EXPORT int ChangeGC(
-    GCPtr/*pGC*/,
-    BITS32 /*mask*/,
-    XID* /*pval*/);
-
 typedef union {
     CARD32 val;
     pointer ptr;
diff --git a/mi/midispcur.c b/mi/midispcur.c
index dcdca39..73f39c2 100644
--- a/mi/midispcur.c
+++ b/mi/midispcur.c
@@ -306,7 +306,7 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
 			   0, 0, pCursor->bits->width, pCursor->bits->height,
  			   0, XYPixmap, (char *)pCursor->bits->source);
     gcvals[0] = GXand;
-    ChangeGC (pGC, GCFunction, gcvals);
+    dixChangeGC (NullClient, pGC, GCFunction, gcvals, NULL);
     ValidateGC ((DrawablePtr)pPriv->sourceBits, pGC);
     (*pGC->ops->PutImage) ((DrawablePtr)pPriv->sourceBits, pGC, 1,
 			   0, 0, pCursor->bits->width, pCursor->bits->height,
@@ -314,13 +314,13 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
 
     /* mask bits -- pCursor->mask & ~pCursor->source */
     gcvals[0] = GXcopy;
-    ChangeGC (pGC, GCFunction, gcvals);
+    dixChangeGC (NullClient, pGC, GCFunction, gcvals, NULL);
     ValidateGC ((DrawablePtr)pPriv->maskBits, pGC);
     (*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1,
 			   0, 0, pCursor->bits->width, pCursor->bits->height,
  			   0, XYPixmap, (char *)pCursor->bits->mask);
     gcvals[0] = GXandInverted;
-    ChangeGC (pGC, GCFunction, gcvals);
+    dixChangeGC (NullClient, pGC, GCFunction, gcvals, NULL);
     ValidateGC ((DrawablePtr)pPriv->maskBits, pGC);
     (*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1,
 			   0, 0, pCursor->bits->width, pCursor->bits->height,
diff --git a/render/mirect.c b/render/mirect.c
index b54fe6f..0030eff 100644
--- a/render/mirect.c
+++ b/render/mirect.c
@@ -70,7 +70,7 @@ miColorRects (PicturePtr    pDst,
 	(*pGC->funcs->ChangeClip) (pGC, CT_REGION, pClip, 0);
     }
 
-    ChangeGC (pGC, mask, tmpval);
+    dixChangeGC (NullClient, pGC, mask, tmpval, NULL);
     ValidateGC (pDst->pDrawable, pGC);
     if (xoff || yoff)
     {
@@ -148,7 +148,7 @@ miCompositeRects (CARD8		op,
 	tmpval[0] = GXcopy;
 	tmpval[1] = pixel;
 
-	ChangeGC (pGC, GCFunction | GCForeground, tmpval);
+	dixChangeGC (NullClient, pGC, GCFunction | GCForeground, tmpval, NULL);
 	ValidateGC (&pPixmap->drawable, pGC);
 	one.x = 0;
 	one.y = 0;
-- 
1.7.0



More information about the xorg-devel mailing list