egl actually doesnt need a full reset - we CAN get the current context

and draw/read surfaces.



SVN revision: 55977
This commit is contained in:
Carsten Haitzler 2011-01-07 10:16:17 +00:00
parent 13df30ab2b
commit d7e8cfba62
2 changed files with 27 additions and 8 deletions

View File

@ -541,7 +541,11 @@ eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, i
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);

View File

@ -477,7 +477,22 @@ eng_window_free(Evas_GL_X11_Window *gw)
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);
@ -488,13 +503,13 @@ eng_window_use(Evas_GL_X11_Window *gw)
#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