dixChangeGC callers: Use ChangeGCVal instead of XID almost everywhere.

The exceptions are ProcChangeGC and CreateGC.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Jamey Sharp 2010-05-08 14:10:51 -07:00
parent 95728ca09d
commit e2929db7b7
22 changed files with 181 additions and 164 deletions

View File

@ -497,10 +497,11 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h)
*/ */
if (pGC) if (pGC)
{ {
XID val = IncludeInferiors; ChangeGCVal val;
val.val = IncludeInferiors;
ValidateGC(&pPixmap->drawable, pGC); ValidateGC(&pPixmap->drawable, pGC);
dixChangeGC (serverClient, pGC, GCSubwindowMode, &val, NULL); dixChangeGC (serverClient, pGC, GCSubwindowMode, NULL, &val);
(*pGC->ops->CopyArea) (&pParent->drawable, (*pGC->ops->CopyArea) (&pParent->drawable,
&pPixmap->drawable, &pPixmap->drawable,
pGC, pGC,

View File

@ -1166,7 +1166,7 @@ badAlloc:
#define TextEltHeader 2 #define TextEltHeader 2
#define FontShiftSize 5 #define FontShiftSize 5
static XID clearGC[] = { CT_NONE }; static ChangeGCVal clearGC[] = { { .ptr = NullPixmap } };
#define clearGCmask (GCClipMask) #define clearGCmask (GCClipMask)
int int
@ -1261,7 +1261,9 @@ doPolyText(ClientPtr client, PTclosurePtr c)
{ {
if (pFont != c->pGC->font && c->pDraw) if (pFont != c->pGC->font && c->pDraw)
{ {
dixChangeGC(NullClient, c->pGC, GCFont, &fid, NULL); ChangeGCVal val;
val.ptr = pFont;
dixChangeGC(NullClient, c->pGC, GCFont, NULL, &val);
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 +1406,9 @@ bail:
/* Step 4 */ /* Step 4 */
if (pFont != origGC->font) if (pFont != origGC->font)
{ {
dixChangeGC(NullClient, origGC, GCFont, &fid, NULL); ChangeGCVal val;
val.ptr = pFont;
dixChangeGC(NullClient, origGC, GCFont, NULL, &val);
ValidateGC(c->pDraw, origGC); ValidateGC(c->pDraw, origGC);
} }
@ -1423,7 +1427,7 @@ bail:
if (c->slept) if (c->slept)
{ {
ClientWakeup(c->client); ClientWakeup(c->client);
dixChangeGC(NullClient, c->pGC, clearGCmask, clearGC, NULL); dixChangeGC(NullClient, c->pGC, clearGCmask, NULL, clearGC);
/* 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 +1584,7 @@ bail:
if (c->slept) if (c->slept)
{ {
ClientWakeup(c->client); ClientWakeup(c->client);
dixChangeGC(NullClient, c->pGC, clearGCmask, clearGC, NULL); dixChangeGC(NullClient, c->pGC, clearGCmask, NULL, clearGC);
/* 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);

View File

@ -593,7 +593,7 @@ out:
static Bool static Bool
CreateDefaultTile (GCPtr pGC) CreateDefaultTile (GCPtr pGC)
{ {
XID tmpval[3]; ChangeGCVal tmpval[3];
PixmapPtr pTile; PixmapPtr pTile;
GCPtr pgcScratch; GCPtr pgcScratch;
xRectangle rect; xRectangle rect;
@ -614,10 +614,10 @@ CreateDefaultTile (GCPtr pGC)
FreeScratchGC(pgcScratch); FreeScratchGC(pgcScratch);
return FALSE; return FALSE;
} }
tmpval[0] = GXcopy; tmpval[0].val = GXcopy;
tmpval[1] = pGC->tile.pixel; tmpval[1].val = pGC->tile.pixel;
tmpval[2] = FillSolid; tmpval[2].val = FillSolid;
(void)dixChangeGC(NullClient, pgcScratch, GCFunction | GCForeground | GCFillStyle, tmpval, NULL); (void)dixChangeGC(NullClient, pgcScratch, GCFunction | GCForeground | GCFillStyle, NULL, tmpval);
ValidateGC((DrawablePtr)pTile, pgcScratch); ValidateGC((DrawablePtr)pTile, pgcScratch);
rect.x = 0; rect.x = 0;
rect.y = 0; rect.y = 0;
@ -935,7 +935,7 @@ Bool
CreateDefaultStipple(int screenNum) CreateDefaultStipple(int screenNum)
{ {
ScreenPtr pScreen; ScreenPtr pScreen;
XID tmpval[3]; ChangeGCVal tmpval[3];
xRectangle rect; xRectangle rect;
CARD16 w, h; CARD16 w, h;
GCPtr pgcScratch; GCPtr pgcScratch;
@ -949,14 +949,16 @@ CreateDefaultStipple(int screenNum)
(*pScreen->CreatePixmap)(pScreen, w, h, 1, 0))) (*pScreen->CreatePixmap)(pScreen, w, h, 1, 0)))
return FALSE; return FALSE;
/* fill stipple with 1 */ /* fill stipple with 1 */
tmpval[0] = GXcopy; tmpval[1] = 1; tmpval[2] = FillSolid; tmpval[0].val = GXcopy;
tmpval[1].val = 1;
tmpval[2].val = FillSolid;
pgcScratch = GetScratchGC(1, pScreen); pgcScratch = GetScratchGC(1, pScreen);
if (!pgcScratch) if (!pgcScratch)
{ {
(*pScreen->DestroyPixmap)(pScreen->PixmapPerDepth[0]); (*pScreen->DestroyPixmap)(pScreen->PixmapPerDepth[0]);
return FALSE; return FALSE;
} }
(void)dixChangeGC(NullClient, pgcScratch, GCFunction|GCForeground|GCFillStyle, tmpval, NULL); (void)dixChangeGC(NullClient, pgcScratch, GCFunction|GCForeground|GCFillStyle, NULL, tmpval);
ValidateGC((DrawablePtr)pScreen->PixmapPerDepth[0], pgcScratch); ValidateGC((DrawablePtr)pScreen->PixmapPerDepth[0], pgcScratch);
rect.x = 0; rect.x = 0;
rect.y = 0; rect.y = 0;

View File

@ -323,12 +323,12 @@ MakeRootTile(WindowPtr pWin)
FatalError("could not create root tile"); FatalError("could not create root tile");
{ {
CARD32 attributes[2]; ChangeGCVal attributes[2];
attributes[0] = pScreen->whitePixel; attributes[0].val = pScreen->whitePixel;
attributes[1] = pScreen->blackPixel; attributes[1].val = pScreen->blackPixel;
(void)dixChangeGC(NullClient, pGC, GCForeground | GCBackground, attributes, NULL); (void)dixChangeGC(NullClient, pGC, GCForeground | GCBackground, NULL, attributes);
} }
ValidateGC((DrawablePtr)pWin->background.pixmap, pGC); ValidateGC((DrawablePtr)pWin->background.pixmap, pGC);

View File

@ -250,7 +250,9 @@ fbSetFg (DrawablePtr pDrawable,
{ {
if (fg != pGC->fgPixel) if (fg != pGC->fgPixel)
{ {
dixChangeGC (NullClient, pGC, GCForeground, &fg, NULL); ChangeGCVal val;
val.val = fg;
dixChangeGC (NullClient, pGC, GCForeground, NULL, &val);
ValidateGC (pDrawable, pGC); ValidateGC (pDrawable, pGC);
} }
} }

View File

@ -292,14 +292,6 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
return &context->base; return &context->base;
} }
static void
glxChangeGC(GCPtr gc, BITS32 mask, CARD32 val)
{
CARD32 v[1];
v[0] = val;
dixChangeGC(NullClient, gc, mask, v, NULL);
}
static __GLXdrawable * static __GLXdrawable *
__glXDRIscreenCreateDrawable(ClientPtr client, __glXDRIscreenCreateDrawable(ClientPtr client,
__GLXscreen *screen, __GLXscreen *screen,
@ -309,6 +301,7 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
XID glxDrawId, XID glxDrawId,
__GLXconfig *glxConfig) __GLXconfig *glxConfig)
{ {
ChangeGCVal gcvals[2];
__GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen; __GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen;
__GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig; __GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
__GLXDRIdrawable *private; __GLXDRIdrawable *private;
@ -333,9 +326,10 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
private->gc = CreateScratchGC(pScreen, pDraw->depth); private->gc = CreateScratchGC(pScreen, pDraw->depth);
private->swapgc = CreateScratchGC(pScreen, pDraw->depth); private->swapgc = CreateScratchGC(pScreen, pDraw->depth);
glxChangeGC(private->gc, GCFunction, GXcopy); gcvals[0].val = GXcopy;
glxChangeGC(private->swapgc, GCFunction, GXcopy); dixChangeGC(NullClient, private->gc, GCFunction, NULL, gcvals);
glxChangeGC(private->swapgc, GCGraphicsExposures, FALSE); gcvals[1].val = FALSE;
dixChangeGC(NullClient, private->gc, GCFunction | GCGraphicsExposures, NULL, gcvals);
private->driDrawable = private->driDrawable =
(*driScreen->swrast->createNewDrawable)(driScreen->driScreen, (*driScreen->swrast->createNewDrawable)(driScreen->driScreen,

View File

@ -97,17 +97,17 @@ ephyrPrepareSolid(PixmapPtr pPix, int alu, Pixel pm, Pixel fg)
KdScreenInfo *screen = pScreenPriv->screen; KdScreenInfo *screen = pScreenPriv->screen;
EphyrScrPriv *scrpriv = screen->driver; EphyrScrPriv *scrpriv = screen->driver;
EphyrFakexaPriv *fakexa = scrpriv->fakexa; EphyrFakexaPriv *fakexa = scrpriv->fakexa;
CARD32 tmpval[3]; ChangeGCVal tmpval[3];
ephyrPreparePipelinedAccess(pPix, EXA_PREPARE_DEST); ephyrPreparePipelinedAccess(pPix, EXA_PREPARE_DEST);
fakexa->pDst = pPix; fakexa->pDst = pPix;
fakexa->pGC = GetScratchGC(pPix->drawable.depth, pScreen); fakexa->pGC = GetScratchGC(pPix->drawable.depth, pScreen);
tmpval[0] = alu; tmpval[0].val = alu;
tmpval[1] = pm; tmpval[1].val = pm;
tmpval[2] = fg; tmpval[2].val = fg;
dixChangeGC(NullClient, fakexa->pGC, GCFunction | GCPlaneMask | GCForeground, tmpval, NULL); dixChangeGC(NullClient, fakexa->pGC, GCFunction | GCPlaneMask | GCForeground, NULL, tmpval);
ValidateGC(&pPix->drawable, fakexa->pGC); ValidateGC(&pPix->drawable, fakexa->pGC);
@ -161,7 +161,7 @@ ephyrPrepareCopy(PixmapPtr pSrc, PixmapPtr pDst, int dx, int dy, int alu,
KdScreenInfo *screen = pScreenPriv->screen; KdScreenInfo *screen = pScreenPriv->screen;
EphyrScrPriv *scrpriv = screen->driver; EphyrScrPriv *scrpriv = screen->driver;
EphyrFakexaPriv *fakexa = scrpriv->fakexa; EphyrFakexaPriv *fakexa = scrpriv->fakexa;
CARD32 tmpval[2]; ChangeGCVal tmpval[2];
ephyrPreparePipelinedAccess(pDst, EXA_PREPARE_DEST); ephyrPreparePipelinedAccess(pDst, EXA_PREPARE_DEST);
ephyrPreparePipelinedAccess(pSrc, EXA_PREPARE_SRC); ephyrPreparePipelinedAccess(pSrc, EXA_PREPARE_SRC);
@ -170,9 +170,9 @@ ephyrPrepareCopy(PixmapPtr pSrc, PixmapPtr pDst, int dx, int dy, int alu,
fakexa->pDst = pDst; fakexa->pDst = pDst;
fakexa->pGC = GetScratchGC(pDst->drawable.depth, pScreen); fakexa->pGC = GetScratchGC(pDst->drawable.depth, pScreen);
tmpval[0] = alu; tmpval[0].val = alu;
tmpval[1] = pm; tmpval[1].val = pm;
dixChangeGC (NullClient, fakexa->pGC, GCFunction | GCPlaneMask, tmpval, NULL); dixChangeGC (NullClient, fakexa->pGC, GCFunction | GCPlaneMask, NULL, tmpval);
ValidateGC(&pDst->drawable, fakexa->pGC); ValidateGC(&pDst->drawable, fakexa->pGC);

View File

@ -1867,7 +1867,7 @@ void
KXVPaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg) KXVPaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg)
{ {
GCPtr pGC; GCPtr pGC;
CARD32 val[2]; ChangeGCVal val[2];
xRectangle *rects, *r; xRectangle *rects, *r;
BoxPtr pBox = REGION_RECTS (pRgn); BoxPtr pBox = REGION_RECTS (pRgn);
int nBox = REGION_NUM_RECTS (pRgn); int nBox = REGION_NUM_RECTS (pRgn);
@ -1890,9 +1890,9 @@ KXVPaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg)
if (!pGC) if (!pGC)
goto bail1; goto bail1;
val[0] = fg; val[0].val = fg;
val[1] = IncludeInferiors; val[1].val = IncludeInferiors;
dixChangeGC (NullClient, pGC, GCForeground|GCSubwindowMode, val, NULL); dixChangeGC (NullClient, pGC, GCForeground|GCSubwindowMode, NULL, val);
ValidateGC (pDraw, pGC); ValidateGC (pDraw, pGC);

View File

@ -1834,7 +1834,6 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes)
WindowPtr pWin = (WindowPtr)pDraw; WindowPtr pWin = (WindowPtr)pDraw;
XF86XVWindowPtr pPriv = GET_XF86XV_WINDOW(pWin); XF86XVWindowPtr pPriv = GET_XF86XV_WINDOW(pWin);
GCPtr pGC = NULL; GCPtr pGC = NULL;
XID pval[2];
BoxPtr pbox = REGION_RECTS(clipboxes); BoxPtr pbox = REGION_RECTS(clipboxes);
int i, nbox = REGION_NUM_RECTS(clipboxes); int i, nbox = REGION_NUM_RECTS(clipboxes);
xRectangle *rects; xRectangle *rects;
@ -1846,6 +1845,7 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes)
if(!pGC) { if(!pGC) {
int status; int status;
XID pval[2];
pval[0] = key; pval[0] = key;
pval[1] = IncludeInferiors; pval[1] = IncludeInferiors;
pGC = CreateGC(pDraw, GCForeground | GCSubwindowMode, pval, &status, pGC = CreateGC(pDraw, GCForeground | GCSubwindowMode, pval, &status,
@ -1854,8 +1854,9 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes)
ValidateGC(pDraw, pGC); ValidateGC(pDraw, pGC);
if (pPriv) pPriv->pGC = pGC; if (pPriv) pPriv->pGC = pGC;
} else if (key != pGC->fgPixel){ } else if (key != pGC->fgPixel){
pval[0] = key; ChangeGCVal val;
dixChangeGC(NullClient, pGC, GCForeground, pval, NULL); val.val = key;
dixChangeGC(NullClient, pGC, GCForeground, NULL, &val);
ValidateGC(pDraw, pGC); ValidateGC(pDraw, pGC);
} }
@ -1881,7 +1882,7 @@ void
xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes) xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
{ {
DrawablePtr root = &WindowTable[pScreen->myNum]->drawable; DrawablePtr root = &WindowTable[pScreen->myNum]->drawable;
XID pval[2]; ChangeGCVal pval[2];
BoxPtr pbox = REGION_RECTS(clipboxes); BoxPtr pbox = REGION_RECTS(clipboxes);
int i, nbox = REGION_NUM_RECTS(clipboxes); int i, nbox = REGION_NUM_RECTS(clipboxes);
xRectangle *rects; xRectangle *rects;
@ -1890,9 +1891,9 @@ xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
if(!xf86Screens[pScreen->myNum]->vtSema) return; if(!xf86Screens[pScreen->myNum]->vtSema) return;
gc = GetScratchGC(root->depth, pScreen); gc = GetScratchGC(root->depth, pScreen);
pval[0] = key; pval[0].val = key;
pval[1] = IncludeInferiors; pval[1].val = IncludeInferiors;
(void) dixChangeGC(NullClient, gc, GCForeground|GCSubwindowMode, pval, NULL); (void) dixChangeGC(NullClient, gc, GCForeground|GCSubwindowMode, NULL, pval);
ValidateGC(root, gc); ValidateGC(root, gc);
rects = malloc(nbox * sizeof(xRectangle)); rects = malloc(nbox * sizeof(xRectangle));

View File

@ -1867,7 +1867,7 @@ XAAWriteBitmapToCacheLinear(
){ ){
ScreenPtr pScreen = pScrn->pScreen; ScreenPtr pScreen = pScrn->pScreen;
PixmapPtr pScreenPix, pDstPix; PixmapPtr pScreenPix, pDstPix;
XID gcvals[2]; ChangeGCVal gcvals[2];
GCPtr pGC; GCPtr pGC;
pScreenPix = (*pScreen->GetScreenPixmap)(pScreen); pScreenPix = (*pScreen->GetScreenPixmap)(pScreen);
@ -1879,9 +1879,9 @@ XAAWriteBitmapToCacheLinear(
pScreenPix->devPrivate.ptr); pScreenPix->devPrivate.ptr);
pGC = GetScratchGC(pScreenPix->drawable.depth, pScreen); pGC = GetScratchGC(pScreenPix->drawable.depth, pScreen);
gcvals[0] = fg; gcvals[0].val = fg;
gcvals[1] = bg; gcvals[1].val = bg;
dixChangeGC(NullClient, pGC, GCForeground | GCBackground, gcvals, NULL); dixChangeGC(NullClient, pGC, GCForeground | GCBackground, NULL, gcvals);
ValidateGC((DrawablePtr)pDstPix, pGC); ValidateGC((DrawablePtr)pDstPix, pGC);
/* We've unwrapped already so these ops miss a sync */ /* We've unwrapped already so these ops miss a sync */

View File

@ -1036,16 +1036,16 @@ miPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
if (!pGCTo) if (!pGCTo)
return; return;
{ {
CARD32 gcvals[6]; ChangeGCVal gcvals[6];
gcvals[0] = GXcopy; gcvals[0].val = GXcopy;
gcvals[1] = 1; gcvals[1].val = 1;
gcvals[2] = 0; gcvals[2].val = 0;
gcvals[3] = pGC->lineWidth; gcvals[3].val = pGC->lineWidth;
gcvals[4] = pGC->capStyle; gcvals[4].val = pGC->capStyle;
gcvals[5] = pGC->joinStyle; gcvals[5].val = pGC->joinStyle;
dixChangeGC(NullClient, pGCTo, GCFunction | dixChangeGC(NullClient, pGCTo, GCFunction |
GCForeground | GCBackground | GCLineWidth | GCForeground | GCBackground | GCLineWidth |
GCCapStyle | GCJoinStyle, gcvals, NULL); GCCapStyle | GCJoinStyle, NULL, gcvals);
} }
/* allocate a 1 bit deep pixmap of the appropriate size, and /* allocate a 1 bit deep pixmap of the appropriate size, and
@ -1085,11 +1085,14 @@ miPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
iphase >= 0; iphase >= 0;
iphase--) iphase--)
{ {
ChangeGCVal gcval;
if (iphase == 1) { if (iphase == 1) {
dixChangeGC (NullClient, pGC, GCForeground, &bg, NULL); gcval.val = bg;
dixChangeGC (NullClient, pGC, GCForeground, NULL, &gcval);
ValidateGC (pDraw, pGC); ValidateGC (pDraw, pGC);
} else if (pGC->lineStyle == LineDoubleDash) { } else if (pGC->lineStyle == LineDoubleDash) {
dixChangeGC (NullClient, pGC, GCForeground, &fg, NULL); gcval.val = fg;
dixChangeGC (NullClient, pGC, GCForeground, NULL, &gcval);
ValidateGC (pDraw, pGC); ValidateGC (pDraw, pGC);
} }
for (i = 0; i < polyArcs[iphase].narcs; i++) { for (i = 0; i < polyArcs[iphase].narcs; i++) {

View File

@ -646,7 +646,6 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
unsigned char depth; unsigned char depth;
int i, linelength, width, srcx, srcy; int i, linelength, width, srcx, srcy;
DDXPointRec pt = {0, 0}; DDXPointRec pt = {0, 0};
XID gcv[2];
PixmapPtr pPixmap = NULL; PixmapPtr pPixmap = NULL;
GCPtr pGC = NULL; GCPtr pGC = NULL;
@ -655,6 +654,7 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
{ {
if ( (((1<<depth)-1)&planeMask) != (1<<depth)-1 ) if ( (((1<<depth)-1)&planeMask) != (1<<depth)-1 )
{ {
ChangeGCVal gcv;
xPoint pt; xPoint pt;
pGC = GetScratchGC(depth, pDraw->pScreen); pGC = GetScratchGC(depth, pDraw->pScreen);
@ -678,8 +678,8 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
TRUE); TRUE);
/* alu is already GXCopy */ /* alu is already GXCopy */
gcv[0] = (XID)planeMask; gcv.val = (XID)planeMask;
dixChangeGC(NullClient, pGC, GCPlaneMask, gcv, NULL); dixChangeGC(NullClient, pGC, GCPlaneMask, NULL, &gcv);
ValidateGC((DrawablePtr)pPixmap, pGC); ValidateGC((DrawablePtr)pPixmap, pGC);
} }
@ -747,7 +747,7 @@ miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth,
RegionPtr prgnSrc; RegionPtr prgnSrc;
BoxRec box; BoxRec box;
unsigned long oldFg, oldBg; unsigned long oldFg, oldBg;
XID gcv[3]; ChangeGCVal gcv[3];
unsigned long oldPlanemask; unsigned long oldPlanemask;
unsigned long i; unsigned long i;
long bytesPer; long bytesPer;
@ -774,26 +774,26 @@ miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth,
oldPlanemask = pGC->planemask; oldPlanemask = pGC->planemask;
oldFg = pGC->fgPixel; oldFg = pGC->fgPixel;
oldBg = pGC->bgPixel; oldBg = pGC->bgPixel;
gcv[0] = (XID)~0; gcv[0].val = (XID)~0;
gcv[1] = (XID)0; gcv[1].val = (XID)0;
dixChangeGC(NullClient, pGC, GCForeground | GCBackground, gcv, NULL); dixChangeGC(NullClient, pGC, GCForeground | GCBackground, NULL, gcv);
bytesPer = (long)h * BitmapBytePad(w + leftPad); bytesPer = (long)h * BitmapBytePad(w + leftPad);
for (i = 1 << (depth-1); i != 0; i >>= 1, pImage += bytesPer) for (i = 1 << (depth-1); i != 0; i >>= 1, pImage += bytesPer)
{ {
if (i & oldPlanemask) if (i & oldPlanemask)
{ {
gcv[0] = (XID)i; gcv[0].val = (XID)i;
dixChangeGC(NullClient, pGC, GCPlaneMask, gcv, NULL); dixChangeGC(NullClient, pGC, GCPlaneMask, NULL, gcv);
ValidateGC(pDraw, pGC); ValidateGC(pDraw, pGC);
(*pGC->ops->PutImage)(pDraw, pGC, 1, x, y, w, h, leftPad, (*pGC->ops->PutImage)(pDraw, pGC, 1, x, y, w, h, leftPad,
XYBitmap, (char *)pImage); XYBitmap, (char *)pImage);
} }
} }
gcv[0] = (XID)oldPlanemask; gcv[0].val = (XID)oldPlanemask;
gcv[1] = (XID)oldFg; gcv[1].val = (XID)oldFg;
gcv[2] = (XID)oldBg; gcv[2].val = (XID)oldBg;
dixChangeGC(NullClient, pGC, GCPlaneMask | GCForeground | GCBackground, gcv, NULL); dixChangeGC(NullClient, pGC, GCPlaneMask | GCForeground | GCBackground, NULL, gcv);
ValidateGC(pDraw, pGC); ValidateGC(pDraw, pGC);
break; break;

View File

@ -222,7 +222,7 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
{ {
miDCCursorPtr pPriv; miDCCursorPtr pPriv;
GCPtr pGC; GCPtr pGC;
XID gcvals[3]; ChangeGCVal gcvals;
pPriv = malloc(sizeof (miDCCursorRec)); pPriv = malloc(sizeof (miDCCursorRec));
if (!pPriv) if (!pPriv)
@ -305,22 +305,22 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
(*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,
0, XYPixmap, (char *)pCursor->bits->source); 0, XYPixmap, (char *)pCursor->bits->source);
gcvals[0] = GXand; gcvals.val = GXand;
dixChangeGC (NullClient, pGC, GCFunction, gcvals, NULL); dixChangeGC (NullClient, pGC, GCFunction, NULL, &gcvals);
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,
0, XYPixmap, (char *)pCursor->bits->mask); 0, XYPixmap, (char *)pCursor->bits->mask);
/* mask bits -- pCursor->mask & ~pCursor->source */ /* mask bits -- pCursor->mask & ~pCursor->source */
gcvals[0] = GXcopy; gcvals.val = GXcopy;
dixChangeGC (NullClient, pGC, GCFunction, gcvals, NULL); dixChangeGC (NullClient, pGC, GCFunction, NULL, &gcvals);
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.val = GXandInverted;
dixChangeGC (NullClient, pGC, GCFunction, gcvals, NULL); dixChangeGC (NullClient, pGC, GCFunction, NULL, &gcvals);
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,
@ -365,13 +365,13 @@ miDCPutBits (
unsigned long source, unsigned long source,
unsigned long mask) unsigned long mask)
{ {
XID gcvals[1]; ChangeGCVal gcval;
int x, y; int x, y;
if (sourceGC->fgPixel != source) if (sourceGC->fgPixel != source)
{ {
gcvals[0] = source; gcval.val = source;
dixChangeGC (NullClient, sourceGC, GCForeground, gcvals, NULL); dixChangeGC (NullClient, sourceGC, GCForeground, NULL, &gcval);
} }
if (sourceGC->serialNumber != pDrawable->serialNumber) if (sourceGC->serialNumber != pDrawable->serialNumber)
ValidateGC (pDrawable, sourceGC); ValidateGC (pDrawable, sourceGC);
@ -390,8 +390,8 @@ miDCPutBits (
(*sourceGC->ops->PushPixels) (sourceGC, pPriv->sourceBits, pDrawable, w, h, x, y); (*sourceGC->ops->PushPixels) (sourceGC, pPriv->sourceBits, pDrawable, w, h, x, y);
if (maskGC->fgPixel != mask) if (maskGC->fgPixel != mask)
{ {
gcvals[0] = mask; gcval.val = mask;
dixChangeGC (NullClient, maskGC, GCForeground, gcvals, NULL); dixChangeGC (NullClient, maskGC, GCForeground, NULL, &gcval);
} }
if (maskGC->serialNumber != pDrawable->serialNumber) if (maskGC->serialNumber != pDrawable->serialNumber)
ValidateGC (pDrawable, maskGC); ValidateGC (pDrawable, maskGC);

View File

@ -683,17 +683,18 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
void void
miClearDrawable(DrawablePtr pDraw, GCPtr pGC) miClearDrawable(DrawablePtr pDraw, GCPtr pGC)
{ {
XID fg = pGC->fgPixel; ChangeGCVal fg, bg;
XID bg = pGC->bgPixel;
xRectangle rect; xRectangle rect;
fg.val = pGC->fgPixel;
bg.val = pGC->bgPixel;
rect.x = 0; rect.x = 0;
rect.y = 0; rect.y = 0;
rect.width = pDraw->width; rect.width = pDraw->width;
rect.height = pDraw->height; rect.height = pDraw->height;
dixChangeGC(NullClient, pGC, GCForeground, &bg, NULL); dixChangeGC(NullClient, pGC, GCForeground, NULL, &bg);
ValidateGC(pDraw, pGC); ValidateGC(pDraw, pGC);
(*pGC->ops->PolyFillRect)(pDraw, pGC, 1, &rect); (*pGC->ops->PolyFillRect)(pDraw, pGC, 1, &rect);
dixChangeGC(NullClient, pGC, GCForeground, &fg, NULL); dixChangeGC(NullClient, pGC, GCForeground, NULL, &fg);
ValidateGC(pDraw, pGC); ValidateGC(pDraw, pGC);
} }

View File

@ -107,7 +107,7 @@ miPolyGlyphBlt(
int nbyGlyphWidth; /* bytes per scanline of glyph */ int nbyGlyphWidth; /* bytes per scanline of glyph */
int nbyPadGlyph; /* server padded line of glyph */ int nbyPadGlyph; /* server padded line of glyph */
XID gcvals[3]; ChangeGCVal gcvals[3];
if (pGC->miTranslate) if (pGC->miTranslate)
{ {
@ -134,11 +134,11 @@ miPolyGlyphBlt(
return; return;
} }
gcvals[0] = GXcopy; gcvals[0].val = GXcopy;
gcvals[1] = 1; gcvals[1].val = 1;
gcvals[2] = 0; gcvals[2].val = 0;
dixChangeGC(NullClient, pGCtmp, GCFunction|GCForeground|GCBackground, gcvals, NULL); dixChangeGC(NullClient, pGCtmp, GCFunction|GCForeground|GCBackground, NULL, gcvals);
nbyLine = BitmapBytePad(width); nbyLine = BitmapBytePad(width);
pbits = malloc(height*nbyLine); pbits = malloc(height*nbyLine);
@ -209,7 +209,7 @@ miImageGlyphBlt(
) )
{ {
ExtentInfoRec info; /* used by QueryGlyphExtents() */ ExtentInfoRec info; /* used by QueryGlyphExtents() */
XID gcvals[3]; ChangeGCVal gcvals[3];
int oldAlu, oldFS; int oldAlu, oldFS;
unsigned long oldFG; unsigned long oldFG;
xRectangle backrect; xRectangle backrect;
@ -234,25 +234,25 @@ miImageGlyphBlt(
oldFS = pGC->fillStyle; oldFS = pGC->fillStyle;
/* fill in the background */ /* fill in the background */
gcvals[0] = GXcopy; gcvals[0].val = GXcopy;
gcvals[1] = pGC->bgPixel; gcvals[1].val = pGC->bgPixel;
gcvals[2] = FillSolid; gcvals[2].val = FillSolid;
dixChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, gcvals, NULL); dixChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, NULL, gcvals);
ValidateGC(pDrawable, pGC); ValidateGC(pDrawable, pGC);
(*pGC->ops->PolyFillRect)(pDrawable, pGC, 1, &backrect); (*pGC->ops->PolyFillRect)(pDrawable, pGC, 1, &backrect);
/* put down the glyphs */ /* put down the glyphs */
gcvals[0] = oldFG; gcvals[0].val = oldFG;
dixChangeGC(NullClient, pGC, GCForeground, gcvals, NULL); dixChangeGC(NullClient, pGC, GCForeground, NULL, gcvals);
ValidateGC(pDrawable, pGC); ValidateGC(pDrawable, pGC);
(*pGC->ops->PolyGlyphBlt)(pDrawable, pGC, x, y, nglyph, ppci, (*pGC->ops->PolyGlyphBlt)(pDrawable, pGC, x, y, nglyph, ppci,
pglyphBase); pglyphBase);
/* put all the toys away when done playing */ /* put all the toys away when done playing */
gcvals[0] = oldAlu; gcvals[0].val = oldAlu;
gcvals[1] = oldFG; gcvals[1].val = oldFG;
gcvals[2] = oldFS; gcvals[2].val = oldFS;
dixChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, gcvals, NULL); dixChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, NULL, gcvals);
ValidateGC(pDrawable, pGC); ValidateGC(pDrawable, pGC);
} }

View File

@ -68,7 +68,7 @@ miPolyPoint(
int xorg; int xorg;
int yorg; int yorg;
int nptTmp; int nptTmp;
XID fsOld, fsNew; ChangeGCVal fsOld, fsNew;
int *pwidthInit, *pwidth; int *pwidthInit, *pwidth;
int i; int i;
xPoint *ppt; xPoint *ppt;
@ -103,11 +103,11 @@ miPolyPoint(
} }
} }
fsOld = pGC->fillStyle; fsOld.val = pGC->fillStyle;
fsNew = FillSolid; fsNew.val = FillSolid;
if(pGC->fillStyle != FillSolid) if(pGC->fillStyle != FillSolid)
{ {
dixChangeGC(NullClient, pGC, GCFillStyle, &fsNew, NULL); dixChangeGC(NullClient, pGC, GCFillStyle, NULL, &fsNew);
ValidateGC(pDrawable, pGC); ValidateGC(pDrawable, pGC);
} }
pwidth = pwidthInit; pwidth = pwidthInit;
@ -115,9 +115,9 @@ miPolyPoint(
*pwidth++ = 1; *pwidth++ = 1;
(*pGC->ops->FillSpans)(pDrawable, pGC, npt, pptInit, pwidthInit, FALSE); (*pGC->ops->FillSpans)(pDrawable, pGC, npt, pptInit, pwidthInit, FALSE);
if(fsOld != FillSolid) if(fsOld.val != FillSolid)
{ {
dixChangeGC(NullClient, pGC, GCFillStyle, &fsOld, NULL); dixChangeGC(NullClient, pGC, GCFillStyle, NULL, &fsOld);
ValidateGC(pDrawable, pGC); ValidateGC(pDrawable, pGC);
} }
free(pwidthInit); free(pwidthInit);

View File

@ -110,19 +110,20 @@ fillSpans(DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, Spans *spans, S
{ {
if (!spanData) if (!spanData)
{ {
XID oldPixel = pGC->fgPixel; ChangeGCVal oldPixel, tmpPixel;
if (pixel != oldPixel) oldPixel.val = pGC->fgPixel;
if (pixel != oldPixel.val)
{ {
XID tmpPixel = (XID)pixel; tmpPixel.val = (XID)pixel;
dixChangeGC (NullClient, pGC, GCForeground, &tmpPixel, NULL); dixChangeGC (NullClient, pGC, GCForeground, NULL, &tmpPixel);
ValidateGC (pDrawable, pGC); ValidateGC (pDrawable, pGC);
} }
(*pGC->ops->FillSpans) (pDrawable, pGC, spans->count, spans->points, spans->widths, TRUE); (*pGC->ops->FillSpans) (pDrawable, pGC, spans->count, spans->points, spans->widths, TRUE);
free(spans->widths); free(spans->widths);
free(spans->points); free(spans->points);
if (pixel != oldPixel) if (pixel != oldPixel.val)
{ {
dixChangeGC (NullClient, pGC, GCForeground, &oldPixel, NULL); dixChangeGC (NullClient, pGC, GCForeground, NULL, &oldPixel);
ValidateGC (pDrawable, pGC); ValidateGC (pDrawable, pGC);
} }
} }
@ -246,7 +247,7 @@ miFillRectPolyHelper (
{ {
DDXPointPtr ppt; DDXPointPtr ppt;
int *pwidth; int *pwidth;
XID oldPixel; ChangeGCVal oldPixel, tmpPixel;
Spans spanRec; Spans spanRec;
xRectangle rect; xRectangle rect;
@ -256,17 +257,17 @@ miFillRectPolyHelper (
rect.y = y; rect.y = y;
rect.width = w; rect.width = w;
rect.height = h; rect.height = h;
oldPixel = pGC->fgPixel; oldPixel.val = pGC->fgPixel;
if (pixel != oldPixel) if (pixel != oldPixel.val)
{ {
XID tmpPixel = (XID)pixel; tmpPixel.val = (XID)pixel;
dixChangeGC (NullClient, pGC, GCForeground, &tmpPixel, NULL); dixChangeGC (NullClient, pGC, GCForeground, NULL, &tmpPixel);
ValidateGC (pDrawable, pGC); ValidateGC (pDrawable, pGC);
} }
(*pGC->ops->PolyFillRect) (pDrawable, pGC, 1, &rect); (*pGC->ops->PolyFillRect) (pDrawable, pGC, 1, &rect);
if (pixel != oldPixel) if (pixel != oldPixel.val)
{ {
dixChangeGC (NullClient, pGC, GCForeground, &oldPixel, NULL); dixChangeGC (NullClient, pGC, GCForeground, NULL, &oldPixel);
ValidateGC (pDrawable, pGC); ValidateGC (pDrawable, pGC);
} }
} }
@ -1498,20 +1499,19 @@ miCleanupSpanData (DrawablePtr pDrawable, GCPtr pGC, SpanDataPtr spanData)
{ {
if (pGC->lineStyle == LineDoubleDash) if (pGC->lineStyle == LineDoubleDash)
{ {
XID oldPixel, pixel; ChangeGCVal oldPixel, pixel;
pixel.val = pGC->bgPixel;
pixel = pGC->bgPixel; oldPixel.val = pGC->fgPixel;
oldPixel = pGC->fgPixel; if (pixel.val != oldPixel.val)
if (pixel != oldPixel)
{ {
dixChangeGC (NullClient, pGC, GCForeground, &pixel, NULL); dixChangeGC (NullClient, pGC, GCForeground, NULL, &pixel);
ValidateGC (pDrawable, pGC); ValidateGC (pDrawable, pGC);
} }
miFillUniqueSpanGroup (pDrawable, pGC, &spanData->bgGroup); miFillUniqueSpanGroup (pDrawable, pGC, &spanData->bgGroup);
miFreeSpanGroup (&spanData->bgGroup); miFreeSpanGroup (&spanData->bgGroup);
if (pixel != oldPixel) if (pixel.val != oldPixel.val)
{ {
dixChangeGC (NullClient, pGC, GCForeground, &oldPixel, NULL); dixChangeGC (NullClient, pGC, GCForeground, NULL, &oldPixel);
ValidateGC (pDrawable, pGC); ValidateGC (pDrawable, pGC);
} }
} }

View File

@ -78,13 +78,17 @@ typedef struct _LineFace {
#define MILINESETPIXEL(pDrawable, pGC, pixel, oldPixel) { \ #define MILINESETPIXEL(pDrawable, pGC, pixel, oldPixel) { \
oldPixel = pGC->fgPixel; \ oldPixel = pGC->fgPixel; \
if (pixel != oldPixel) { \ if (pixel != oldPixel) { \
dixChangeGC (NullClient, pGC, GCForeground, (XID *) &pixel, NULL); \ ChangeGCVal gcval; \
gcval.val = pixel; \
dixChangeGC (NullClient, pGC, GCForeground, NULL, &gcval); \
ValidateGC (pDrawable, pGC); \ ValidateGC (pDrawable, pGC); \
} \ } \
} }
#define MILINERESETPIXEL(pDrawable, pGC, pixel, oldPixel) { \ #define MILINERESETPIXEL(pDrawable, pGC, pixel, oldPixel) { \
if (pixel != oldPixel) { \ if (pixel != oldPixel) { \
dixChangeGC (NullClient, pGC, GCForeground, (XID *) &oldPixel, NULL); \ ChangeGCVal gcval; \
gcval.val = oldPixel; \
dixChangeGC (NullClient, pGC, GCForeground, NULL, &gcval); \
ValidateGC (pDrawable, pGC); \ ValidateGC (pDrawable, pGC); \
} \ } \
} }

View File

@ -803,7 +803,9 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
if ((pGC->fillStyle == FillSolid) || if ((pGC->fillStyle == FillSolid) ||
(pGC->fillStyle == FillStippled)) (pGC->fillStyle == FillStippled))
{ {
dixChangeGC(NullClient, pGC, GCForeground, (XID *)&pGC->bgPixel, NULL); ChangeGCVal gcval;
gcval.val = pGC->bgPixel;
dixChangeGC(NullClient, pGC, GCForeground, NULL, &gcval);
ValidateGC(pDraw, pGC); ValidateGC(pDraw, pGC);
} }
pts = &points[numPts >> 1]; pts = &points[numPts >> 1];
@ -831,7 +833,9 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
if ((pGC->fillStyle == FillSolid) || if ((pGC->fillStyle == FillSolid) ||
(pGC->fillStyle == FillStippled)) (pGC->fillStyle == FillStippled))
{ {
dixChangeGC(NullClient, pGC, GCForeground, &fgPixel, NULL); ChangeGCVal gcval;
gcval.val = fgPixel;
dixChangeGC(NullClient, pGC, GCForeground, NULL, &gcval);
ValidateGC(pDraw, pGC); ValidateGC(pDraw, pGC);
} }
} }

View File

@ -188,7 +188,7 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable)
if (pDrawable->serialNumber != pPriv->serialNumber || if (pDrawable->serialNumber != pPriv->serialNumber ||
(pPriv->stateChanges & (GCClipXOrigin|GCClipYOrigin|GCClipMask))) (pPriv->stateChanges & (GCClipXOrigin|GCClipYOrigin|GCClipMask)))
{ {
XID vals[2]; ChangeGCVal vals[2];
RegionPtr pCompositeClip; RegionPtr pCompositeClip;
pCompositeClip = REGION_CREATE (pScreen, NULL, 0); pCompositeClip = REGION_CREATE (pScreen, NULL, 0);
@ -202,10 +202,10 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable)
(*pBackingGC->funcs->ChangeClip) (pBackingGC, CT_REGION, (*pBackingGC->funcs->ChangeClip) (pBackingGC, CT_REGION,
(pointer) pCompositeClip, 0); (pointer) pCompositeClip, 0);
vals[0] = x_off - pDrawable->x; vals[0].val = x_off - pDrawable->x;
vals[1] = y_off - pDrawable->y; vals[1].val = y_off - pDrawable->y;
dixChangeGC(NullClient, pBackingGC, dixChangeGC(NullClient, pBackingGC,
(GCClipXOrigin | GCClipYOrigin), vals, NULL); (GCClipXOrigin | GCClipYOrigin), NULL, vals);
pPriv->serialNumber = pDrawable->serialNumber; pPriv->serialNumber = pDrawable->serialNumber;
/* /*
@ -223,11 +223,11 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable)
if ((pGC->patOrg.x + x_off) != pBackingGC->patOrg.x || if ((pGC->patOrg.x + x_off) != pBackingGC->patOrg.x ||
(pGC->patOrg.y + y_off) != pBackingGC->patOrg.y) (pGC->patOrg.y + y_off) != pBackingGC->patOrg.y)
{ {
XID vals[2]; ChangeGCVal vals[2];
vals[0] = pGC->patOrg.x + x_off; vals[0].val = pGC->patOrg.x + x_off;
vals[1] = pGC->patOrg.y + y_off; vals[1].val = pGC->patOrg.y + y_off;
dixChangeGC(NullClient, pBackingGC, dixChangeGC(NullClient, pBackingGC,
(GCTileStipXOrigin | GCTileStipYOrigin), vals, NULL); (GCTileStipXOrigin | GCTileStipYOrigin), NULL, vals);
} }
ValidateGC(pBackingDrawable, pBackingGC); ValidateGC(pBackingDrawable, pBackingGC);

View File

@ -45,7 +45,7 @@ miColorRects (PicturePtr pDst,
ScreenPtr pScreen = pDst->pDrawable->pScreen; ScreenPtr pScreen = pDst->pDrawable->pScreen;
CARD32 pixel; CARD32 pixel;
GCPtr pGC; GCPtr pGC;
CARD32 tmpval[5]; ChangeGCVal tmpval[5];
RegionPtr pClip; RegionPtr pClip;
unsigned long mask; unsigned long mask;
@ -54,14 +54,14 @@ miColorRects (PicturePtr pDst,
pGC = GetScratchGC (pDst->pDrawable->depth, pScreen); pGC = GetScratchGC (pDst->pDrawable->depth, pScreen);
if (!pGC) if (!pGC)
return; return;
tmpval[0] = GXcopy; tmpval[0].val = GXcopy;
tmpval[1] = pixel; tmpval[1].val = pixel;
tmpval[2] = pDst->subWindowMode; tmpval[2].val = pDst->subWindowMode;
mask = GCFunction | GCForeground | GCSubwindowMode; mask = GCFunction | GCForeground | GCSubwindowMode;
if (pClipPict->clientClipType == CT_REGION) if (pClipPict->clientClipType == CT_REGION)
{ {
tmpval[3] = pDst->clipOrigin.x - xoff; tmpval[3].val = pDst->clipOrigin.x - xoff;
tmpval[4] = pDst->clipOrigin.y - yoff; tmpval[4].val = pDst->clipOrigin.y - yoff;
mask |= GCClipXOrigin|GCClipYOrigin; mask |= GCClipXOrigin|GCClipYOrigin;
pClip = REGION_CREATE (pScreen, NULL, 1); pClip = REGION_CREATE (pScreen, NULL, 1);
@ -70,7 +70,7 @@ miColorRects (PicturePtr pDst,
(*pGC->funcs->ChangeClip) (pGC, CT_REGION, pClip, 0); (*pGC->funcs->ChangeClip) (pGC, CT_REGION, pClip, 0);
} }
dixChangeGC (NullClient, pGC, mask, tmpval, NULL); dixChangeGC (NullClient, pGC, mask, NULL, tmpval);
ValidateGC (pDst->pDrawable, pGC); ValidateGC (pDst->pDrawable, pGC);
if (xoff || yoff) if (xoff || yoff)
{ {
@ -129,7 +129,8 @@ miCompositeRects (CARD8 op,
int error; int error;
Pixel pixel; Pixel pixel;
GCPtr pGC; GCPtr pGC;
CARD32 tmpval[2]; ChangeGCVal gcvals[2];
XID tmpval[1];
rgbaFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8); rgbaFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8);
if (!rgbaFormat) if (!rgbaFormat)
@ -145,10 +146,10 @@ miCompositeRects (CARD8 op,
pGC = GetScratchGC (rgbaFormat->depth, pScreen); pGC = GetScratchGC (rgbaFormat->depth, pScreen);
if (!pGC) if (!pGC)
goto bail3; goto bail3;
tmpval[0] = GXcopy; gcvals[0].val = GXcopy;
tmpval[1] = pixel; gcvals[1].val = pixel;
dixChangeGC (NullClient, pGC, GCFunction | GCForeground, tmpval, NULL); dixChangeGC (NullClient, pGC, GCFunction | GCForeground, NULL, gcvals);
ValidateGC (&pPixmap->drawable, pGC); ValidateGC (&pPixmap->drawable, pGC);
one.x = 0; one.x = 0;
one.y = 0; one.y = 0;

View File

@ -622,7 +622,7 @@ ProcXFixesSetGCClipRegion (ClientPtr client)
{ {
GCPtr pGC; GCPtr pGC;
RegionPtr pRegion; RegionPtr pRegion;
XID vals[2]; ChangeGCVal vals[2];
int rc; int rc;
REQUEST(xXFixesSetGCClipRegionReq); REQUEST(xXFixesSetGCClipRegionReq);
REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq); REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq);
@ -640,9 +640,9 @@ ProcXFixesSetGCClipRegion (ClientPtr client)
return BadAlloc; return BadAlloc;
} }
vals[0] = stuff->xOrigin; vals[0].val = stuff->xOrigin;
vals[1] = stuff->yOrigin; vals[1].val = stuff->yOrigin;
dixChangeGC (NullClient, pGC, GCClipXOrigin|GCClipYOrigin, vals, NULL); dixChangeGC (NullClient, pGC, GCClipXOrigin|GCClipYOrigin, NULL, vals);
(*pGC->funcs->ChangeClip)(pGC, pRegion ? CT_REGION : CT_NONE, (pointer)pRegion, 0); (*pGC->funcs->ChangeClip)(pGC, pRegion ? CT_REGION : CT_NONE, (pointer)pRegion, 0);
return (client->noClientException); return (client->noClientException);