Evas (wayland_egl): Fix crashes when flipping window alpha state.
authorAlex Wu <zhiwen.wu@linux.intel.com>
Mon, 23 Jul 2012 14:16:50 +0000 (14:16 +0000)
committerChristopher Michael <cpmichael1@comcast.net>
Mon, 23 Jul 2012 14:16:50 +0000 (14:16 +0000)
commit0f50ef36b9130814778747ef969040a6f247de06
tree3568f3d284852d3b5523af278226d5f236b774ad
parent722fef0199ccbdd710acdcd9d37790c4373c905d
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.

SVN revision: 74328
legacy/evas/src/modules/engines/wayland_egl/evas_engine.c
legacy/evas/src/modules/engines/wayland_egl/evas_wl_main.c