summaryrefslogtreecommitdiff
path: root/GL/glx/glxext.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2007-08-23 19:07:52 -0400
committerKristian Høgsberg <krh@redhat.com>2007-10-12 18:26:55 -0400
commitd7ded953c4d263e3dd3374dc03eea19e80c05bc6 (patch)
treeaf3b63ddee626a2a843e301bfda6f1f22a6c4160 /GL/glx/glxext.c
parent2b0847c7aaf95b6b10f062dfff601032b2430a9b (diff)
Implment GLXPixmaps.
Diffstat (limited to 'GL/glx/glxext.c')
-rw-r--r--GL/glx/glxext.c53
1 files changed, 9 insertions, 44 deletions
diff --git a/GL/glx/glxext.c b/GL/glx/glxext.c
index b5de8c3e9..94ec5cc7d 100644
--- a/GL/glx/glxext.c
+++ b/GL/glx/glxext.c
@@ -45,7 +45,6 @@ __GLXcontext *__glXLastContext;
** X resources.
*/
RESTYPE __glXContextRes;
-RESTYPE __glXPixmapRes;
RESTYPE __glXDrawableRes;
RESTYPE __glXSwapBarrierRes;
@@ -102,32 +101,6 @@ static int ContextGone(__GLXcontext* cx, XID id)
}
/*
-** Free a GLX Pixmap.
-*/
-static int PixmapGone(__GLXpixmap *pGlxPixmap, XID id)
-{
- PixmapPtr pPixmap = (PixmapPtr) pGlxPixmap->pDraw;
-
- pGlxPixmap->idExists = False;
- if (!pGlxPixmap->refcnt) {
-#ifdef XF86DRI
- if (pGlxPixmap->pDamage) {
- DamageUnregister (pGlxPixmap->pDraw, pGlxPixmap->pDamage);
- DamageDestroy(pGlxPixmap->pDamage);
- }
-#endif
- /*
- ** The DestroyPixmap routine should decrement the refcount and free
- ** only if it's zero.
- */
- (*pGlxPixmap->pScreen->DestroyPixmap)(pPixmap);
- xfree(pGlxPixmap);
- }
-
- return True;
-}
-
-/*
** Destroy routine that gets called when a drawable is freed. A drawable
** contains the ancillary buffers needed for rendering.
*/
@@ -136,24 +109,17 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
__GLXcontext *cx, *cx1;
/*
- ** Use glxPriv->type to figure out what kind of drawable this is. Don't
- ** use glxPriv->pDraw->type because by the time this routine is called,
- ** the pDraw might already have been freed.
+ ** When a drawable is destroyed, notify all context bound to
+ ** it, that there are no longer bound to anything.
*/
- if (glxPriv->type == DRAWABLE_WINDOW) {
- /*
- ** When a window is destroyed, notify all context bound to
- ** it, that there are no longer bound to anything.
- */
- for (cx = glxPriv->drawGlxc; cx; cx = cx1) {
- cx1 = cx->nextDrawPriv;
- cx->pendingState |= __GLX_PENDING_DESTROY;
- }
+ for (cx = glxPriv->drawGlxc; cx; cx = cx1) {
+ cx1 = cx->nextDrawPriv;
+ cx->pendingState |= __GLX_PENDING_DESTROY;
+ }
- for (cx = glxPriv->readGlxc; cx; cx = cx1) {
- cx1 = cx->nextReadPriv;
- cx->pendingState |= __GLX_PENDING_DESTROY;
- }
+ for (cx = glxPriv->readGlxc; cx; cx = cx1) {
+ cx1 = cx->nextReadPriv;
+ cx->pendingState |= __GLX_PENDING_DESTROY;
}
__glXUnrefDrawable(glxPriv);
@@ -319,7 +285,6 @@ void GlxExtensionInit(void)
__GLXprovider *p;
__glXContextRes = CreateNewResourceType((DeleteType)ContextGone);
- __glXPixmapRes = CreateNewResourceType((DeleteType)PixmapGone);
__glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone);
__glXSwapBarrierRes = CreateNewResourceType((DeleteType)SwapBarrierGone);