From: Enlightenment S. <no-...@en...> - 2011-01-07 10:16:24
|
Log: egl actually doesnt need a full reset - we CAN get the current context and draw/read surfaces. Author: raster Date: 2011-01-07 02:16:17 -0800 (Fri, 07 Jan 2011) New Revision: 55977 Trac: http://trac.enlightenment.org/e/changeset/55977 Modified: trunk/evas/src/modules/engines/gl_x11/evas_engine.c trunk/evas/src/modules/engines/gl_x11/evas_x_main.c Modified: trunk/evas/src/modules/engines/gl_x11/evas_engine.c =================================================================== --- trunk/evas/src/modules/engines/gl_x11/evas_engine.c 2011-01-07 10:04:41 UTC (rev 55976) +++ trunk/evas/src/modules/engines/gl_x11/evas_engine.c 2011-01-07 10:16:17 UTC (rev 55977) @@ -541,7 +541,11 @@ re = (Render_Engine *)data; /* get the upate rect surface - return engine data as dummy */ if (!re->win->draw.redraw) return NULL; +#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX) + // dont need to for egl - eng_window_use() can check for other ctxt's +#else eng_window_use(NULL); +#endif eng_window_use(re->win); if (!_re_wincheck(re)) return NULL; evas_gl_common_context_flush(re->win->gl_context); Modified: trunk/evas/src/modules/engines/gl_x11/evas_x_main.c =================================================================== --- trunk/evas/src/modules/engines/gl_x11/evas_x_main.c 2011-01-07 10:04:41 UTC (rev 55976) +++ trunk/evas/src/modules/engines/gl_x11/evas_x_main.c 2011-01-07 10:16:17 UTC (rev 55977) @@ -477,8 +477,23 @@ void eng_window_use(Evas_GL_X11_Window *gw) { - if (_evas_gl_x11_window != gw) + Eina_Bool force_use = EINA_FALSE; + +#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX) + if (_evas_gl_x11_window) { + if ((eglGetCurrentContext() != + _evas_gl_x11_window->egl_context[0]) || + (eglGetCurrentSurface(EGL_READ) != + _evas_gl_x11_window->egl_surface[0]) || + (eglGetCurrentSurface(EGL_DRAW) != + _evas_gl_x11_window->egl_surface[0])) + force_use = EINA_TRUE; + } +#else +#endif + if ((_evas_gl_x11_window != gw) || (force_use)) + { if (_evas_gl_x11_window) evas_gl_common_context_flush(_evas_gl_x11_window->gl_context); _evas_gl_x11_window = gw; @@ -488,13 +503,13 @@ #if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX) if (gw->egl_surface[0] != EGL_NO_SURFACE) { - if (eglMakeCurrent(gw->egl_disp, - gw->egl_surface[0], - gw->egl_surface[0], - gw->egl_context[0]) == EGL_FALSE) - { - ERR("eglMakeCurrent() failed!"); - } + if (eglMakeCurrent(gw->egl_disp, + gw->egl_surface[0], + gw->egl_surface[0], + gw->egl_context[0]) == EGL_FALSE) + { + ERR("eglMakeCurrent() failed!"); + } } // GLX #else |