static Bool cfb8_32WidAllocatePrivates(ScreenPtr pScreen) { cfb8_32WidScreenPtr pScreenPriv; if (cfb8_32WidGeneration != serverGeneration) { if ((cfb8_32WidScreenPrivateIndex = AllocateScreenPrivateIndex()) < 0) return FALSE; cfb8_32WidGeneration = serverGeneration; } if (!(pScreenPriv = xalloc(sizeof(cfb8_32WidScreenRec)))) return FALSE; pScreen->devPrivates[cfb8_32WidScreenPrivateIndex].ptr = (pointer)pScreenPriv; /* All cfb will have the same GC and Window private indicies */ if (!mfbAllocatePrivates(pScreen, &cfbWindowPrivateIndex, &cfbGCPrivateIndex)) return FALSE; /* The cfb indicies are the mfb indicies. Reallocating them resizes them */ if (!AllocateWindowPrivate(pScreen, cfbWindowPrivateIndex, sizeof(cfbPrivWin))) return FALSE; if (!AllocateGCPrivate(pScreen, cfbGCPrivateIndex, sizeof(cfbPrivGC))) return FALSE; return TRUE; }
static Bool cfb24_32AllocatePrivates(ScreenPtr pScreen) { if(cfb24_32Generation != serverGeneration) { if( ((cfb24_32GCIndex = AllocateGCPrivateIndex()) < 0) | ((cfb24_32PixmapIndex = AllocatePixmapPrivateIndex()) < 0)) return FALSE; cfb24_32Generation = serverGeneration; } /* All cfb will have the same GC and Window private indicies */ if(!mfbAllocatePrivates(pScreen,&cfbWindowPrivateIndex, &cfbGCPrivateIndex)) return FALSE; /* The cfb indicies are the mfb indicies. Reallocating them resizes them */ if(!AllocateWindowPrivate(pScreen,cfbWindowPrivateIndex,sizeof(cfbPrivWin))) return FALSE; if(!AllocateGCPrivate(pScreen, cfbGCPrivateIndex, sizeof(cfbPrivGC))) return FALSE; if(!AllocateGCPrivate(pScreen, cfb24_32GCIndex, sizeof(cfb24_32GCRec))) return FALSE; if(!AllocatePixmapPrivate( pScreen, cfb24_32PixmapIndex, sizeof(cfb24_32PixmapRec))) return FALSE; return TRUE; }