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>
This commit is contained in:
parent
65cedf3905
commit
04bad1b8a1
|
@ -1261,7 +1261,7 @@ doPolyText(ClientPtr client, PTclosurePtr c)
|
||||||
{
|
{
|
||||||
if (pFont != c->pGC->font && c->pDraw)
|
if (pFont != c->pGC->font && c->pDraw)
|
||||||
{
|
{
|
||||||
ChangeGC( c->pGC, GCFont, &fid);
|
dixChangeGC(NullClient, c->pGC, GCFont, &fid, NULL);
|
||||||
ValidateGC(c->pDraw, c->pGC);
|
ValidateGC(c->pDraw, c->pGC);
|
||||||
if (c->reqType == X_PolyText8)
|
if (c->reqType == X_PolyText8)
|
||||||
c->polyText = (PolyTextPtr) c->pGC->ops->PolyText8;
|
c->polyText = (PolyTextPtr) c->pGC->ops->PolyText8;
|
||||||
|
@ -1404,7 +1404,7 @@ bail:
|
||||||
/* Step 4 */
|
/* Step 4 */
|
||||||
if (pFont != origGC->font)
|
if (pFont != origGC->font)
|
||||||
{
|
{
|
||||||
ChangeGC(origGC, GCFont, &fid);
|
dixChangeGC(NullClient, origGC, GCFont, &fid, NULL);
|
||||||
ValidateGC(c->pDraw, origGC);
|
ValidateGC(c->pDraw, origGC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1423,7 +1423,7 @@ bail:
|
||||||
if (c->slept)
|
if (c->slept)
|
||||||
{
|
{
|
||||||
ClientWakeup(c->client);
|
ClientWakeup(c->client);
|
||||||
ChangeGC(c->pGC, clearGCmask, clearGC);
|
dixChangeGC(NullClient, c->pGC, clearGCmask, clearGC, NULL);
|
||||||
|
|
||||||
/* Unreference the font from the scratch GC */
|
/* Unreference the font from the scratch GC */
|
||||||
CloseFont(c->pGC->font, (Font)0);
|
CloseFont(c->pGC->font, (Font)0);
|
||||||
|
@ -1580,7 +1580,7 @@ bail:
|
||||||
if (c->slept)
|
if (c->slept)
|
||||||
{
|
{
|
||||||
ClientWakeup(c->client);
|
ClientWakeup(c->client);
|
||||||
ChangeGC(c->pGC, clearGCmask, clearGC);
|
dixChangeGC(NullClient, c->pGC, clearGCmask, clearGC, NULL);
|
||||||
|
|
||||||
/* Unreference the font from the scratch GC */
|
/* Unreference the font from the scratch GC */
|
||||||
CloseFont(c->pGC->font, (Font)0);
|
CloseFont(c->pGC->font, (Font)0);
|
||||||
|
|
15
dix/gc.c
15
dix/gc.c
|
@ -491,14 +491,6 @@ dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr
|
||||||
#undef NEXTVAL
|
#undef NEXTVAL
|
||||||
#undef NEXT_PTR
|
#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)
|
/* CreateGC(pDrawable, mask, pval, pStatus)
|
||||||
creates a default GC for the given drawable, using mask to fill
|
creates a default GC for the given drawable, using mask to fill
|
||||||
in any non-default values.
|
in any non-default values.
|
||||||
|
@ -582,7 +574,7 @@ CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus,
|
||||||
if (!(*pGC->pScreen->CreateGC)(pGC))
|
if (!(*pGC->pScreen->CreateGC)(pGC))
|
||||||
*pStatus = BadAlloc;
|
*pStatus = BadAlloc;
|
||||||
else if (mask)
|
else if (mask)
|
||||||
*pStatus = ChangeGC(pGC, mask, pval);
|
*pStatus = dixChangeGC(NullClient, pGC, mask, pval, NULL);
|
||||||
else
|
else
|
||||||
*pStatus = Success;
|
*pStatus = Success;
|
||||||
|
|
||||||
|
@ -625,8 +617,7 @@ CreateDefaultTile (GCPtr pGC)
|
||||||
tmpval[0] = GXcopy;
|
tmpval[0] = GXcopy;
|
||||||
tmpval[1] = pGC->tile.pixel;
|
tmpval[1] = pGC->tile.pixel;
|
||||||
tmpval[2] = FillSolid;
|
tmpval[2] = FillSolid;
|
||||||
(void)ChangeGC(pgcScratch, GCFunction | GCForeground | GCFillStyle,
|
(void)dixChangeGC(NullClient, pgcScratch, GCFunction | GCForeground | GCFillStyle, tmpval, NULL);
|
||||||
tmpval);
|
|
||||||
ValidateGC((DrawablePtr)pTile, pgcScratch);
|
ValidateGC((DrawablePtr)pTile, pgcScratch);
|
||||||
rect.x = 0;
|
rect.x = 0;
|
||||||
rect.y = 0;
|
rect.y = 0;
|
||||||
|
@ -965,7 +956,7 @@ CreateDefaultStipple(int screenNum)
|
||||||
(*pScreen->DestroyPixmap)(pScreen->PixmapPerDepth[0]);
|
(*pScreen->DestroyPixmap)(pScreen->PixmapPerDepth[0]);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
(void)ChangeGC(pgcScratch, GCFunction|GCForeground|GCFillStyle, tmpval);
|
(void)dixChangeGC(NullClient, pgcScratch, GCFunction|GCForeground|GCFillStyle, tmpval, NULL);
|
||||||
ValidateGC((DrawablePtr)pScreen->PixmapPerDepth[0], pgcScratch);
|
ValidateGC((DrawablePtr)pScreen->PixmapPerDepth[0], pgcScratch);
|
||||||
rect.x = 0;
|
rect.x = 0;
|
||||||
rect.y = 0;
|
rect.y = 0;
|
||||||
|
|
|
@ -328,7 +328,7 @@ MakeRootTile(WindowPtr pWin)
|
||||||
attributes[0] = pScreen->whitePixel;
|
attributes[0] = pScreen->whitePixel;
|
||||||
attributes[1] = pScreen->blackPixel;
|
attributes[1] = pScreen->blackPixel;
|
||||||
|
|
||||||
(void)ChangeGC(pGC, GCForeground | GCBackground, attributes);
|
(void)dixChangeGC(NullClient, pGC, GCForeground | GCBackground, attributes, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
ValidateGC((DrawablePtr)pWin->background.pixmap, pGC);
|
ValidateGC((DrawablePtr)pWin->background.pixmap, pGC);
|
||||||
|
|
|
@ -107,8 +107,7 @@ ephyrPrepareSolid(PixmapPtr pPix, int alu, Pixel pm, Pixel fg)
|
||||||
tmpval[0] = alu;
|
tmpval[0] = alu;
|
||||||
tmpval[1] = pm;
|
tmpval[1] = pm;
|
||||||
tmpval[2] = fg;
|
tmpval[2] = fg;
|
||||||
ChangeGC(fakexa->pGC, GCFunction | GCPlaneMask | GCForeground,
|
dixChangeGC(NullClient, fakexa->pGC, GCFunction | GCPlaneMask | GCForeground, tmpval, NULL);
|
||||||
tmpval);
|
|
||||||
|
|
||||||
ValidateGC(&pPix->drawable, fakexa->pGC);
|
ValidateGC(&pPix->drawable, fakexa->pGC);
|
||||||
|
|
||||||
|
@ -173,7 +172,7 @@ ephyrPrepareCopy(PixmapPtr pSrc, PixmapPtr pDst, int dx, int dy, int alu,
|
||||||
|
|
||||||
tmpval[0] = alu;
|
tmpval[0] = alu;
|
||||||
tmpval[1] = pm;
|
tmpval[1] = pm;
|
||||||
ChangeGC (fakexa->pGC, GCFunction | GCPlaneMask, tmpval);
|
dixChangeGC (NullClient, fakexa->pGC, GCFunction | GCPlaneMask, tmpval, NULL);
|
||||||
|
|
||||||
ValidateGC(&pDst->drawable, fakexa->pGC);
|
ValidateGC(&pDst->drawable, fakexa->pGC);
|
||||||
|
|
||||||
|
|
|
@ -1892,7 +1892,7 @@ KXVPaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg)
|
||||||
|
|
||||||
val[0] = fg;
|
val[0] = fg;
|
||||||
val[1] = IncludeInferiors;
|
val[1] = IncludeInferiors;
|
||||||
ChangeGC (pGC, GCForeground|GCSubwindowMode, val);
|
dixChangeGC (NullClient, pGC, GCForeground|GCSubwindowMode, val, NULL);
|
||||||
|
|
||||||
ValidateGC (pDraw, pGC);
|
ValidateGC (pDraw, pGC);
|
||||||
|
|
||||||
|
|
|
@ -1855,7 +1855,7 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes)
|
||||||
if (pPriv) pPriv->pGC = pGC;
|
if (pPriv) pPriv->pGC = pGC;
|
||||||
} else if (key != pGC->fgPixel){
|
} else if (key != pGC->fgPixel){
|
||||||
pval[0] = key;
|
pval[0] = key;
|
||||||
ChangeGC(pGC, GCForeground, pval);
|
dixChangeGC(NullClient, pGC, GCForeground, pval, NULL);
|
||||||
ValidateGC(pDraw, pGC);
|
ValidateGC(pDraw, pGC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1892,7 +1892,7 @@ xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
|
||||||
gc = GetScratchGC(root->depth, pScreen);
|
gc = GetScratchGC(root->depth, pScreen);
|
||||||
pval[0] = key;
|
pval[0] = key;
|
||||||
pval[1] = IncludeInferiors;
|
pval[1] = IncludeInferiors;
|
||||||
(void) ChangeGC(gc, GCForeground|GCSubwindowMode, pval);
|
(void) dixChangeGC(NullClient, gc, GCForeground|GCSubwindowMode, pval, NULL);
|
||||||
ValidateGC(root, gc);
|
ValidateGC(root, gc);
|
||||||
|
|
||||||
rects = malloc(nbox * sizeof(xRectangle));
|
rects = malloc(nbox * sizeof(xRectangle));
|
||||||
|
|
|
@ -88,11 +88,6 @@ extern _X_EXPORT void ValidateGC(
|
||||||
DrawablePtr /*pDraw*/,
|
DrawablePtr /*pDraw*/,
|
||||||
GCPtr /*pGC*/);
|
GCPtr /*pGC*/);
|
||||||
|
|
||||||
extern _X_EXPORT int ChangeGC(
|
|
||||||
GCPtr/*pGC*/,
|
|
||||||
BITS32 /*mask*/,
|
|
||||||
XID* /*pval*/);
|
|
||||||
|
|
||||||
typedef union {
|
typedef union {
|
||||||
CARD32 val;
|
CARD32 val;
|
||||||
pointer ptr;
|
pointer ptr;
|
||||||
|
|
|
@ -306,7 +306,7 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
|
||||||
0, 0, pCursor->bits->width, pCursor->bits->height,
|
0, 0, pCursor->bits->width, pCursor->bits->height,
|
||||||
0, XYPixmap, (char *)pCursor->bits->source);
|
0, XYPixmap, (char *)pCursor->bits->source);
|
||||||
gcvals[0] = GXand;
|
gcvals[0] = GXand;
|
||||||
ChangeGC (pGC, GCFunction, gcvals);
|
dixChangeGC (NullClient, pGC, GCFunction, gcvals, NULL);
|
||||||
ValidateGC ((DrawablePtr)pPriv->sourceBits, pGC);
|
ValidateGC ((DrawablePtr)pPriv->sourceBits, pGC);
|
||||||
(*pGC->ops->PutImage) ((DrawablePtr)pPriv->sourceBits, pGC, 1,
|
(*pGC->ops->PutImage) ((DrawablePtr)pPriv->sourceBits, pGC, 1,
|
||||||
0, 0, pCursor->bits->width, pCursor->bits->height,
|
0, 0, pCursor->bits->width, pCursor->bits->height,
|
||||||
|
@ -314,13 +314,13 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
|
||||||
|
|
||||||
/* mask bits -- pCursor->mask & ~pCursor->source */
|
/* mask bits -- pCursor->mask & ~pCursor->source */
|
||||||
gcvals[0] = GXcopy;
|
gcvals[0] = GXcopy;
|
||||||
ChangeGC (pGC, GCFunction, gcvals);
|
dixChangeGC (NullClient, pGC, GCFunction, gcvals, NULL);
|
||||||
ValidateGC ((DrawablePtr)pPriv->maskBits, pGC);
|
ValidateGC ((DrawablePtr)pPriv->maskBits, pGC);
|
||||||
(*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1,
|
(*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1,
|
||||||
0, 0, pCursor->bits->width, pCursor->bits->height,
|
0, 0, pCursor->bits->width, pCursor->bits->height,
|
||||||
0, XYPixmap, (char *)pCursor->bits->mask);
|
0, XYPixmap, (char *)pCursor->bits->mask);
|
||||||
gcvals[0] = GXandInverted;
|
gcvals[0] = GXandInverted;
|
||||||
ChangeGC (pGC, GCFunction, gcvals);
|
dixChangeGC (NullClient, pGC, GCFunction, gcvals, NULL);
|
||||||
ValidateGC ((DrawablePtr)pPriv->maskBits, pGC);
|
ValidateGC ((DrawablePtr)pPriv->maskBits, pGC);
|
||||||
(*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1,
|
(*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1,
|
||||||
0, 0, pCursor->bits->width, pCursor->bits->height,
|
0, 0, pCursor->bits->width, pCursor->bits->height,
|
||||||
|
|
|
@ -70,7 +70,7 @@ miColorRects (PicturePtr pDst,
|
||||||
(*pGC->funcs->ChangeClip) (pGC, CT_REGION, pClip, 0);
|
(*pGC->funcs->ChangeClip) (pGC, CT_REGION, pClip, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
ChangeGC (pGC, mask, tmpval);
|
dixChangeGC (NullClient, pGC, mask, tmpval, NULL);
|
||||||
ValidateGC (pDst->pDrawable, pGC);
|
ValidateGC (pDst->pDrawable, pGC);
|
||||||
if (xoff || yoff)
|
if (xoff || yoff)
|
||||||
{
|
{
|
||||||
|
@ -148,7 +148,7 @@ miCompositeRects (CARD8 op,
|
||||||
tmpval[0] = GXcopy;
|
tmpval[0] = GXcopy;
|
||||||
tmpval[1] = pixel;
|
tmpval[1] = pixel;
|
||||||
|
|
||||||
ChangeGC (pGC, GCFunction | GCForeground, tmpval);
|
dixChangeGC (NullClient, pGC, GCFunction | GCForeground, tmpval, NULL);
|
||||||
ValidateGC (&pPixmap->drawable, pGC);
|
ValidateGC (&pPixmap->drawable, pGC);
|
||||||
one.x = 0;
|
one.x = 0;
|
||||||
one.y = 0;
|
one.y = 0;
|
||||||
|
|
Loading…
Reference in New Issue