Evas (wayland_egl): Fix crashes when flipping window alpha state.
authordevilhorns <devilhorns@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 23 Jul 2012 14:16:50 +0000 (14:16 +0000)
committerdevilhorns <devilhorns@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 23 Jul 2012 14:16:50 +0000 (14:16 +0000)
commit4f0b8ea196d2eed0bccb16639e94f658a68e35a8
tree09667e1ee87170febfd7e01670800af0ede1fdc5
parentf048de9639794358b745f8806dbe6f29bb8c91bb
Evas (wayland_egl): Fix crashes when flipping window alpha state.

From: Alex Wu <zhiwen.wu@linux.intel.com>

When calling elm_win_alpha_set(), the global EGLContext object keep
unchanged, but the new EGLSurface object subjects to the new EGLConfig
with changed alpha_size. This makes eng_window_new() failed and hence
free the  Render_Engine object (e->engine.data.output) and nullize it.
Next time other objects reference the output, segfault occurs.

In this patch, I give every Evas_GL_Wl_Window object a EGLContext object
and all these EGLContext objects share the same shader program objects.

A new global EGLContext object "share_context" added, which is
responsible for keeping the shared objects alive. e.g. shader program
objects.At the first time succeeded to create a EGLContext, assign it to
the "share_context", and should not destory it in eng_window_free.

The "share_context" will be taken as the 3rd argument when calling
eglCreateContext(), and then updated to the new created EGLContext to
keep the shared gl objects available.

Thanks for devilhorns' review and suggestion.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@74328 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33
src/modules/engines/wayland_egl/evas_engine.c
src/modules/engines/wayland_egl/evas_wl_main.c