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 /Xext/shm.c | |
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 'Xext/shm.c')
-rw-r--r-- | Xext/shm.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/Xext/shm.c b/Xext/shm.c index 7fa834952..8fa584275 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -119,7 +119,7 @@ static int pixmapFormat; static int shmPixFormat[MAXSCREENS]; static ShmFuncsPtr shmFuncs[MAXSCREENS]; static DestroyPixmapProcPtr destroyPixmap[MAXSCREENS]; -static int shmPixmapPrivate; +static DevPrivateKey shmPixmapPrivate = &shmPixmapPrivate; static ShmFuncs miFuncs = {NULL, miShmPutImage}; static ShmFuncs fbFuncs = {fbShmCreatePixmap, fbShmPutImage}; @@ -229,20 +229,11 @@ ShmExtensionInit(INITARGS) if (!pixmapFormat) pixmapFormat = ZPixmap; if (sharedPixmaps) - { for (i = 0; i < screenInfo.numScreens; i++) { destroyPixmap[i] = screenInfo.screens[i]->DestroyPixmap; screenInfo.screens[i]->DestroyPixmap = ShmDestroyPixmap; } - shmPixmapPrivate = AllocatePixmapPrivateIndex(); - for (i = 0; i < screenInfo.numScreens; i++) - { - if (!AllocatePixmapPrivate(screenInfo.screens[i], - shmPixmapPrivate, 0)) - return; - } - } } ShmSegType = CreateNewResourceType(ShmDetachSegment); if (ShmSegType && @@ -295,7 +286,8 @@ ShmDestroyPixmap (PixmapPtr pPixmap) if (pPixmap->refcnt == 1) { ShmDescPtr shmdesc; - shmdesc = (ShmDescPtr) pPixmap->devPrivates[shmPixmapPrivate].ptr; + shmdesc = (ShmDescPtr)dixLookupPrivate(&pPixmap->devPrivates, + shmPixmapPrivate); if (shmdesc) ShmDetachSegment ((pointer) shmdesc, pPixmap->drawable.id); } @@ -762,7 +754,7 @@ CreatePmap: shmdesc->addr + stuff->offset); if (pMap) { - pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc; + dixSetPrivate(&pMap->devPrivates, shmPixmapPrivate, shmdesc); shmdesc->refcnt++; pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; pMap->drawable.id = newPix->info[j].id; @@ -1076,7 +1068,7 @@ CreatePmap: shmdesc->addr + stuff->offset); if (pMap) { - pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc; + dixSetPrivate(&pMap->devPrivates, shmPixmapPrivate, shmdesc); shmdesc->refcnt++; pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; pMap->drawable.id = stuff->pid; |