From 2561c3415dd7e219a939e81082ce0787cd6a4016 Mon Sep 17 00:00:00 2001 From: raster Date: Fri, 27 Aug 2010 10:38:41 +0000 Subject: [PATCH] fix un/resurf for dump. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@51674 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/modules/engines/gl_x11/evas_x_main.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/modules/engines/gl_x11/evas_x_main.c b/src/modules/engines/gl_x11/evas_x_main.c index 0b29f29..c937ea3 100644 --- a/src/modules/engines/gl_x11/evas_x_main.c +++ b/src/modules/engines/gl_x11/evas_x_main.c @@ -457,12 +457,15 @@ eng_window_use(Evas_GL_X11_Window *gw) _evas_gl_x11_window = gw; // EGL / GLES #if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX) - if (eglMakeCurrent(gw->egl_disp, - gw->egl_surface[0], - gw->egl_surface[0], - gw->egl_context[0]) == EGL_FALSE) + if (gw->egl_surface[0] != EGL_NO_SURFACE) { - printf("Error: eglMakeCurrent() failed!\n"); + if (eglMakeCurrent(gw->egl_disp, + gw->egl_surface[0], + gw->egl_surface[0], + gw->egl_context[0]) == EGL_FALSE) + { + printf("Error: eglMakeCurrent() failed!\n"); + } } // GLX #else @@ -493,10 +496,10 @@ eng_window_unsurf(Evas_GL_X11_Window *gw) if (getenv("EVAS_GL_INFO")) printf("unsurf %p\n", gw); #if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX) + eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); if (gw->egl_surface[0] != EGL_NO_SURFACE) eglDestroySurface(gw->egl_disp, gw->egl_surface[0]); gw->egl_surface[0] = EGL_NO_SURFACE; - eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); #else if (gw->glxwin) { @@ -525,6 +528,13 @@ eng_window_resurf(Evas_GL_X11_Window *gw) printf("Error: error # was: 0x%x\n", eglGetError()); return; } + if (eglMakeCurrent(gw->egl_disp, + gw->egl_surface[0], + gw->egl_surface[0], + gw->egl_context[0]) == EGL_FALSE) + { + printf("Error: eglMakeCurrent() failed!\n"); + } #else #ifdef NEWGL if (gw->alpha) -- 2.7.4