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.
This commit is contained in:
Eamon Walsh 2007-08-28 09:28:25 -04:00 • committed by Eamon Walsh
commit 4017d31902
261 changed files with 1642 additions and 3957 deletions

View file

@ -90,10 +90,8 @@ typedef struct {
int depth;
} xaaWrapperScrPrivRec, *xaaWrapperScrPrivPtr;
#define xaaWrapperGetScrPriv(s) ((xaaWrapperScrPrivPtr)( \
(xaaWrapperScrPrivateIndex != -1) \
? (s)->devPrivates[xaaWrapperScrPrivateIndex].ptr\
: NULL))
#define xaaWrapperGetScrPriv(s) ((xaaWrapperScrPrivPtr) \
dixLookupPrivate(&(s)->devPrivates, xaaWrapperScrPrivateKey))
#define xaaWrapperScrPriv(s) xaaWrapperScrPrivPtr pScrPriv = xaaWrapperGetScrPriv(s)
#define wrap(priv,real,mem,func) {\
@ -131,13 +129,12 @@ typedef struct _xaaWrapperGCPriv {
} xaaWrapperGCPrivRec, *xaaWrapperGCPrivPtr;
#define xaaWrapperGetGCPriv(pGC) ((xaaWrapperGCPrivPtr) \
(pGC)->devPrivates[xaaWrapperGCPrivateIndex].ptr)
dixLookupPrivate(&(pGC)->devPrivates, xaaWrapperGCPrivateKey))
#define xaaWrapperGCPriv(pGC) xaaWrapperGCPrivPtr pGCPriv = xaaWrapperGetGCPriv(pGC)
static int xaaWrapperScrPrivateIndex = -1;
static int xaaWrapperGCPrivateIndex = -1;
static int xaaWrapperGeneration = -1;
static DevPrivateKey xaaWrapperScrPrivateKey = &xaaWrapperScrPrivateKey;
static DevPrivateKey xaaWrapperGCPrivateKey = &xaaWrapperGCPrivateKey;
static Bool
xaaWrapperCreateScreenResources(ScreenPtr pScreen)
@ -305,18 +302,8 @@ xaaSetupWrapper(ScreenPtr pScreen, XAAInfoRecPtr infoPtr, int depth, SyncFunc *f
#ifdef RENDER
PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
#endif
if (xaaWrapperGeneration != serverGeneration) {
xaaWrapperScrPrivateIndex = AllocateScreenPrivateIndex ();
if (xaaWrapperScrPrivateIndex == -1)
return FALSE;
xaaWrapperGCPrivateIndex = AllocateGCPrivateIndex ();
if (xaaWrapperGCPrivateIndex == -1)
return FALSE;
xaaWrapperGeneration = serverGeneration;
}
if (!AllocateGCPrivate (pScreen, xaaWrapperGCPrivateIndex,
sizeof (xaaWrapperGCPrivRec)))
if (!dixRequestPrivate(xaaWrapperGCPrivateKey, sizeof(xaaWrapperGCPrivRec)))
return FALSE;
pScrPriv = (xaaWrapperScrPrivPtr) xalloc (sizeof (xaaWrapperScrPrivRec));
@ -370,7 +357,7 @@ xaaSetupWrapper(ScreenPtr pScreen, XAAInfoRecPtr infoPtr, int depth, SyncFunc *f
}
#endif
pScrPriv->depth = depth;
pScreen->devPrivates[xaaWrapperScrPrivateIndex].ptr = (pointer) pScrPriv;
dixSetPrivate(&pScreen->devPrivates, xaaWrapperScrPrivateKey, pScrPriv);
*func = XAASync;
@ -521,8 +508,8 @@ xaaWrapperGlyphs (CARD8 op, PicturePtr pSrc, PicturePtr pDst,
void
XAASync(ScreenPtr pScreen)
{
XAAScreenPtr pScreenPriv =
(XAAScreenPtr) pScreen->devPrivates[XAAGetScreenIndex()].ptr;
XAAScreenPtr pScreenPriv = (XAAScreenPtr)
dixLookupPrivate(&pScreen->devPrivates, XAAGetScreenKey());
XAAInfoRecPtr infoRec = pScreenPriv->AccelInfoRec;
if(infoRec->NeedToSync) {