dix: Rename (and retype) PixmapPerDepth[1] to defaultStipple

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Adam Jackson 2016-12-09 14:52:28 -05:00
parent 8b335d9068
commit e900a00f8d
4 changed files with 17 additions and 20 deletions

View File

@ -504,7 +504,7 @@ NewGCObject(ScreenPtr pScreen, int depth)
pGC->font = defaultFont; pGC->font = defaultFont;
if (pGC->font) /* necessary, because open of default font could fail */ if (pGC->font) /* necessary, because open of default font could fail */
pGC->font->refcnt++; pGC->font->refcnt++;
pGC->stipple = pGC->pScreen->PixmapPerDepth[0]; pGC->stipple = pGC->pScreen->defaultStipple;
if (pGC->stipple) if (pGC->stipple)
pGC->stipple->refcnt++; pGC->stipple->refcnt++;
@ -874,8 +874,7 @@ CreateDefaultStipple(int screenNum)
w = 16; w = 16;
h = 16; h = 16;
(*pScreen->QueryBestSize) (StippleShape, &w, &h, pScreen); (*pScreen->QueryBestSize) (StippleShape, &w, &h, pScreen);
if (!(pScreen->PixmapPerDepth[0] = if (!(pScreen->defaultStipple = 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].val = GXcopy; tmpval[0].val = GXcopy;
@ -883,17 +882,17 @@ CreateDefaultStipple(int screenNum)
tmpval[2].val = FillSolid; tmpval[2].val = FillSolid;
pgcScratch = GetScratchGC(1, pScreen); pgcScratch = GetScratchGC(1, pScreen);
if (!pgcScratch) { if (!pgcScratch) {
(*pScreen->DestroyPixmap) (pScreen->PixmapPerDepth[0]); (*pScreen->DestroyPixmap) (pScreen->defaultStipple);
return FALSE; return FALSE;
} }
(void) ChangeGC(NullClient, pgcScratch, (void) ChangeGC(NullClient, pgcScratch,
GCFunction | GCForeground | GCFillStyle, tmpval); GCFunction | GCForeground | GCFillStyle, tmpval);
ValidateGC((DrawablePtr) pScreen->PixmapPerDepth[0], pgcScratch); ValidateGC((DrawablePtr) pScreen->defaultStipple, pgcScratch);
rect.x = 0; rect.x = 0;
rect.y = 0; rect.y = 0;
rect.width = w; rect.width = w;
rect.height = h; rect.height = h;
(*pgcScratch->ops->PolyFillRect) ((DrawablePtr) pScreen->PixmapPerDepth[0], (*pgcScratch->ops->PolyFillRect) ((DrawablePtr) pScreen->defaultStipple,
pgcScratch, 1, &rect); pgcScratch, 1, &rect);
FreeScratchGC(pgcScratch); FreeScratchGC(pgcScratch);
return TRUE; return TRUE;
@ -904,7 +903,7 @@ FreeDefaultStipple(int screenNum)
{ {
ScreenPtr pScreen = screenInfo.screens[screenNum]; ScreenPtr pScreen = screenInfo.screens[screenNum];
(*pScreen->DestroyPixmap) (pScreen->PixmapPerDepth[0]); (*pScreen->DestroyPixmap) (pScreen->defaultStipple);
} }
int int

View File

@ -922,7 +922,7 @@ dmxBECreateResources(void *value, XID id, RESTYPE type, void *n)
dmxBECreatePixmap(pGC->tile.pixmap); dmxBECreatePixmap(pGC->tile.pixmap);
dmxBERestorePixmap(pGC->tile.pixmap); dmxBERestorePixmap(pGC->tile.pixmap);
} }
if (pGC->stipple != pScreen->PixmapPerDepth[0]) { if (pGC->stipple != pScreen->defaultStipple) {
dmxBECreatePixmap(pGC->stipple); dmxBECreatePixmap(pGC->stipple);
dmxBERestorePixmap(pGC->stipple); dmxBERestorePixmap(pGC->stipple);
} }
@ -1327,8 +1327,8 @@ dmxAttachScreen(int idx, DMXScreenAttributesPtr attr)
* updated to handle dynamic addition/removal of screens. */ * updated to handle dynamic addition/removal of screens. */
/* Create default stipple */ /* Create default stipple */
dmxBECreatePixmap(pScreen->PixmapPerDepth[0]); dmxBECreatePixmap(pScreen->defaultStipple);
dmxBERestorePixmap(pScreen->PixmapPerDepth[0]); dmxBERestorePixmap(pScreen->defaultStipple);
/* Create the scratch GCs */ /* Create the scratch GCs */
dmxBECreateScratchGCs(idx); dmxBECreateScratchGCs(idx);
@ -1692,8 +1692,8 @@ dmxDetachScreen(int idx)
dmxBEDestroyWindowTree(idx); dmxBEDestroyWindowTree(idx);
/* Free default stipple */ /* Free default stipple */
dmxBESavePixmap(screenInfo.screens[idx]->PixmapPerDepth[0]); dmxBESavePixmap(screenInfo.screens[idx]->defaultStipple);
dmxBEFreePixmap(screenInfo.screens[idx]->PixmapPerDepth[0]); dmxBEFreePixmap(screenInfo.screens[idx]->defaultStipple);
/* Free the remaining screen resources and close the screen */ /* Free the remaining screen resources and close the screen */
dmxBECloseScreen(screenInfo.screens[idx]); dmxBECloseScreen(screenInfo.screens[idx]);

View File

@ -248,7 +248,7 @@ xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
pScreen->whitePixel = xnestWhitePixel; pScreen->whitePixel = xnestWhitePixel;
pScreen->blackPixel = xnestBlackPixel; pScreen->blackPixel = xnestBlackPixel;
/* GCperDepth */ /* GCperDepth */
/* PixmapPerDepth */ /* defaultStipple */
pScreen->devPrivate = NULL; pScreen->devPrivate = NULL;
/* WindowPrivateLen */ /* WindowPrivateLen */
/* WindowPrivateSizes */ /* WindowPrivateSizes */

View File

@ -504,14 +504,12 @@ typedef struct _Screen {
char backingStoreSupport, saveUnderSupport; char backingStoreSupport, saveUnderSupport;
unsigned long whitePixel, blackPixel; unsigned long whitePixel, blackPixel;
GCPtr GCperDepth[MAXFORMATS + 1]; GCPtr GCperDepth[MAXFORMATS + 1];
/* next field is a stipple to use as default in /* next field is a stipple to use as default in a GC. we don't build
a GC. we don't build default tiles of all depths * default tiles of all depths because they are likely to be of a color
because they are likely to be of a color * different from the default fg pixel, so we don't win anything by
different from the default fg pixel, so * building a standard one.
we don't win anything by building
a standard one.
*/ */
PixmapPtr PixmapPerDepth[1]; PixmapPtr defaultStipple;
void *devPrivate; void *devPrivate;
short numVisuals; short numVisuals;
VisualPtr visuals; VisualPtr visuals;