aboutsummaryrefslogtreecommitdiffstats
path: root/src/glx/glxcmds.c
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2010-08-27 12:40:11 -0400
committerKristian Høgsberg <[email protected]>2010-09-08 09:20:42 -0400
commit16887d042a917fa4773e4d853f50051b54e9948c (patch)
tree6e31237b62e2d49e5544a05a64d99a95015b1d39 /src/glx/glxcmds.c
parentb4bb6680200b5a898583392f4c831c02f41e63f7 (diff)
glx: Drop broken drawable garbage collection
Doesn't work for pixmaps, was looking up the GLX XID and was never thread safe. Instead, just destroy the client side structures when the drawable is no long current for a context.
Diffstat (limited to 'src/glx/glxcmds.c')
-rw-r--r--src/glx/glxcmds.c50
1 files changed, 0 insertions, 50 deletions
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index 95751560801..4f7e84ef5f9 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -63,56 +63,6 @@ static const char __glXGLXClientVersion[] = "1.4";
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
-static Bool windowExistsFlag;
-static int
-windowExistsErrorHandler(Display * dpy, XErrorEvent * xerr)
-{
- (void) dpy;
-
- if (xerr->error_code == BadWindow) {
- windowExistsFlag = GL_FALSE;
- }
- return 0;
-}
-
-/**
- * Find drawables in the local hash that have been destroyed on the
- * server.
- *
- * \param dpy Display to destroy drawables for
- * \param screen Screen number to destroy drawables for
- */
-_X_HIDDEN void
-GarbageCollectDRIDrawables(struct glx_screen * sc)
-{
- XID draw;
- __GLXDRIdrawable *pdraw;
- struct glx_display *priv = sc->display;
- XWindowAttributes xwa;
- int (*oldXErrorHandler) (Display *, XErrorEvent *);
-
- /* Set no-op error handler so Xlib doesn't bail out if the windows
- * has alreay been destroyed on the server. */
- XSync(priv->dpy, GL_FALSE);
- oldXErrorHandler = XSetErrorHandler(windowExistsErrorHandler);
-
- if (__glxHashFirst(priv->drawHash, &draw, (void *) &pdraw) == 1) {
- do {
- windowExistsFlag = GL_TRUE;
- XGetWindowAttributes(priv->dpy, draw, &xwa); /* dummy request */
- if (!windowExistsFlag) {
- /* Destroy the local drawable data, if the drawable no
- longer exists in the Xserver */
- (*pdraw->destroyDrawable) (pdraw);
- __glxHashDelete(priv->drawHash, draw);
- }
- } while (__glxHashNext(priv->drawHash, &draw, (void *) &pdraw) == 1);
- }
-
- XSync(priv->dpy, GL_FALSE);
- XSetErrorHandler(oldXErrorHandler);
-}
-
/**
* Get the __DRIdrawable for the drawable associated with a GLXContext
*