diff options
author | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2007-08-28 09:28:25 -0400 |
---|---|---|
committer | Eamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil> | 2007-08-28 09:28:25 -0400 |
commit | 4017d3190234e189a0bbd33193a148d4d3c7556b (patch) | |
tree | 2ab228113d410386afde50c893f137d95974b8f3 /miext/shadow | |
parent | 85547073265ae9bc4ae3af920a6d3214fd1ca0c5 (diff) |
devPrivates rework: since API is already broken, switch everything
over to new system.
Need to update documentation and address some remaining vestiges of
old system such as CursorRec structure, fb "offman" structure, and
FontRec privates.
Diffstat (limited to 'miext/shadow')
-rw-r--r-- | miext/shadow/shadow.c | 15 | ||||
-rw-r--r-- | miext/shadow/shadow.h | 5 |
2 files changed, 7 insertions, 13 deletions
diff --git a/miext/shadow/shadow.c b/miext/shadow/shadow.c index f624216db..74544b1a0 100644 --- a/miext/shadow/shadow.c +++ b/miext/shadow/shadow.c @@ -36,8 +36,7 @@ #include "gcstruct.h" #include "shadow.h" -int shadowScrPrivateIndex; -int shadowGeneration; +DevPrivateKey shadowScrPrivateKey = &shadowScrPrivateKey; #define wrap(priv, real, mem) {\ priv->mem = real->mem; \ @@ -116,7 +115,8 @@ static void shadowReportFunc(DamagePtr pDamage, RegionPtr pRegion, void *closure) { ScreenPtr pScreen = closure; - shadowBufPtr pBuf = pScreen->devPrivates[shadowScrPrivateIndex].ptr; + shadowBufPtr pBuf = (shadowBufPtr) + dixLookupPrivate(&pScreen->devPrivates, shadowScrPrivateKey); /* Register the damaged region, use DamageReportNone below when we * want to break BC below... */ @@ -138,13 +138,6 @@ shadowSetup(ScreenPtr pScreen) if (!DamageSetup(pScreen)) return FALSE; - if (shadowGeneration != serverGeneration) { - shadowScrPrivateIndex = AllocateScreenPrivateIndex(); - if (shadowScrPrivateIndex == -1) - return FALSE; - shadowGeneration = serverGeneration; - } - pBuf = (shadowBufPtr) xalloc(sizeof(shadowBufRec)); if (!pBuf) return FALSE; @@ -175,7 +168,7 @@ shadowSetup(ScreenPtr pScreen) REGION_NULL(pScreen, &pBuf->damage); /* bc */ #endif - pScreen->devPrivates[shadowScrPrivateIndex].ptr = (pointer) pBuf; + dixSetPrivate(&pScreen->devPrivates, shadowScrPrivateKey, pBuf); return TRUE; } diff --git a/miext/shadow/shadow.h b/miext/shadow/shadow.h index 8986809f4..2e45df2b5 100644 --- a/miext/shadow/shadow.h +++ b/miext/shadow/shadow.h @@ -74,9 +74,10 @@ typedef struct _shadowBuf { #define SHADOW_REFLECT_Y 32 #define SHADOW_REFLECT_ALL (SHADOW_REFLECT_X|SHADOW_REFLECT_Y) -extern int shadowScrPrivateIndex; +extern DevPrivateKey shadowScrPrivateKey; -#define shadowGetBuf(pScr) ((shadowBufPtr) (pScr)->devPrivates[shadowScrPrivateIndex].ptr) +#define shadowGetBuf(pScr) ((shadowBufPtr) \ + dixLookupPrivate(&(pScr)->devPrivates, shadowScrPrivateKey)) #define shadowBuf(pScr) shadowBufPtr pBuf = shadowGetBuf(pScr) #define shadowDamage(pBuf) DamageRegion(pBuf->pDamage) |