forked from enlightenment/efl
make sure we ensure out gl context is current at each frame start
SVN revision: 55131
This commit is contained in:
parent
b26182d35b
commit
4147f2f231
|
@ -535,9 +535,10 @@ eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, i
|
||||||
re = (Render_Engine *)data;
|
re = (Render_Engine *)data;
|
||||||
/* get the upate rect surface - return engine data as dummy */
|
/* get the upate rect surface - return engine data as dummy */
|
||||||
if (!re->win->draw.redraw) return NULL;
|
if (!re->win->draw.redraw) return NULL;
|
||||||
|
eng_window_use(NULL);
|
||||||
|
eng_window_use(re->win);
|
||||||
if (!_re_wincheck(re)) return NULL;
|
if (!_re_wincheck(re)) return NULL;
|
||||||
evas_gl_common_context_flush(re->win->gl_context);
|
evas_gl_common_context_flush(re->win->gl_context);
|
||||||
eng_window_use(re->win);
|
|
||||||
evas_gl_common_context_newframe(re->win->gl_context);
|
evas_gl_common_context_newframe(re->win->gl_context);
|
||||||
if (x) *x = re->win->draw.x1;
|
if (x) *x = re->win->draw.x1;
|
||||||
if (y) *y = re->win->draw.y1;
|
if (y) *y = re->win->draw.y1;
|
||||||
|
|
|
@ -482,38 +482,41 @@ eng_window_use(Evas_GL_X11_Window *gw)
|
||||||
if (_evas_gl_x11_window)
|
if (_evas_gl_x11_window)
|
||||||
evas_gl_common_context_flush(_evas_gl_x11_window->gl_context);
|
evas_gl_common_context_flush(_evas_gl_x11_window->gl_context);
|
||||||
_evas_gl_x11_window = gw;
|
_evas_gl_x11_window = gw;
|
||||||
|
if (gw)
|
||||||
|
{
|
||||||
// EGL / GLES
|
// EGL / GLES
|
||||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||||
if (gw->egl_surface[0] != EGL_NO_SURFACE)
|
if (gw->egl_surface[0] != EGL_NO_SURFACE)
|
||||||
{
|
{
|
||||||
if (eglMakeCurrent(gw->egl_disp,
|
if (eglMakeCurrent(gw->egl_disp,
|
||||||
gw->egl_surface[0],
|
gw->egl_surface[0],
|
||||||
gw->egl_surface[0],
|
gw->egl_surface[0],
|
||||||
gw->egl_context[0]) == EGL_FALSE)
|
gw->egl_context[0]) == EGL_FALSE)
|
||||||
{
|
{
|
||||||
ERR("eglMakeCurrent() failed!");
|
ERR("eglMakeCurrent() failed!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// GLX
|
// GLX
|
||||||
#else
|
#else
|
||||||
if (gw->glxwin)
|
if (gw->glxwin)
|
||||||
{
|
{
|
||||||
if (!glXMakeContextCurrent(gw->disp, gw->glxwin, gw->glxwin,
|
if (!glXMakeContextCurrent(gw->disp, gw->glxwin, gw->glxwin,
|
||||||
gw->context))
|
gw->context))
|
||||||
{
|
{
|
||||||
ERR("glXMakeContextCurrent(%p, %p, %p, %p)", (void *)gw->disp, (void *)gw->win, (void *)gw->win, (void *)gw->context);
|
ERR("glXMakeContextCurrent(%p, %p, %p, %p)", (void *)gw->disp, (void *)gw->win, (void *)gw->win, (void *)gw->context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!glXMakeCurrent(gw->disp, gw->win, gw->context))
|
if (!glXMakeCurrent(gw->disp, gw->win, gw->context))
|
||||||
{
|
{
|
||||||
ERR("glXMakeCurrent(%p, 0x%x, %p) failed", gw->disp, (unsigned int)gw->win, (void *)gw->context);
|
ERR("glXMakeCurrent(%p, 0x%x, %p) failed", gw->disp, (unsigned int)gw->win, (void *)gw->context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
evas_gl_common_context_use(gw->gl_context);
|
if (gw) evas_gl_common_context_use(gw->gl_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue