diff options
Diffstat (limited to 'cfb/cfballpriv.c')
-rw-r--r-- | cfb/cfballpriv.c | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/cfb/cfballpriv.c b/cfb/cfballpriv.c index 858ff6061..3b58266c5 100644 --- a/cfb/cfballpriv.c +++ b/cfb/cfballpriv.c @@ -45,38 +45,26 @@ in this Software without prior written authorization from The Open Group. #include "mibstore.h" #if 1 || PSZ==8 -int cfbGCPrivateIndex = -1; +DevPrivateKey cfbGCPrivateKey = &cfbGCPrivateKey; #endif #ifdef CFB_NEED_SCREEN_PRIVATE -int cfbScreenPrivateIndex = -1; -static unsigned long cfbGeneration = 0; +DevPrivateKey cfbScreenPrivateKey = &cfbScreenPrivateKey; #endif Bool -cfbAllocatePrivates(ScreenPtr pScreen, int *gc_index) +cfbAllocatePrivates(ScreenPtr pScreen, DevPrivateKey *gc_key) { - if (!gc_index || *gc_index == -1) + if (!gc_key || !*gc_key) { - if (!mfbAllocatePrivates(pScreen, &cfbGCPrivateIndex)) + if (!mfbAllocatePrivates(pScreen, &cfbGCPrivateKey)) return FALSE; - if (gc_index) - *gc_index = cfbGCPrivateIndex; + if (gc_key) + *gc_key = cfbGCPrivateKey; } else { - cfbGCPrivateIndex = *gc_index; + cfbGCPrivateKey = *gc_key; } - if (!AllocateGCPrivate(pScreen, cfbGCPrivateIndex, sizeof(cfbPrivGC))) - return FALSE; -#ifdef CFB_NEED_SCREEN_PRIVATE - if (cfbGeneration != serverGeneration) - { - cfbScreenPrivateIndex = AllocateScreenPrivateIndex (); - cfbGeneration = serverGeneration; - } - if (cfbScreenPrivateIndex == -1) - return FALSE; -#endif - return TRUE; + return dixRequestPrivate(cfbGCPrivateKey, sizeof(cfbPrivGC)); } |