antognolli pushed a commit to branch evas-1.7.
commit db9fddde14631a1706ca7b5e4f77bce6452512dc
Author: Rafael Antognolli <[email protected]>
Date: Tue Aug 13 16:54:53 2013 -0300
evas/wayland_egl: Skip makecurrent if re->win is NULL.
This happens on wayland_egl because we free and set the re->win to NULL
on ecore_evas_hide(). It's a workaround since the proper fix would be to
not free the re->win on hide, but that will require a lot more changes.
---
src/modules/engines/wayland_egl/evas_engine.c | 79 +++++++++++++++++----------
1 file changed, 51 insertions(+), 28 deletions(-)
diff --git a/src/modules/engines/wayland_egl/evas_engine.c
b/src/modules/engines/wayland_egl/evas_engine.c
index c6be47e..cbe10e4 100644
--- a/src/modules/engines/wayland_egl/evas_engine.c
+++ b/src/modules/engines/wayland_egl/evas_engine.c
@@ -2649,11 +2649,14 @@ eng_gl_surface_destroy(void *data, void *surface)
if ((rsc = eina_tls_get(resource_key)) == EINA_FALSE) return 0;
- ret = eglMakeCurrent(re->win->egl_disp, rsc->surface, rsc->surface,
rsc->context);
- if (!ret)
+ if (re->win)
{
- ERR("xxxMakeCurrent() failed!");
- return 0;
+ ret = eglMakeCurrent(re->win->egl_disp, rsc->surface, rsc->surface,
rsc->context);
+ if (!ret)
+ {
+ ERR("xxxMakeCurrent() failed!");
+ return 0;
+ }
}
// Delete FBO/RBO and Texture here
@@ -2666,12 +2669,15 @@ eng_gl_surface_destroy(void *data, void *surface)
if (sfc->rb_stencil)
glDeleteRenderbuffers(1, &sfc->rb_stencil);
- ret = eglMakeCurrent(re->win->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE,
EGL_NO_CONTEXT);
- if (!ret)
+ if (re->win)
{
- ERR("xxxMakeCurrent() failed!");
- free(sfc);
- return 0;
+ ret = eglMakeCurrent(re->win->egl_disp, EGL_NO_SURFACE,
EGL_NO_SURFACE, EGL_NO_CONTEXT);
+ if (!ret)
+ {
+ ERR("xxxMakeCurrent() failed!");
+ free(sfc);
+ return 0;
+ }
}
free(sfc);
@@ -2747,12 +2753,15 @@ eng_gl_context_destroy(void *data, void *context)
if ((rsc = eina_tls_get(resource_key)) == EINA_FALSE) return 0;
// 1. Do a make current with the given context
- ret = eglMakeCurrent(re->win->egl_disp, rsc->surface,
- rsc->surface, ctx->context);
- if (!ret)
+ if (re->win)
{
- ERR("xxxMakeCurrent() failed!");
- return 0;
+ ret = eglMakeCurrent(re->win->egl_disp, rsc->surface,
+ rsc->surface, ctx->context);
+ if (!ret)
+ {
+ ERR("xxxMakeCurrent() failed!");
+ return 0;
+ }
}
// 2. Delete the FBO
@@ -2760,16 +2769,20 @@ eng_gl_context_destroy(void *data, void *context)
glDeleteFramebuffers(1, &ctx->context_fbo);
// 3. Destroy the Context
- eglDestroyContext(re->win->egl_disp, ctx->context);
+ if (re->win)
+ eglDestroyContext(re->win->egl_disp, ctx->context);
ctx->context = EGL_NO_CONTEXT;
- ret = eglMakeCurrent(re->win->egl_disp, EGL_NO_SURFACE,
- EGL_NO_SURFACE, EGL_NO_CONTEXT);
- if (!ret)
+ if (re->win)
{
- ERR("xxxMakeCurrent() failed!");
- return 0;
+ ret = eglMakeCurrent(re->win->egl_disp, EGL_NO_SURFACE,
+ EGL_NO_SURFACE, EGL_NO_CONTEXT);
+ if (!ret)
+ {
+ ERR("xxxMakeCurrent() failed!");
+ return 0;
+ }
}
if (current_evgl_ctx == ctx)
@@ -2851,15 +2864,25 @@ eng_gl_make_current(void *data __UNUSED__, void
*surface, void *context)
eng_window_use(NULL);
// Do a make current
- ret = eglMakeCurrent(re->win->egl_disp,
- re->win->egl_surface[0],
- re->win->egl_surface[0],
- ctx->context);
-
- if (!ret)
+ // FIXME: Skip makecurrent if re->win is NULL. This happens
+ // on wayland_egl because we free and set the re->win to NULL
+ // on ecore_evas_hide(). It's a workaround since the proper
+ // fix would be to not free the re->win on hide, but that
+ // will require a lot more changes.
+ if (!re->win)
+ return ret = 1;
+ else
{
- ERR("xxxMakeCurrent() failed!");
- return 0;
+ ret = eglMakeCurrent(re->win->egl_disp,
+ re->win->egl_surface[0],
+ re->win->egl_surface[0],
+ ctx->context);
+
+ if (!ret)
+ {
+ ERR("xxxMakeCurrent() failed!");
+ return 0;
+ }
}
}
}
--
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk