diff options
author | Jamey Sharp <jamey@minilop.net> | 2010-05-06 21:56:10 -0700 |
---|---|---|
committer | Jamey Sharp <jamey@minilop.net> | 2010-05-12 18:10:01 -0700 |
commit | 04bad1b8a118a83064316d6e4327234aee19361e (patch) | |
tree | db53939c7cf34aa3eb3b31e6af7d32c0b31af64c | |
parent | 65cedf39054cf3a1e695e84ac228cce9e8d48097 (diff) |
Kill ChangeGC in favor of dixChangeGC.
This doesn't change any behavior, but it isn't clear whether NullClient
is correct in all cases. As ajax says,
> For most of these changes, I think it's correct to use NullClient,
> since they are server-initiated changes and should not fail for (eg)
> xace reasons. ... At any rate, you're certainly not changing any
> semantics by leaving them all as NullClient, so this patch can't be
> more wrong than before.
The call in CreateGC is particularly questionable.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
-rw-r--r-- | dix/dixfonts.c | 8 | ||||
-rw-r--r-- | dix/gc.c | 15 | ||||
-rw-r--r-- | dix/window.c | 2 | ||||
-rw-r--r-- | hw/kdrive/ephyr/ephyr_draw.c | 5 | ||||
-rw-r--r-- | hw/kdrive/src/kxv.c | 2 | ||||
-rw-r--r-- | hw/xfree86/common/xf86xv.c | 4 | ||||
-rw-r--r-- | include/gc.h | 5 | ||||
-rw-r--r-- | mi/midispcur.c | 6 | ||||
-rw-r--r-- | render/mirect.c | 4 |
9 files changed, 18 insertions, 33 deletions
diff --git a/dix/dixfonts.c b/dix/dixfonts.c index 378c38033..332fb9728 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); @@ -491,14 +491,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. @@ -582,7 +574,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; @@ -625,8 +617,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; @@ -965,7 +956,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 0d0321992..313593b47 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 f25a9b43b..672e0e4ea 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 56f101f65..bf6600a09 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 99d1fdf73..e2d9c1541 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 = malloc(nbox * sizeof(xRectangle)); diff --git a/include/gc.h b/include/gc.h index 7f481c359..3fa953d56 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 a107949e9..11547dbd9 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 b54fe6fe6..0030eff62 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; |