summaryrefslogtreecommitdiff
path: root/mi/miscrinit.c
diff options
context:
space:
mode:
Diffstat (limited to 'mi/miscrinit.c')
-rw-r--r--mi/miscrinit.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/mi/miscrinit.c b/mi/miscrinit.c
index cc40cbede..2dd8cd955 100644
--- a/mi/miscrinit.c
+++ b/mi/miscrinit.c
@@ -293,35 +293,22 @@ miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width,
return miScreenDevPrivateInit(pScreen, width, pbits);
}
-_X_EXPORT int
+static DevPrivateKey privateKey = &privateKey;
+
+_X_EXPORT DevPrivateKey
miAllocateGCPrivateIndex()
{
- static int privateIndex = -1;
- static unsigned long miGeneration = 0;
-
- if (miGeneration != serverGeneration)
- {
- privateIndex = AllocateGCPrivateIndex();
- miGeneration = serverGeneration;
- }
- return privateIndex;
+ return privateKey;
}
-_X_EXPORT int miZeroLineScreenIndex;
-static unsigned int miZeroLineGeneration = 0;
+_X_EXPORT DevPrivateKey miZeroLineScreenKey;
_X_EXPORT void
miSetZeroLineBias(pScreen, bias)
ScreenPtr pScreen;
unsigned int bias;
{
- if (miZeroLineGeneration != serverGeneration)
- {
- miZeroLineScreenIndex = AllocateScreenPrivateIndex();
- miZeroLineGeneration = serverGeneration;
- }
- if (miZeroLineScreenIndex >= 0)
- pScreen->devPrivates[miZeroLineScreenIndex].uval = bias;
+ dixSetPrivate(&pScreen->devPrivates, miZeroLineScreenKey, (pointer)bias);
}
_X_EXPORT PixmapPtr