antognolli pushed a commit to branch evas-1.7.

commit 9a00c5623ab1c094d90599a6fb94b00e8a8962f5
Author: Rafael Antognolli <[email protected]>
Date:   Wed Sep 4 12:19:53 2013 -0300

    evas/wayland_egl: Do not create a new surface if we already have one.
    
    "Second eglCreateWindowSurface call should fail according to EGL
    standard, the fact that it doesn't (and further eglMakeCurrent call
    works) is just EGL implementation author's good will."
    
    Patch by: Wang Quanxian <[email protected]>
---
 ChangeLog                                     |  4 ++++
 src/modules/engines/wayland_egl/evas_engine.c | 23 +++++++++++++++--------
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0298c6a..13853be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1357,3 +1357,7 @@
        * Evas textblock: fixed an issue with markup_get and markup_to_utf8
        behaving differently (markup_get was misbehaving).
 
+2013-09-03  Rafael Antognolli
+
+        * Evas wayland_egl: Do not create a new surface if we already have
+        one.
diff --git a/src/modules/engines/wayland_egl/evas_engine.c 
b/src/modules/engines/wayland_egl/evas_engine.c
index cbe10e4..a50dac0 100644
--- a/src/modules/engines/wayland_egl/evas_engine.c
+++ b/src/modules/engines/wayland_egl/evas_engine.c
@@ -574,15 +574,22 @@ _create_internal_glue_resources(void *data)
    context_attrs[1] = 2;
    context_attrs[2] = EGL_NONE;
 
-   // Create resource surface for EGL
-   rsc->surface = 
-     eglCreateWindowSurface(re->win->egl_disp, re->win->egl_config,
-                            (EGLNativeWindowType)re->win->win, NULL);
-   if (!rsc->surface)
+   if (eina_main_loop_is())
      {
-        ERR("Creating internal resource surface failed.");
-        free(rsc);
-        return NULL;
+        rsc->surface = re->win->egl_surface[0];
+     }
+   else
+     {
+        // Create resource surface for EGL
+        rsc->surface =
+           eglCreateWindowSurface(re->win->egl_disp, re->win->egl_config,
+                                  (EGLNativeWindowType)re->win->win, NULL);
+        if (!rsc->surface)
+          {
+             ERR("Creating internal resource surface failed.");
+             free(rsc);
+             return NULL;
+          }
      }
 
    // Create a resource context for EGL

-- 

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk

Reply via email to