From f2809745fb641239be5b0281eac569c5b371e55e Mon Sep 17 00:00:00 2001 From: Zhigang Gong Date: Fri, 23 Dec 2011 16:21:44 +0800 Subject: [PATCH] Flush gl operations when destroy an textured image. Before destroy an image which was attached to a texture. we must call glFlush to make sure the operation on that texture has been done. Signed-off-by: Zhigang Gong --- glamor/glamor_egl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c index 1450abbe9..7eca5ad42 100644 --- a/glamor/glamor_egl.c +++ b/glamor/glamor_egl.c @@ -249,8 +249,13 @@ glamor_egl_destroy_textured_pixmap(PixmapPtr pixmap) if (pixmap->refcnt == 1) { image = dixLookupPrivate(&pixmap->devPrivates, glamor_egl_pixmap_private_key); - if (image != EGL_NO_IMAGE_KHR && image != NULL) + if (image != EGL_NO_IMAGE_KHR && image != NULL) { + /* Before destroy an image which was attached to + * a texture. we must call glFlush to make sure the + * operation on that texture has been done.*/ + glamor_block_handler(pixmap->drawable.pScreen); eglDestroyImageKHR(glamor_egl->display, image); + } } glamor_destroy_textured_pixmap(pixmap); }