diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-01-03 17:04:54 +1030 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-01-03 17:04:54 +1030 |
commit | 8da83836b60f7cdb75d08482f4311fa0e2ab4e1d (patch) | |
tree | 092efcfc39e3e293baaf04c4c84027ee453d3e13 /hw/xfree86/xf8_32bpp/xf86overlay.c | |
parent | eace88989c3b65d5c20e9f37ea9b23c7c8e19335 (diff) | |
parent | ae869fc7669764729e13fdd70149ed636753f2a3 (diff) |
Merge branch 'master' into mpx
Conflicts:
XTrap/xtrapddmi.c
Xext/security.c
Xext/xprint.c
Xext/xtest.c
Xext/xvdisp.c
Xi/exevents.c
Xi/grabdevb.c
Xi/grabdevk.c
Xi/opendev.c
Xi/ungrdev.c
Xi/ungrdevb.c
Xi/ungrdevk.c
dix/cursor.c
dix/devices.c
dix/dixutils.c
dix/events.c
dix/getevents.c
dix/main.c
dix/window.c
hw/xfree86/ramdac/xf86Cursor.c
include/dix.h
include/input.h
include/inputstr.h
mi/midispcur.c
mi/miinitext.c
mi/misprite.c
render/animcur.c
xfixes/cursor.c
xkb/xkbAccessX.c
Diffstat (limited to 'hw/xfree86/xf8_32bpp/xf86overlay.c')
-rw-r--r-- | hw/xfree86/xf8_32bpp/xf86overlay.c | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/hw/xfree86/xf8_32bpp/xf86overlay.c b/hw/xfree86/xf8_32bpp/xf86overlay.c index 47b2b52db..c63b3cfd1 100644 --- a/hw/xfree86/xf8_32bpp/xf86overlay.c +++ b/hw/xfree86/xf8_32bpp/xf86overlay.c @@ -177,23 +177,22 @@ typedef struct { } OverlayPixmapRec, *OverlayPixmapPtr; -static int OverlayScreenIndex = -1; -static int OverlayGCIndex = -1; -static int OverlayPixmapIndex = -1; -static unsigned long OverlayGeneration = 0; +static DevPrivateKey OverlayScreenKey = &OverlayScreenKey; +static DevPrivateKey OverlayGCKey = &OverlayGCKey; +static DevPrivateKey OverlayPixmapKey = &OverlayPixmapKey; /** Macros **/ #define TILE_EXISTS(pGC) (!(pGC)->tileIsPixel && (pGC)->tile.pixmap) -#define OVERLAY_GET_PIXMAP_PRIVATE(pPix) \ - (OverlayPixmapPtr)((pPix)->devPrivates[OverlayPixmapIndex].ptr) +#define OVERLAY_GET_PIXMAP_PRIVATE(pPix) ((OverlayPixmapPtr) \ + dixLookupPrivate(&(pPix)->devPrivates, OverlayPixmapKey)) -#define OVERLAY_GET_SCREEN_PRIVATE(pScreen) \ - (OverlayScreenPtr)((pScreen)->devPrivates[OverlayScreenIndex].ptr) +#define OVERLAY_GET_SCREEN_PRIVATE(pScreen) ((OverlayScreenPtr) \ + dixLookupPrivate(&(pScreen)->devPrivates, OverlayScreenKey)) -#define OVERLAY_GET_GC_PRIVATE(pGC) \ - (OverlayGCPtr)((pGC)->devPrivates[OverlayGCIndex].ptr) +#define OVERLAY_GET_GC_PRIVATE(pGC) ((OverlayGCPtr) \ + dixLookupPrivate(&(pGC)->devPrivates, OverlayGCKey)) #define OVERLAY_GC_FUNC_PROLOGUE(pGC)\ OverlayGCPtr pGCPriv = OVERLAY_GET_GC_PRIVATE(pGC);\ @@ -255,26 +254,16 @@ xf86Overlay8Plus32Init (ScreenPtr pScreen) { OverlayScreenPtr pScreenPriv; - if(OverlayGeneration != serverGeneration) { - if(((OverlayScreenIndex = AllocateScreenPrivateIndex()) < 0) || - ((OverlayGCIndex = AllocateGCPrivateIndex()) < 0) || - ((OverlayPixmapIndex = AllocatePixmapPrivateIndex()) < 0)) - return FALSE; - - OverlayGeneration = serverGeneration; - } - - if (!AllocateGCPrivate(pScreen, OverlayGCIndex, sizeof(OverlayGCRec))) + if (!dixRequestPrivate(OverlayGCKey, sizeof(OverlayGCRec))) return FALSE; - if (!AllocatePixmapPrivate(pScreen, OverlayPixmapIndex, - sizeof(OverlayPixmapRec))) + if (!dixRequestPrivate(OverlayPixmapKey, sizeof(OverlayPixmapRec))) return FALSE; if (!(pScreenPriv = xalloc(sizeof(OverlayScreenRec)))) return FALSE; - pScreen->devPrivates[OverlayScreenIndex].ptr = (pointer)pScreenPriv; + dixSetPrivate(&pScreen->devPrivates, OverlayScreenKey, pScreenPriv); pScreenPriv->CreateGC = pScreen->CreateGC; pScreenPriv->CloseScreen = pScreen->CloseScreen; |