aboutsummaryrefslogtreecommitdiffstats
path: root/src/glx/x11/dri_glx.c
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2008-03-12 02:18:12 -0400
committerKristian Høgsberg <[email protected]>2008-03-12 02:18:12 -0400
commit9110425c72e45f618131b559eba883fd6c5536b4 (patch)
tree47c90e48c71f91244b4f3ed541c4a79c7517a5ce /src/glx/x11/dri_glx.c
parent94f39f2e7cc7f8ef6915a40d14965e5b193d9952 (diff)
libGL: Pull the drawable hash back out in the generic code.
This will be shared between dri and dri2 code.
Diffstat (limited to 'src/glx/x11/dri_glx.c')
-rw-r--r--src/glx/x11/dri_glx.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/glx/x11/dri_glx.c b/src/glx/x11/dri_glx.c
index a6581465bc2..08e419c1efb 100644
--- a/src/glx/x11/dri_glx.c
+++ b/src/glx/x11/dri_glx.c
@@ -742,6 +742,14 @@ static __GLXDRIcontext *driCreateContext(__GLXscreenConfigs *psc,
return NULL;
}
+static void driDestroyDrawable(__GLXDRIdrawable *pdraw)
+{
+ __GLXscreenConfigs *psc = pdraw->psc;
+
+ (*pdraw->driDrawable.destroyDrawable)(&pdraw->driDrawable);
+ XF86DRIDestroyDrawable(psc->dpy, psc->scr, pdraw->drawable);
+ Xfree(pdraw);
+}
static __GLXDRIdrawable *driCreateDrawable(__GLXscreenConfigs *psc,
GLXDrawable drawable,
@@ -777,12 +785,7 @@ static __GLXDRIdrawable *driCreateDrawable(__GLXscreenConfigs *psc,
return NULL;
}
- if (__glxHashInsert(psc->drawHash, drawable, pdraw)) {
- (*pdraw->driDrawable.destroyDrawable)(&pdraw->driDrawable);
- XF86DRIDestroyDrawable(psc->dpy, psc->scr, drawable);
- Xfree(pdraw);
- return NULL;
- }
+ pdraw->destroyDrawable = driDestroyDrawable;
return pdraw;
}
@@ -793,8 +796,6 @@ static void driDestroyScreen(__GLXscreenConfigs *psc)
if (psc->__driScreen.private)
(*psc->__driScreen.destroyScreen)(&psc->__driScreen);
psc->__driScreen.private = NULL;
- if (psc->drawHash)
- __glxHashDestroy(psc->drawHash);
if (psc->driver)
dlclose(psc->driver);
}
@@ -810,11 +811,6 @@ static __GLXDRIscreen *driCreateScreen(__GLXscreenConfigs *psc, int screen,
if (psp == NULL)
return NULL;
- /* Create drawable hash */
- psc->drawHash = __glxHashCreate();
- if ( psc->drawHash == NULL )
- return NULL;
-
/* Initialize per screen dynamic client GLX extensions */
psc->ext_list_first_time = GL_TRUE;