summaryrefslogtreecommitdiff
path: root/afb
diff options
context:
space:
mode:
Diffstat (limited to 'afb')
-rw-r--r--afb/afb.h18
-rw-r--r--afb/afbfillarc.c3
-rw-r--r--afb/afbfillrct.c3
-rw-r--r--afb/afbfillsp.c15
-rw-r--r--afb/afbgc.c7
-rw-r--r--afb/afbimggblt.c4
-rw-r--r--afb/afbline.c6
-rw-r--r--afb/afbpixmap.c2
-rw-r--r--afb/afbply1rct.c4
-rw-r--r--afb/afbplygblt.c4
-rw-r--r--afb/afbpntwin.c4
-rw-r--r--afb/afbpolypnt.c4
-rw-r--r--afb/afbscrinit.c52
-rw-r--r--afb/afbtegblt.c4
-rw-r--r--afb/afbwindow.c19
-rw-r--r--afb/afbzerarc.c4
16 files changed, 80 insertions, 73 deletions
diff --git a/afb/afb.h b/afb/afb.h
index 31ccff9ee..5cfbddfb1 100644
--- a/afb/afb.h
+++ b/afb/afb.h
@@ -60,7 +60,6 @@ SOFTWARE.
#include "mfb.h"
extern int afbInverseAlu[];
-extern int afbScreenPrivateIndex;
/* warning: PixelType definition duplicated in maskbits.h */
#ifndef PixelType
#define PixelType CARD32
@@ -736,14 +735,15 @@ typedef struct {
} afbPrivGC;
typedef afbPrivGC *afbPrivGCPtr;
-extern int afbGCPrivateIndex; /* index into GC private array */
-extern int afbWindowPrivateIndex; /* index into Window private array */
+extern DevPrivateKey afbScreenPrivateKey;
+extern DevPrivateKey afbGCPrivateKey;
+extern DevPrivateKey afbWindowPrivateKey;
#ifdef PIXMAP_PER_WINDOW
-extern int frameWindowPrivateIndex; /* index into Window private array */
+extern DevPrivateKey frameWindowPrivateKey;
#endif
#define afbGetGCPrivate(pGC) \
- ((afbPrivGC *)((pGC)->devPrivates[afbGCPrivateIndex].ptr))
+ ((afbPrivGC *)dixLookupPrivate(&(pGC)->devPrivates, afbGCPrivateKey))
/* private field of window */
typedef struct {
@@ -759,7 +759,7 @@ typedef struct {
#define afbGetTypedWidth(pDrawable,wtype)( \
(((pDrawable)->type == DRAWABLE_WINDOW) ? \
- (int)(((PixmapPtr)((pDrawable)->pScreen->devPrivates[afbScreenPrivateIndex].ptr))->devKind) : \
+ (int)(((PixmapPtr)dixLookupPrivate(&(pDrawable)->pScreen->devPrivates, afbScreenPrivateKey)->devKind) : \
(int)(((PixmapPtr)pDrawable)->devKind)) / sizeof (wtype))
#define afbGetByteWidth(pDrawable) afbGetTypedWidth(pDrawable, unsigned char)
@@ -769,7 +769,7 @@ typedef struct {
#define afbGetTypedWidthAndPointer(pDrawable, width, pointer, wtype, ptype) {\
PixmapPtr _pPix; \
if ((pDrawable)->type == DRAWABLE_WINDOW) \
- _pPix = (PixmapPtr)(pDrawable)->pScreen->devPrivates[afbScreenPrivateIndex].ptr; \
+ _pPix = (PixmapPtr)dixLookupPrivate(&(pDrawable)->pScreen->devPrivates, afbScreenPrivateKey); \
else \
_pPix = (PixmapPtr)(pDrawable); \
(pointer) = (ptype *) _pPix->devPrivate.ptr; \
@@ -779,7 +779,7 @@ typedef struct {
#define afbGetPixelWidthSizeDepthAndPointer(pDrawable, width, size, dep, pointer) {\
PixmapPtr _pPix; \
if ((pDrawable)->type == DRAWABLE_WINDOW) \
- _pPix = (PixmapPtr)(pDrawable)->pScreen->devPrivates[afbScreenPrivateIndex].ptr; \
+ _pPix = (PixmapPtr)dixLookupPrivate(&(pDrawable)->pScreen->devPrivates, afbScreenPrivateKey); \
else \
_pPix = (PixmapPtr)(pDrawable); \
(pointer) = (PixelType *)_pPix->devPrivate.ptr; \
@@ -795,7 +795,7 @@ typedef struct {
afbGetTypedWidthAndPointer(pDrawable, width, pointer, PixelType, PixelType)
#define afbGetWindowTypedWidthAndPointer(pWin, width, pointer, wtype, ptype) {\
- PixmapPtr _pPix = (PixmapPtr)(pWin)->drawable.pScreen->devPrivates[afbScreenPrivateIndex].ptr; \
+ PixmapPtr _pPix = (PixmapPtr)dixLookupPrivate(&(pWin)->drawable.pScreen->devPrivates, afbScreenPrivateKey); \
(pointer) = (ptype *) _pPix->devPrivate.ptr; \
(width) = ((int) _pPix->devKind) / sizeof (wtype); \
}
diff --git a/afb/afbfillarc.c b/afb/afbfillarc.c
index fa685ba9a..cfc3133ee 100644
--- a/afb/afbfillarc.c
+++ b/afb/afbfillarc.c
@@ -321,7 +321,8 @@ afbPolyFillArcSolid(register DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parc
RegionPtr cclip;
unsigned char *rrops;
- priv = (afbPrivGC *) pGC->devPrivates[afbGCPrivateIndex].ptr;
+ priv = (afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
+ afbGCPrivateKey);
rrops = priv->rrops;
cclip = pGC->pCompositeClip;
for (arc = parcs, i = narcs; --i >= 0; arc++) {
diff --git a/afb/afbfillrct.c b/afb/afbfillrct.c
index 06fb37365..b4936f097 100644
--- a/afb/afbfillrct.c
+++ b/afb/afbfillrct.c
@@ -93,7 +93,8 @@ afbPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, xRectangle *pre
unsigned char *rrops;
unsigned char *rropsOS;
- priv = (afbPrivGC *)pGC->devPrivates[afbGCPrivateIndex].ptr;
+ priv = (afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
+ afbGCPrivateKey);
prgnClip = pGC->pCompositeClip;
rrops = priv->rrops;
rropsOS = priv->rropOS;
diff --git a/afb/afbfillsp.c b/afb/afbfillsp.c
index 539c3457c..0118b475a 100644
--- a/afb/afbfillsp.c
+++ b/afb/afbfillsp.c
@@ -123,7 +123,8 @@ afbSolidFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst,
pBase);
- rrops = ((afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr))->rrops;
+ rrops = ((afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
+ afbGCPrivateKey))->rrops;
while (n--) {
addrlBase = afbScanline(pBase, ppt->x, ppt->y, nlwidth);
@@ -238,8 +239,8 @@ afbStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
tileHeight = pStipple->drawable.height;
psrc = (PixelType *)(pStipple->devPrivate.ptr);
- rrops = ((afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr))->rrops;
-
+ rrops = ((afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
+ afbGCPrivateKey))->rrops;
while (n--) {
src = psrc[ppt->y % tileHeight];
addrlBase = afbScanline(pBase, ppt->x, ppt->y, nlwidth);
@@ -484,8 +485,8 @@ afbOpaqueStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
tileHeight = pTile->drawable.height;
psrc = (PixelType *)(pTile->devPrivate.ptr);
rop = pGC->alu;
- rropsOS = ((afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr))->rropOS;
-
+ rropsOS = ((afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
+ afbGCPrivateKey))->rropOS;
switch(rop) {
case GXcopy:
while (n--) {
@@ -793,8 +794,8 @@ afbUnnaturalStippleFS(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
tileWidth = pTile->drawable.width;
tileHeight = pTile->drawable.height;
- rrops = ((afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr))->rrops;
-
+ rrops = ((afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
+ afbGCPrivateKey))->rrops;
/* this replaces rotating the stipple. Instead, we just adjust the offset
* at which we start grabbing bits from the stipple.
* Ensure that ppt->x - xSrc >= 0 and ppt->y - ySrc >= 0,
diff --git a/afb/afbgc.c b/afb/afbgc.c
index 59c09e097..1d1fdc58b 100644
--- a/afb/afbgc.c
+++ b/afb/afbgc.c
@@ -154,7 +154,8 @@ afbCreateGC(pGC)
/* afb wants to translate before scan convesion */
pGC->miTranslate = 1;
- pPriv = (afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr);
+ pPriv = (afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
+ afbGCPrivateKey);
afbReduceRop(pGC->alu, pGC->fgPixel, pGC->planemask, pGC->depth,
pPriv->rrops);
afbReduceOpaqueStipple(pGC->fgPixel, pGC->bgPixel, pGC->planemask,
@@ -295,8 +296,8 @@ afbValidateGC(pGC, changes, pDrawable)
(oldOrg.y != pGC->lastWinOrg.y);
- devPriv = ((afbPrivGCPtr)(pGC->devPrivates[afbGCPrivateIndex].ptr));
-
+ devPriv = (afbPrivGCPtr)dixLookupPrivate(&pGC->devPrivates,
+ afbGCPrivateKey);
/*
if the client clip is different or moved OR
diff --git a/afb/afbimggblt.c b/afb/afbimggblt.c
index de02aa46a..824f918bc 100644
--- a/afb/afbimggblt.c
+++ b/afb/afbimggblt.c
@@ -145,8 +145,8 @@ afbImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
register int nFirst;/* bits of glyph in current longword */
PixelType *pdstSave;
int oldFill;
- afbPrivGC *pPriv = (afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr);
-
+ afbPrivGC *pPriv = (afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
+ afbGCPrivateKey);
xorg = pDrawable->x;
yorg = pDrawable->y;
afbGetPixelWidthSizeDepthAndPointer(pDrawable, widthDst, sizeDst, depthDst,
diff --git a/afb/afbline.c b/afb/afbline.c
index 9e2e4b9f4..d05675869 100644
--- a/afb/afbline.c
+++ b/afb/afbline.c
@@ -147,7 +147,8 @@ afbLineSS(pDrawable, pGC, mode, npt, pptInit)
RegionPtr cclip;
cclip = pGC->pCompositeClip;
- rrops = ((afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr))->rrops;
+ rrops = ((afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
+ afbGCPrivateKey))->rrops;
pboxInit = REGION_RECTS(cclip);
nboxInit = REGION_NUM_RECTS(cclip);
@@ -487,7 +488,8 @@ afbLineSD(pDrawable, pGC, mode, npt, pptInit)
#endif
cclip = pGC->pCompositeClip;
- rrops = ((afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr))->rrops;
+ rrops = ((afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
+ afbGCPrivateKey))->rrops;
pboxInit = REGION_RECTS(cclip);
nboxInit = REGION_NUM_RECTS(cclip);
diff --git a/afb/afbpixmap.c b/afb/afbpixmap.c
index 5a81679e8..5ae50fb70 100644
--- a/afb/afbpixmap.c
+++ b/afb/afbpixmap.c
@@ -113,7 +113,7 @@ afbDestroyPixmap(pPixmap)
{
if(--pPixmap->refcnt)
return(TRUE);
- dixFreePrivates(*DEVPRIV_PTR(pPixmap));
+ dixFreePrivates(pPixmap->devPrivates);
xfree(pPixmap);
return(TRUE);
}
diff --git a/afb/afbply1rct.c b/afb/afbply1rct.c
index 86ec174f4..e9d4d5e09 100644
--- a/afb/afbply1rct.c
+++ b/afb/afbply1rct.c
@@ -100,8 +100,8 @@ afbFillPolygonSolid (pDrawable, pGC, shape, mode, count, ptsIn)
int depthDst;
register PixelType *pdst;
- devPriv = (afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr);
-
+ devPriv = (afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
+ afbGCPrivateKey);
if (mode == CoordModePrevious || shape != Convex ||
REGION_NUM_RECTS(pGC->pCompositeClip) != 1) {
miFillPolygon (pDrawable, pGC, shape, mode, count, ptsIn);
diff --git a/afb/afbplygblt.c b/afb/afbplygblt.c
index 289d50e1b..79b269b85 100644
--- a/afb/afbplygblt.c
+++ b/afb/afbplygblt.c
@@ -146,8 +146,8 @@ afbPolyGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
bbox.y1 = y - info.overallAscent;
bbox.y2 = y + info.overallDescent;
- rrops = ((afbPrivGCPtr) pGC->devPrivates[afbGCPrivateIndex].ptr)->rrops;
-
+ rrops = ((afbPrivGCPtr)dixLookupPrivate(&pGC->devPrivates,
+ afbGCPrivateKey))->rrops;
switch (RECT_IN_REGION(pGC->pScreen, pGC->pCompositeClip, &bbox)) {
case rgnOUT:
break;
diff --git a/afb/afbpntwin.c b/afb/afbpntwin.c
index 6082f7caa..89c4489c4 100644
--- a/afb/afbpntwin.c
+++ b/afb/afbpntwin.c
@@ -57,6 +57,7 @@ SOFTWARE.
#include "regionstr.h"
#include "pixmapstr.h"
#include "scrnintstr.h"
+#include "privates.h"
#include "afb.h"
#include "maskbits.h"
@@ -71,7 +72,8 @@ afbPaintWindow(pWin, pRegion, what)
register afbPrivWin *pPrivWin;
unsigned char rrops[AFB_MAX_DEPTH];
- pPrivWin = (afbPrivWin *)(pWin->devPrivates[afbWindowPrivateIndex].ptr);
+ pPrivWin = (afbPrivWin *)dixLookupPrivate(&pWin->devPrivates,
+ afbWindowPrivateKey);
switch (what) {
case PW_BACKGROUND:
diff --git a/afb/afbpolypnt.c b/afb/afbpolypnt.c
index a9d96edfe..b8ea3ed3e 100644
--- a/afb/afbpolypnt.c
+++ b/afb/afbpolypnt.c
@@ -90,8 +90,8 @@ afbPolyPoint(pDrawable, pGC, mode, npt, pptInit)
register unsigned char *rrops;
afbPrivGC *pGCPriv;
- pGCPriv = (afbPrivGC *) pGC->devPrivates[afbGCPrivateIndex].ptr;
-
+ pGCPriv = (afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
+ afbGCPrivateKey);
afbGetPixelWidthSizeDepthAndPointer(pDrawable, nlwidth, sizeDst, depthDst,
pBaseSave);
diff --git a/afb/afbscrinit.c b/afb/afbscrinit.c
index 71e8d4c1e..8615d935b 100644
--- a/afb/afbscrinit.c
+++ b/afb/afbscrinit.c
@@ -69,13 +69,11 @@ SOFTWARE.
#include "servermd.h"
#ifdef PIXMAP_PER_WINDOW
-int frameWindowPrivateIndex;
+DevPrivateKey frameWindowPrivateKey = &frameWindowPrivateKey;
#endif
-int afbWindowPrivateIndex;
-int afbGCPrivateIndex;
-int afbScreenPrivateIndex;
-
-static unsigned long afbGeneration = 0;
+DevPrivateKey afbWindowPrivateKey = &afbWindowPrivateKey;
+DevPrivateKey afbGCPrivateKey = &afbGCPrivateKey;
+DevPrivateKey afbScreenPrivateKey = &afbScreenPrivateKey;
static Bool
afbCloseScreen(int index, ScreenPtr pScreen)
@@ -87,7 +85,7 @@ afbCloseScreen(int index, ScreenPtr pScreen)
xfree(depths[d].vids);
xfree(depths);
xfree(pScreen->visuals);
- xfree(pScreen->devPrivates[afbScreenPrivateIndex].ptr);
+ xfree(dixLookupPrivate(&pScreen->devPrivates, afbScreenPrivateKey));
return(TRUE);
}
@@ -98,7 +96,8 @@ afbCreateScreenResources(ScreenPtr pScreen)
pointer oldDevPrivate = pScreen->devPrivate;
- pScreen->devPrivate = pScreen->devPrivates[afbScreenPrivateIndex].ptr;
+ pScreen->devPrivate = dixLookupPrivate(&pScreen->devPrivates,
+ afbScreenPrivateKey);
retval = miCreateScreenResources(pScreen);
/* Modify screen's pixmap devKind value stored off devPrivate to
@@ -106,7 +105,8 @@ afbCreateScreenResources(ScreenPtr pScreen)
* of a chunky screen in longs as incorrectly setup by the mi routine.
*/
((PixmapPtr)pScreen->devPrivate)->devKind = BitmapBytePad(pScreen->width);
- pScreen->devPrivates[afbScreenPrivateIndex].ptr = pScreen->devPrivate;
+ dixSetPrivate(&pScreen->devPrivates, afbScreenPrivateKey,
+ pScreen->devPrivate);
pScreen->devPrivate = oldDevPrivate;
return(retval);
}
@@ -115,7 +115,8 @@ static PixmapPtr
afbGetWindowPixmap(WindowPtr pWin)
{
#ifdef PIXMAP_PER_WINDOW
- return (PixmapPtr)(pWin->devPrivates[frameWindowPrivateIndex].ptr);
+ return (PixmapPtr)dixLookupPrivate(&pWin->devPrivates,
+ frameWindowPrivateKey);
#else
ScreenPtr pScreen = pWin->drawable.pScreen;
@@ -127,33 +128,25 @@ static void
afbSetWindowPixmap(WindowPtr pWin, PixmapPtr pPix)
{
#ifdef PIXMAP_PER_WINDOW
- pWin->devPrivates[frameWindowPrivateIndex].ptr = (pointer)pPix;
+ dixSetPrivate(&pWin->devPrivates, frameWindowPrivateKey, pPix);
#else
(* pWin->drawable.pScreen->SetScreenPixmap)(pPix);
#endif
}
static Bool
-afbAllocatePrivates(ScreenPtr pScreen, int *pWinIndex, int *pGCIndex)
+afbAllocatePrivates(ScreenPtr pScreen,
+ DevPrivateKey *pWinKey, DevPrivateKey *pGCKey)
{
- if (afbGeneration != serverGeneration) {
-#ifdef PIXMAP_PER_WINDOW
- frameWindowPrivateIndex = AllocateWindowPrivateIndex();
-#endif
- afbWindowPrivateIndex = AllocateWindowPrivateIndex();
- afbGCPrivateIndex = AllocateGCPrivateIndex();
- afbGeneration = serverGeneration;
- }
- if (pWinIndex)
- *pWinIndex = afbWindowPrivateIndex;
- if (pGCIndex)
- *pGCIndex = afbGCPrivateIndex;
+ if (pWinKey)
+ *pWinKey = afbWindowPrivateKey;
+ if (pGCKey)
+ *pGCKey = afbGCPrivateKey;
- afbScreenPrivateIndex = AllocateScreenPrivateIndex();
pScreen->GetWindowPixmap = afbGetWindowPixmap;
pScreen->SetWindowPixmap = afbSetWindowPixmap;
- return(AllocateWindowPrivate(pScreen, afbWindowPrivateIndex, sizeof(afbPrivWin)) &&
- AllocateGCPrivate(pScreen, afbGCPrivateIndex, sizeof(afbPrivGC)));
+ return(dixRequestPrivate(afbWindowPrivateKey, sizeof(afbPrivWin)) &&
+ dixRequestPrivate(afbGCPrivateKey, sizeof(afbPrivGC)));
}
/* dts * (inch/dot) * (25.4 mm / inch) = mm */
@@ -179,7 +172,7 @@ afbScreenInit(register ScreenPtr pScreen, pointer pbits, int xsize, int ysize, i
ErrorF("afbInitVisuals: FALSE\n");
return FALSE;
}
- if (!afbAllocatePrivates(pScreen,(int *)NULL, (int *)NULL)) {
+ if (!afbAllocatePrivates(pScreen, NULL, NULL)) {
ErrorF("afbAllocatePrivates: FALSE\n");
return FALSE;
}
@@ -224,7 +217,8 @@ afbScreenInit(register ScreenPtr pScreen, pointer pbits, int xsize, int ysize, i
pScreen->CloseScreen = afbCloseScreen;
pScreen->CreateScreenResources = afbCreateScreenResources;
- pScreen->devPrivates[afbScreenPrivateIndex].ptr = pScreen->devPrivate;
+ dixSetPrivate(&pScreen->devPrivates, afbScreenPrivateKey,
+ pScreen->devPrivate);
pScreen->devPrivate = oldDevPrivate;
return TRUE;
diff --git a/afb/afbtegblt.c b/afb/afbtegblt.c
index ba889cb80..c89b23a5d 100644
--- a/afb/afbtegblt.c
+++ b/afb/afbtegblt.c
@@ -261,8 +261,8 @@ afbTEGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
xpos += FONTMAXBOUNDS(pfont,leftSideBearing);
ypos -= FONTASCENT(pfont);
- rrops = ((afbPrivGCPtr) pGC->devPrivates[afbGCPrivateIndex].ptr)->rropOS;
-
+ rrops = ((afbPrivGCPtr)dixLookupPrivate(&pGC->devPrivates,
+ afbGCPrivateKey))->rropOS;
bbox.x1 = xpos;
bbox.x2 = xpos + (widthGlyph * nglyph);
bbox.y1 = ypos;
diff --git a/afb/afbwindow.c b/afb/afbwindow.c
index a4a1602bc..1d99fe14d 100644
--- a/afb/afbwindow.c
+++ b/afb/afbwindow.c
@@ -56,6 +56,7 @@ SOFTWARE.
#include <X11/X.h>
#include "scrnintstr.h"
#include "windowstr.h"
+#include "privates.h"
#include "afb.h"
#include "mistruct.h"
#include "regionstr.h"
@@ -67,14 +68,16 @@ afbCreateWindow(pWin)
{
register afbPrivWin *pPrivWin;
- pPrivWin = (afbPrivWin *)(pWin->devPrivates[afbWindowPrivateIndex].ptr);
+ pPrivWin = (afbPrivWin *)dixLookupPrivate(&pWin->devPrivates,
+ afbWindowPrivateKey);
pPrivWin->pRotatedBorder = NullPixmap;
pPrivWin->pRotatedBackground = NullPixmap;
pPrivWin->fastBackground = FALSE;
pPrivWin->fastBorder = FALSE;
#ifdef PIXMAP_PER_WINDOW
- pWin->devPrivates[frameWindowPrivateIndex].ptr =
- pWin->pDrawable.pScreen->devPrivates[afbScreenPrivateIndex].ptr;
+ dixSetPrivate(&pWin->devPrivates, frameWindowPrivateKey,
+ dixLookupPrivate(&pWin->pDrawable.pScreen->devPrivates,
+ afbScreenPrivateKey));
#endif
return (TRUE);
@@ -88,8 +91,8 @@ afbDestroyWindow(pWin)
{
register afbPrivWin *pPrivWin;
- pPrivWin = (afbPrivWin *)(pWin->devPrivates[afbWindowPrivateIndex].ptr);
-
+ pPrivWin = (afbPrivWin *)dixLookupPrivate(&pWin->devPrivates,
+ afbWindowPrivateKey);
if (pPrivWin->pRotatedBorder)
(*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBorder);
if (pPrivWin->pRotatedBackground)
@@ -123,7 +126,8 @@ afbPositionWindow(pWin, x, y)
register afbPrivWin *pPrivWin;
int reset = 0;
- pPrivWin = (afbPrivWin *)(pWin->devPrivates[afbWindowPrivateIndex].ptr);
+ pPrivWin = (afbPrivWin *)dixLookupPrivate(&pWin->devPrivates,
+ afbWindowPrivateKey);
if (pWin->backgroundState == BackgroundPixmap && pPrivWin->fastBackground) {
afbXRotatePixmap(pPrivWin->pRotatedBackground,
pWin->drawable.x - pPrivWin->oldRotate.x);
@@ -230,7 +234,8 @@ afbChangeWindowAttributes(pWin, mask)
register afbPrivWin *pPrivWin;
WindowPtr pBgWin;
- pPrivWin = (afbPrivWin *)(pWin->devPrivates[afbWindowPrivateIndex].ptr);
+ pPrivWin = (afbPrivWin *)dixLookupPrivate(&pWin->devPrivates,
+ afbWindowPrivateKey);
/*
* When background state changes from ParentRelative and
* we had previously rotated the fast border pixmap to match
diff --git a/afb/afbzerarc.c b/afb/afbzerarc.c
index 2cc30687f..e53488e02 100644
--- a/afb/afbzerarc.c
+++ b/afb/afbzerarc.c
@@ -96,8 +96,8 @@ afbZeroArcSS(DrawablePtr pDraw, GCPtr pGC, xArc *arc)
register PixelType *paddr;
register unsigned char *rrops;
- rrops = ((afbPrivGC *)(pGC->devPrivates[afbGCPrivateIndex].ptr))->rrops;
-
+ rrops = ((afbPrivGC *)dixLookupPrivate(&pGC->devPrivates,
+ afbGCPrivateKey))->rrops;
afbGetPixelWidthSizeDepthAndPointer(pDraw, nlwidth, sizeDst, depthDst,
addrl);
do360 = miZeroArcSetup(arc, &info, TRUE);