summaryrefslogtreecommitdiff
path: root/xserver/miext/cw/cw.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2010-12-05 15:36:12 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2010-12-05 15:36:12 +0000
commita90ee792d96752ad1b71b9ada922fa6afe478c99 (patch)
tree6143b00f7646951d23dfe2a4fe2992ca40b77069 /xserver/miext/cw/cw.c
parentbc97d4ecc0aa9e1b823565b07282f848700bd11a (diff)
Upgrade to xorg-server 1.9.2.
Tested by ajacoutot@, krw@, shadchin@ and jasper@ on various configurations including multihead with both zaphod and xrandr.
Diffstat (limited to 'xserver/miext/cw/cw.c')
-rw-r--r--xserver/miext/cw/cw.c76
1 files changed, 36 insertions, 40 deletions
diff --git a/xserver/miext/cw/cw.c b/xserver/miext/cw/cw.c
index 74000ffa0..58816c9a2 100644
--- a/xserver/miext/cw/cw.c
+++ b/xserver/miext/cw/cw.c
@@ -43,16 +43,11 @@
#define CW_ASSERT(x) do {} while (0)
#endif
-static int cwGCKeyIndex;
-DevPrivateKey cwGCKey = &cwGCKeyIndex;
-static int cwScreenKeyIndex;
-DevPrivateKey cwScreenKey = &cwScreenKeyIndex;
-static int cwWindowKeyIndex;
-DevPrivateKey cwWindowKey = &cwWindowKeyIndex;
-#ifdef RENDER
-static int cwPictureKeyIndex;
-DevPrivateKey cwPictureKey = &cwPictureKeyIndex;
-#endif
+DevPrivateKeyRec cwGCKeyRec;
+DevPrivateKeyRec cwScreenKeyRec;
+DevPrivateKeyRec cwWindowKeyRec;
+DevPrivateKeyRec cwPictureKeyRec;
+
extern GCOps cwGCOps;
static Bool
@@ -131,7 +126,7 @@ cwCreateBackingGC(GCPtr pGC, DrawablePtr pDrawable)
return FALSE;
pPriv->serialNumber = 0;
- pPriv->stateChanges = (1 << (GCLastBit + 1)) - 1;
+ pPriv->stateChanges = GCAllBits;
return TRUE;
}
@@ -190,11 +185,11 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable)
if (pDrawable->serialNumber != pPriv->serialNumber ||
(pPriv->stateChanges & (GCClipXOrigin|GCClipYOrigin|GCClipMask)))
{
- XID vals[2];
+ ChangeGCVal vals[2];
RegionPtr pCompositeClip;
- pCompositeClip = REGION_CREATE (pScreen, NULL, 0);
- REGION_COPY (pScreen, pCompositeClip, pGC->pCompositeClip);
+ pCompositeClip = RegionCreate(NULL, 0);
+ RegionCopy(pCompositeClip, pGC->pCompositeClip);
/* Either the drawable has changed, or the clip list in the drawable has
* changed. Copy the new clip list over and set the new translated
@@ -204,10 +199,10 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable)
(*pBackingGC->funcs->ChangeClip) (pBackingGC, CT_REGION,
(pointer) pCompositeClip, 0);
- vals[0] = x_off - pDrawable->x;
- vals[1] = y_off - pDrawable->y;
- dixChangeGC(NullClient, pBackingGC,
- (GCClipXOrigin | GCClipYOrigin), vals, NULL);
+ vals[0].val = x_off - pDrawable->x;
+ vals[1].val = y_off - pDrawable->y;
+ ChangeGC(NullClient, pBackingGC,
+ (GCClipXOrigin | GCClipYOrigin), vals);
pPriv->serialNumber = pDrawable->serialNumber;
/*
@@ -225,11 +220,11 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable)
if ((pGC->patOrg.x + x_off) != pBackingGC->patOrg.x ||
(pGC->patOrg.y + y_off) != pBackingGC->patOrg.y)
{
- XID vals[2];
- vals[0] = pGC->patOrg.x + x_off;
- vals[1] = pGC->patOrg.y + y_off;
- dixChangeGC(NullClient, pBackingGC,
- (GCTileStipXOrigin | GCTileStipYOrigin), vals, NULL);
+ ChangeGCVal vals[2];
+ vals[0].val = pGC->patOrg.x + x_off;
+ vals[1].val = pGC->patOrg.y + y_off;
+ ChangeGC(NullClient, pBackingGC,
+ (GCTileStipXOrigin | GCTileStipYOrigin), vals);
}
ValidateGC(pBackingDrawable, pBackingGC);
@@ -330,7 +325,7 @@ cwCreateGC(GCPtr pGC)
ScreenPtr pScreen = pGC->pScreen;
Bool ret;
- bzero(pPriv, sizeof(cwGCRec));
+ memset(pPriv, 0, sizeof(cwGCRec));
SCREEN_PROLOGUE(pScreen, CreateGC);
if ( (ret = (*pScreen->CreateGC)(pGC)) )
@@ -405,7 +400,7 @@ cwCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
dx = ptOldOrg.x - pWin->drawable.x;
dy = ptOldOrg.y - pWin->drawable.y;
- pExtents = REGION_EXTENTS(pScreen, prgnSrc);
+ pExtents = RegionExtents(prgnSrc);
pBackingPixmap = (PixmapPtr) cwGetBackingDrawable((DrawablePtr)pWin,
&x_off, &y_off);
@@ -418,15 +413,15 @@ cwCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
dst_y = src_y - dy;
/* Translate region (as required by API) */
- REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy);
+ RegionTranslate(prgnSrc, -dx, -dy);
pGC = GetScratchGC(pBackingPixmap->drawable.depth, pScreen);
/*
* Copy region to GC as clip, aligning as dest clip
*/
- pClip = REGION_CREATE (pScreen, NULL, 0);
- REGION_INTERSECT(pScreen, pClip, &pWin->borderClip, prgnSrc);
- REGION_TRANSLATE(pScreen, pClip,
+ pClip = RegionCreate(NULL, 0);
+ RegionIntersect(pClip, &pWin->borderClip, prgnSrc);
+ RegionTranslate(pClip,
-pBackingPixmap->screen_x,
-pBackingPixmap->screen_y);
@@ -477,14 +472,21 @@ void
miInitializeCompositeWrapper(ScreenPtr pScreen)
{
cwScreenPtr pScreenPriv;
-#ifdef RENDER
Bool has_render = GetPictureScreenIfSet(pScreen) != NULL;
-#endif
- if (!dixRequestPrivate(cwGCKey, sizeof(cwGCRec)))
+ if (!dixRegisterPrivateKey(&cwScreenKeyRec, PRIVATE_SCREEN, 0))
+ return;
+
+ if (!dixRegisterPrivateKey(&cwGCKeyRec, PRIVATE_GC, sizeof(cwGCRec)))
+ return;
+
+ if (!dixRegisterPrivateKey(&cwWindowKeyRec, PRIVATE_WINDOW, 0))
+ return;
+
+ if (!dixRegisterPrivateKey(&cwPictureKeyRec, PRIVATE_PICTURE, 0))
return;
- pScreenPriv = xalloc(sizeof(cwScreenRec));
+ pScreenPriv = malloc(sizeof(cwScreenRec));
if (!pScreenPriv)
return;
@@ -499,19 +501,15 @@ miInitializeCompositeWrapper(ScreenPtr pScreen)
SCREEN_EPILOGUE(pScreen, SetWindowPixmap, cwSetWindowPixmap);
SCREEN_EPILOGUE(pScreen, GetWindowPixmap, cwGetWindowPixmap);
-#ifdef RENDER
if (has_render)
cwInitializeRender(pScreen);
-#endif
}
static Bool
cwCloseScreen (int i, ScreenPtr pScreen)
{
cwScreenPtr pScreenPriv;
-#ifdef RENDER
PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
-#endif
pScreenPriv = (cwScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
cwScreenKey);
@@ -521,12 +519,10 @@ cwCloseScreen (int i, ScreenPtr pScreen)
pScreen->CreateGC = pScreenPriv->CreateGC;
pScreen->CopyWindow = pScreenPriv->CopyWindow;
-#ifdef RENDER
if (ps)
cwFiniRender(pScreen);
-#endif
- xfree((pointer)pScreenPriv);
+ free((pointer)pScreenPriv);
return (*pScreen->CloseScreen)(i, pScreen);
}