From e59fa4c46c8857f2e04447777dd197464c95b2cb Mon Sep 17 00:00:00 2001 From: Juan Zhao Date: Sun, 9 Jan 2011 12:03:02 -0500 Subject: dri2: release texture image. Add release function for texture_from_pixmap extension. Some platform need to release texture image for texture_from_pixmap extension, add this interface for those platforms. --- src/glx/dri2_glx.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/glx/dri2_glx.c') diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index b0559b24d72..75b1a103f01 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -719,6 +719,27 @@ dri2_bind_tex_image(Display * dpy, static void dri2_release_tex_image(Display * dpy, GLXDrawable drawable, int buffer) { +#if __DRI_TEX_BUFFER_VERSION >= 3 + struct glx_context *gc = __glXGetCurrentContext(); + struct dri2_context *pcp = (struct dri2_context *) gc; + __GLXDRIdrawable *base = GetGLXDRIDrawable(dpy, drawable); + struct glx_display *dpyPriv = __glXInitialize(dpy); + struct dri2_drawable *pdraw = (struct dri2_drawable *) base; + struct dri2_display *pdp = + (struct dri2_display *) dpyPriv->dri2Display; + struct dri2_screen *psc; + + if (pdraw != NULL) { + psc = (struct dri2_screen *) base->psc; + + if (psc->texBuffer->base.version >= 3 && + psc->texBuffer->releaseTexBuffer != NULL) { + (*psc->texBuffer->releaseTexBuffer) (pcp->driContext, + pdraw->base.textureTarget, + pdraw->driDrawable); + } + } +#endif } static const struct glx_context_vtable dri2_context_vtable = { -- cgit v1.2.3