summaryrefslogtreecommitdiff
path: root/mi
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2010-05-08 14:10:51 -0700
committerJamey Sharp <jamey@minilop.net>2010-05-13 17:13:48 -0700
commite2929db7b737413cf93fbebdf4d15abdfebff05c (patch)
treeb32ddbf9c163f8eb814ebdaa4b22301b82af0906 /mi
parent95728ca09d45afc84c8d1828c09c6b6725f1a58d (diff)
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>
Diffstat (limited to 'mi')
-rw-r--r--mi/miarc.c23
-rw-r--r--mi/mibitblt.c26
-rw-r--r--mi/midispcur.c24
-rw-r--r--mi/miexpose.c9
-rw-r--r--mi/miglblt.c32
-rw-r--r--mi/mipolypnt.c12
-rw-r--r--mi/miwideline.c42
-rw-r--r--mi/miwideline.h8
-rw-r--r--mi/mizerarc.c8
9 files changed, 98 insertions, 86 deletions
diff --git a/mi/miarc.c b/mi/miarc.c
index f2959c77b..bdcbdf140 100644
--- a/mi/miarc.c
+++ b/mi/miarc.c
@@ -1036,16 +1036,16 @@ miPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
if (!pGCTo)
return;
{
- CARD32 gcvals[6];
- gcvals[0] = GXcopy;
- gcvals[1] = 1;
- gcvals[2] = 0;
- gcvals[3] = pGC->lineWidth;
- gcvals[4] = pGC->capStyle;
- gcvals[5] = pGC->joinStyle;
+ ChangeGCVal gcvals[6];
+ gcvals[0].val = GXcopy;
+ gcvals[1].val = 1;
+ gcvals[2].val = 0;
+ gcvals[3].val = pGC->lineWidth;
+ gcvals[4].val = pGC->capStyle;
+ gcvals[5].val = pGC->joinStyle;
dixChangeGC(NullClient, pGCTo, GCFunction |
GCForeground | GCBackground | GCLineWidth |
- GCCapStyle | GCJoinStyle, gcvals, NULL);
+ GCCapStyle | GCJoinStyle, NULL, gcvals);
}
/* 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--)
{
+ ChangeGCVal gcval;
if (iphase == 1) {
- dixChangeGC (NullClient, pGC, GCForeground, &bg, NULL);
+ gcval.val = bg;
+ dixChangeGC (NullClient, pGC, GCForeground, NULL, &gcval);
ValidateGC (pDraw, pGC);
} else if (pGC->lineStyle == LineDoubleDash) {
- dixChangeGC (NullClient, pGC, GCForeground, &fg, NULL);
+ gcval.val = fg;
+ dixChangeGC (NullClient, pGC, GCForeground, NULL, &gcval);
ValidateGC (pDraw, pGC);
}
for (i = 0; i < polyArcs[iphase].narcs; i++) {
diff --git a/mi/mibitblt.c b/mi/mibitblt.c
index f02c04fd4..b767a0519 100644
--- a/mi/mibitblt.c
+++ b/mi/mibitblt.c
@@ -646,7 +646,6 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
unsigned char depth;
int i, linelength, width, srcx, srcy;
DDXPointRec pt = {0, 0};
- XID gcv[2];
PixmapPtr pPixmap = 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 )
{
+ ChangeGCVal gcv;
xPoint pt;
pGC = GetScratchGC(depth, pDraw->pScreen);
@@ -678,8 +678,8 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
TRUE);
/* alu is already GXCopy */
- gcv[0] = (XID)planeMask;
- dixChangeGC(NullClient, pGC, GCPlaneMask, gcv, NULL);
+ gcv.val = (XID)planeMask;
+ dixChangeGC(NullClient, pGC, GCPlaneMask, NULL, &gcv);
ValidateGC((DrawablePtr)pPixmap, pGC);
}
@@ -747,7 +747,7 @@ miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth,
RegionPtr prgnSrc;
BoxRec box;
unsigned long oldFg, oldBg;
- XID gcv[3];
+ ChangeGCVal gcv[3];
unsigned long oldPlanemask;
unsigned long i;
long bytesPer;
@@ -774,26 +774,26 @@ miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth,
oldPlanemask = pGC->planemask;
oldFg = pGC->fgPixel;
oldBg = pGC->bgPixel;
- gcv[0] = (XID)~0;
- gcv[1] = (XID)0;
- dixChangeGC(NullClient, pGC, GCForeground | GCBackground, gcv, NULL);
+ gcv[0].val = (XID)~0;
+ gcv[1].val = (XID)0;
+ dixChangeGC(NullClient, pGC, GCForeground | GCBackground, NULL, gcv);
bytesPer = (long)h * BitmapBytePad(w + leftPad);
for (i = 1 << (depth-1); i != 0; i >>= 1, pImage += bytesPer)
{
if (i & oldPlanemask)
{
- gcv[0] = (XID)i;
- dixChangeGC(NullClient, pGC, GCPlaneMask, gcv, NULL);
+ gcv[0].val = (XID)i;
+ dixChangeGC(NullClient, pGC, GCPlaneMask, NULL, gcv);
ValidateGC(pDraw, pGC);
(*pGC->ops->PutImage)(pDraw, pGC, 1, x, y, w, h, leftPad,
XYBitmap, (char *)pImage);
}
}
- gcv[0] = (XID)oldPlanemask;
- gcv[1] = (XID)oldFg;
- gcv[2] = (XID)oldBg;
- dixChangeGC(NullClient, pGC, GCPlaneMask | GCForeground | GCBackground, gcv, NULL);
+ gcv[0].val = (XID)oldPlanemask;
+ gcv[1].val = (XID)oldFg;
+ gcv[2].val = (XID)oldBg;
+ dixChangeGC(NullClient, pGC, GCPlaneMask | GCForeground | GCBackground, NULL, gcv);
ValidateGC(pDraw, pGC);
break;
diff --git a/mi/midispcur.c b/mi/midispcur.c
index 11547dbd9..865b60bbc 100644
--- a/mi/midispcur.c
+++ b/mi/midispcur.c
@@ -222,7 +222,7 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
{
miDCCursorPtr pPriv;
GCPtr pGC;
- XID gcvals[3];
+ ChangeGCVal gcvals;
pPriv = malloc(sizeof (miDCCursorRec));
if (!pPriv)
@@ -305,22 +305,22 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
(*pGC->ops->PutImage) ((DrawablePtr)pPriv->sourceBits, pGC, 1,
0, 0, pCursor->bits->width, pCursor->bits->height,
0, XYPixmap, (char *)pCursor->bits->source);
- gcvals[0] = GXand;
- dixChangeGC (NullClient, pGC, GCFunction, gcvals, NULL);
+ gcvals.val = GXand;
+ dixChangeGC (NullClient, pGC, GCFunction, NULL, &gcvals);
ValidateGC ((DrawablePtr)pPriv->sourceBits, pGC);
(*pGC->ops->PutImage) ((DrawablePtr)pPriv->sourceBits, pGC, 1,
0, 0, pCursor->bits->width, pCursor->bits->height,
0, XYPixmap, (char *)pCursor->bits->mask);
/* mask bits -- pCursor->mask & ~pCursor->source */
- gcvals[0] = GXcopy;
- dixChangeGC (NullClient, pGC, GCFunction, gcvals, NULL);
+ gcvals.val = GXcopy;
+ dixChangeGC (NullClient, pGC, GCFunction, NULL, &gcvals);
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;
- dixChangeGC (NullClient, pGC, GCFunction, gcvals, NULL);
+ gcvals.val = GXandInverted;
+ dixChangeGC (NullClient, pGC, GCFunction, NULL, &gcvals);
ValidateGC ((DrawablePtr)pPriv->maskBits, pGC);
(*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1,
0, 0, pCursor->bits->width, pCursor->bits->height,
@@ -365,13 +365,13 @@ miDCPutBits (
unsigned long source,
unsigned long mask)
{
- XID gcvals[1];
+ ChangeGCVal gcval;
int x, y;
if (sourceGC->fgPixel != source)
{
- gcvals[0] = source;
- dixChangeGC (NullClient, sourceGC, GCForeground, gcvals, NULL);
+ gcval.val = source;
+ dixChangeGC (NullClient, sourceGC, GCForeground, NULL, &gcval);
}
if (sourceGC->serialNumber != pDrawable->serialNumber)
ValidateGC (pDrawable, sourceGC);
@@ -390,8 +390,8 @@ miDCPutBits (
(*sourceGC->ops->PushPixels) (sourceGC, pPriv->sourceBits, pDrawable, w, h, x, y);
if (maskGC->fgPixel != mask)
{
- gcvals[0] = mask;
- dixChangeGC (NullClient, maskGC, GCForeground, gcvals, NULL);
+ gcval.val = mask;
+ dixChangeGC (NullClient, maskGC, GCForeground, NULL, &gcval);
}
if (maskGC->serialNumber != pDrawable->serialNumber)
ValidateGC (pDrawable, maskGC);
diff --git a/mi/miexpose.c b/mi/miexpose.c
index b4d489a7d..03ce896aa 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -683,17 +683,18 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
void
miClearDrawable(DrawablePtr pDraw, GCPtr pGC)
{
- XID fg = pGC->fgPixel;
- XID bg = pGC->bgPixel;
+ ChangeGCVal fg, bg;
xRectangle rect;
+ fg.val = pGC->fgPixel;
+ bg.val = pGC->bgPixel;
rect.x = 0;
rect.y = 0;
rect.width = pDraw->width;
rect.height = pDraw->height;
- dixChangeGC(NullClient, pGC, GCForeground, &bg, NULL);
+ dixChangeGC(NullClient, pGC, GCForeground, NULL, &bg);
ValidateGC(pDraw, pGC);
(*pGC->ops->PolyFillRect)(pDraw, pGC, 1, &rect);
- dixChangeGC(NullClient, pGC, GCForeground, &fg, NULL);
+ dixChangeGC(NullClient, pGC, GCForeground, NULL, &fg);
ValidateGC(pDraw, pGC);
}
diff --git a/mi/miglblt.c b/mi/miglblt.c
index 22a170aa0..acb432745 100644
--- a/mi/miglblt.c
+++ b/mi/miglblt.c
@@ -107,7 +107,7 @@ miPolyGlyphBlt(
int nbyGlyphWidth; /* bytes per scanline of glyph */
int nbyPadGlyph; /* server padded line of glyph */
- XID gcvals[3];
+ ChangeGCVal gcvals[3];
if (pGC->miTranslate)
{
@@ -134,11 +134,11 @@ miPolyGlyphBlt(
return;
}
- gcvals[0] = GXcopy;
- gcvals[1] = 1;
- gcvals[2] = 0;
+ gcvals[0].val = GXcopy;
+ gcvals[1].val = 1;
+ gcvals[2].val = 0;
- dixChangeGC(NullClient, pGCtmp, GCFunction|GCForeground|GCBackground, gcvals, NULL);
+ dixChangeGC(NullClient, pGCtmp, GCFunction|GCForeground|GCBackground, NULL, gcvals);
nbyLine = BitmapBytePad(width);
pbits = malloc(height*nbyLine);
@@ -209,7 +209,7 @@ miImageGlyphBlt(
)
{
ExtentInfoRec info; /* used by QueryGlyphExtents() */
- XID gcvals[3];
+ ChangeGCVal gcvals[3];
int oldAlu, oldFS;
unsigned long oldFG;
xRectangle backrect;
@@ -234,25 +234,25 @@ miImageGlyphBlt(
oldFS = pGC->fillStyle;
/* fill in the background */
- gcvals[0] = GXcopy;
- gcvals[1] = pGC->bgPixel;
- gcvals[2] = FillSolid;
- dixChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, gcvals, NULL);
+ gcvals[0].val = GXcopy;
+ gcvals[1].val = pGC->bgPixel;
+ gcvals[2].val = FillSolid;
+ dixChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, NULL, gcvals);
ValidateGC(pDrawable, pGC);
(*pGC->ops->PolyFillRect)(pDrawable, pGC, 1, &backrect);
/* put down the glyphs */
- gcvals[0] = oldFG;
- dixChangeGC(NullClient, pGC, GCForeground, gcvals, NULL);
+ gcvals[0].val = oldFG;
+ dixChangeGC(NullClient, pGC, GCForeground, NULL, gcvals);
ValidateGC(pDrawable, pGC);
(*pGC->ops->PolyGlyphBlt)(pDrawable, pGC, x, y, nglyph, ppci,
pglyphBase);
/* put all the toys away when done playing */
- gcvals[0] = oldAlu;
- gcvals[1] = oldFG;
- gcvals[2] = oldFS;
- dixChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, gcvals, NULL);
+ gcvals[0].val = oldAlu;
+ gcvals[1].val = oldFG;
+ gcvals[2].val = oldFS;
+ dixChangeGC(NullClient, pGC, GCFunction|GCForeground|GCFillStyle, NULL, gcvals);
ValidateGC(pDrawable, pGC);
}
diff --git a/mi/mipolypnt.c b/mi/mipolypnt.c
index b54a9fdbe..99ba68afd 100644
--- a/mi/mipolypnt.c
+++ b/mi/mipolypnt.c
@@ -68,7 +68,7 @@ miPolyPoint(
int xorg;
int yorg;
int nptTmp;
- XID fsOld, fsNew;
+ ChangeGCVal fsOld, fsNew;
int *pwidthInit, *pwidth;
int i;
xPoint *ppt;
@@ -103,11 +103,11 @@ miPolyPoint(
}
}
- fsOld = pGC->fillStyle;
- fsNew = FillSolid;
+ fsOld.val = pGC->fillStyle;
+ fsNew.val = FillSolid;
if(pGC->fillStyle != FillSolid)
{
- dixChangeGC(NullClient, pGC, GCFillStyle, &fsNew, NULL);
+ dixChangeGC(NullClient, pGC, GCFillStyle, NULL, &fsNew);
ValidateGC(pDrawable, pGC);
}
pwidth = pwidthInit;
@@ -115,9 +115,9 @@ miPolyPoint(
*pwidth++ = 1;
(*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);
}
free(pwidthInit);
diff --git a/mi/miwideline.c b/mi/miwideline.c
index cabc0c1ce..c08f9649f 100644
--- a/mi/miwideline.c
+++ b/mi/miwideline.c
@@ -110,19 +110,20 @@ fillSpans(DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, Spans *spans, S
{
if (!spanData)
{
- XID oldPixel = pGC->fgPixel;
- if (pixel != oldPixel)
+ ChangeGCVal oldPixel, tmpPixel;
+ oldPixel.val = pGC->fgPixel;
+ if (pixel != oldPixel.val)
{
- XID tmpPixel = (XID)pixel;
- dixChangeGC (NullClient, pGC, GCForeground, &tmpPixel, NULL);
+ tmpPixel.val = (XID)pixel;
+ dixChangeGC (NullClient, pGC, GCForeground, NULL, &tmpPixel);
ValidateGC (pDrawable, pGC);
}
(*pGC->ops->FillSpans) (pDrawable, pGC, spans->count, spans->points, spans->widths, TRUE);
free(spans->widths);
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);
}
}
@@ -246,7 +247,7 @@ miFillRectPolyHelper (
{
DDXPointPtr ppt;
int *pwidth;
- XID oldPixel;
+ ChangeGCVal oldPixel, tmpPixel;
Spans spanRec;
xRectangle rect;
@@ -256,17 +257,17 @@ miFillRectPolyHelper (
rect.y = y;
rect.width = w;
rect.height = h;
- oldPixel = pGC->fgPixel;
- if (pixel != oldPixel)
+ oldPixel.val = pGC->fgPixel;
+ if (pixel != oldPixel.val)
{
- XID tmpPixel = (XID)pixel;
- dixChangeGC (NullClient, pGC, GCForeground, &tmpPixel, NULL);
+ tmpPixel.val = (XID)pixel;
+ dixChangeGC (NullClient, pGC, GCForeground, NULL, &tmpPixel);
ValidateGC (pDrawable, pGC);
}
(*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);
}
}
@@ -1498,20 +1499,19 @@ miCleanupSpanData (DrawablePtr pDrawable, GCPtr pGC, SpanDataPtr spanData)
{
if (pGC->lineStyle == LineDoubleDash)
{
- XID oldPixel, pixel;
-
- pixel = pGC->bgPixel;
- oldPixel = pGC->fgPixel;
- if (pixel != oldPixel)
+ ChangeGCVal oldPixel, pixel;
+ pixel.val = pGC->bgPixel;
+ oldPixel.val = pGC->fgPixel;
+ if (pixel.val != oldPixel.val)
{
- dixChangeGC (NullClient, pGC, GCForeground, &pixel, NULL);
+ dixChangeGC (NullClient, pGC, GCForeground, NULL, &pixel);
ValidateGC (pDrawable, pGC);
}
miFillUniqueSpanGroup (pDrawable, pGC, &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);
}
}
diff --git a/mi/miwideline.h b/mi/miwideline.h
index 2ff36ed6b..8d848783c 100644
--- a/mi/miwideline.h
+++ b/mi/miwideline.h
@@ -78,13 +78,17 @@ typedef struct _LineFace {
#define MILINESETPIXEL(pDrawable, pGC, pixel, oldPixel) { \
oldPixel = pGC->fgPixel; \
if (pixel != oldPixel) { \
- dixChangeGC (NullClient, pGC, GCForeground, (XID *) &pixel, NULL); \
+ ChangeGCVal gcval; \
+ gcval.val = pixel; \
+ dixChangeGC (NullClient, pGC, GCForeground, NULL, &gcval); \
ValidateGC (pDrawable, pGC); \
} \
}
#define MILINERESETPIXEL(pDrawable, pGC, 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); \
} \
}
diff --git a/mi/mizerarc.c b/mi/mizerarc.c
index feaa3cb77..623347291 100644
--- a/mi/mizerarc.c
+++ b/mi/mizerarc.c
@@ -803,7 +803,9 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
if ((pGC->fillStyle == FillSolid) ||
(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);
}
pts = &points[numPts >> 1];
@@ -831,7 +833,9 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
if ((pGC->fillStyle == FillSolid) ||
(pGC->fillStyle == FillStippled))
{
- dixChangeGC(NullClient, pGC, GCForeground, &fgPixel, NULL);
+ ChangeGCVal gcval;
+ gcval.val = fgPixel;
+ dixChangeGC(NullClient, pGC, GCForeground, NULL, &gcval);
ValidateGC(pDraw, pGC);
}
}