summaryrefslogtreecommitdiff
path: root/hw/xnest/Pixmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xnest/Pixmap.c')
-rw-r--r--hw/xnest/Pixmap.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/hw/xnest/Pixmap.c b/hw/xnest/Pixmap.c
index 1f420015a..04311966d 100644
--- a/hw/xnest/Pixmap.c
+++ b/hw/xnest/Pixmap.c
@@ -24,6 +24,7 @@ is" without express or implied warranty.
#include "regionstr.h"
#include "gc.h"
#include "servermd.h"
+#include "privates.h"
#include "mi.h"
#include "Xnest.h"
@@ -32,7 +33,7 @@ is" without express or implied warranty.
#include "Screen.h"
#include "XNPixmap.h"
-int xnestPixmapPrivateIndex;
+DevPrivateKey xnestPixmapPrivateKey = &xnestPixmapPrivateKey;
PixmapPtr
xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
@@ -56,8 +57,9 @@ xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
pPixmap->refcnt = 1;
pPixmap->devKind = PixmapBytePad(width, depth);
- pPixmap->devPrivates[xnestPixmapPrivateIndex].ptr =
- (pointer)((char *)pPixmap + pScreen->totalPixmapSize);
+ pPixmap->usage_hint = usage_hint;
+ dixSetPrivate(&pPixmap->devPrivates, xnestPixmapPrivateKey,
+ (char *)pPixmap + pScreen->totalPixmapSize);
if (width && height)
xnestPixmapPriv(pPixmap)->pixmap =
XCreatePixmap(xnestDisplay,
@@ -75,6 +77,7 @@ xnestDestroyPixmap(PixmapPtr pPixmap)
if(--pPixmap->refcnt)
return TRUE;
XFreePixmap(xnestDisplay, xnestPixmap(pPixmap));
+ dixFreePrivates(pPixmap->devPrivates);
xfree(pPixmap);
return TRUE;
}