diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2019-07-27 07:57:27 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2019-07-27 07:57:27 +0000 |
commit | d4a0bed4b91da9de86c311c7fef9a8aa9a6f500c (patch) | |
tree | a1b439049dee87bc951e190db93f5bbe8b43b0b5 /xserver/dix/gc.c | |
parent | b6bc775539a31f663f9e22ce3ccaf0aa96adf3b6 (diff) |
Update to xserver 1.20.5. Tested by jsg@
Diffstat (limited to 'xserver/dix/gc.c')
-rw-r--r-- | xserver/dix/gc.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/xserver/dix/gc.c b/xserver/dix/gc.c index 78f3be29d..4ccbd3b54 100644 --- a/xserver/dix/gc.c +++ b/xserver/dix/gc.c @@ -439,7 +439,7 @@ ChangeGCXIDs(ClientPtr client, GC * pGC, BITS32 mask, CARD32 *pC32) } for (i = Ones(mask); i--;) vals[i].val = pC32[i]; - for (i = 0; i < sizeof(xidfields) / sizeof(*xidfields); ++i) { + for (i = 0; i < ARRAY_SIZE(xidfields); ++i) { int offset, rc; if (!(mask & xidfields[i].mask)) @@ -504,7 +504,7 @@ NewGCObject(ScreenPtr pScreen, int depth) pGC->font = defaultFont; if (pGC->font) /* necessary, because open of default font could fail */ pGC->font->refcnt++; - pGC->stipple = pGC->pScreen->PixmapPerDepth[0]; + pGC->stipple = pGC->pScreen->defaultStipple; if (pGC->stipple) pGC->stipple->refcnt++; @@ -811,6 +811,7 @@ CreateScratchGC(ScreenPtr pScreen, unsigned depth) FreeGC(pGC, (XID) 0); pGC = (GCPtr) NULL; } + pGC->graphicsExposures = FALSE; return pGC; } @@ -843,7 +844,6 @@ CreateGCperDepth(int screenNum) /* do depth 1 separately because it's not included in list */ if (!(ppGC[0] = CreateScratchGC(pScreen, 1))) return FALSE; - ppGC[0]->graphicsExposures = FALSE; /* Make sure we don't overflow GCperDepth[] */ if (pScreen->numDepths > MAXFORMATS) return FALSE; @@ -855,7 +855,6 @@ CreateGCperDepth(int screenNum) (void) FreeGC(ppGC[i], (XID) 0); return FALSE; } - ppGC[i + 1]->graphicsExposures = FALSE; } return TRUE; } @@ -874,8 +873,7 @@ CreateDefaultStipple(int screenNum) w = 16; h = 16; (*pScreen->QueryBestSize) (StippleShape, &w, &h, pScreen); - if (!(pScreen->PixmapPerDepth[0] = - (*pScreen->CreatePixmap) (pScreen, w, h, 1, 0))) + if (!(pScreen->defaultStipple = pScreen->CreatePixmap(pScreen, w, h, 1, 0))) return FALSE; /* fill stipple with 1 */ tmpval[0].val = GXcopy; @@ -883,17 +881,17 @@ CreateDefaultStipple(int screenNum) tmpval[2].val = FillSolid; pgcScratch = GetScratchGC(1, pScreen); if (!pgcScratch) { - (*pScreen->DestroyPixmap) (pScreen->PixmapPerDepth[0]); + (*pScreen->DestroyPixmap) (pScreen->defaultStipple); return FALSE; } (void) ChangeGC(NullClient, pgcScratch, GCFunction | GCForeground | GCFillStyle, tmpval); - ValidateGC((DrawablePtr) pScreen->PixmapPerDepth[0], pgcScratch); + ValidateGC((DrawablePtr) pScreen->defaultStipple, pgcScratch); rect.x = 0; rect.y = 0; rect.width = w; rect.height = h; - (*pgcScratch->ops->PolyFillRect) ((DrawablePtr) pScreen->PixmapPerDepth[0], + (*pgcScratch->ops->PolyFillRect) ((DrawablePtr) pScreen->defaultStipple, pgcScratch, 1, &rect); FreeScratchGC(pgcScratch); return TRUE; @@ -904,7 +902,7 @@ FreeDefaultStipple(int screenNum) { ScreenPtr pScreen = screenInfo.screens[screenNum]; - (*pScreen->DestroyPixmap) (pScreen->PixmapPerDepth[0]); + (*pScreen->DestroyPixmap) (pScreen->defaultStipple); } int @@ -1073,10 +1071,7 @@ GetScratchGC(unsigned depth, ScreenPtr pScreen) } } /* if we make it this far, need to roll our own */ - pGC = CreateScratchGC(pScreen, depth); - if (pGC) - pGC->graphicsExposures = FALSE; - return pGC; + return CreateScratchGC(pScreen, depth); } /* |