From 190e65dac33554d5adaf246ca87b824e5804482d Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Wed, 21 Nov 2012 10:02:18 +0000 Subject: [PATCH] evas/wayland_egl: Don't create EGLSurface for internal gl resource if we already have one in re->win. EGL 1.4 spec Section 3.5.1: If there is already an EGLSurface associated with win (as a result of a previous eglCreateWindowSurface call), then an EGL_BAD_ALLOC error is generated. So that this eglCreateWindowSurface() will fail if the egl driver is a strict conformance to the spec. SVN revision: 79505 --- src/modules/evas/engines/wayland_egl/evas_engine.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c b/src/modules/evas/engines/wayland_egl/evas_engine.c index fee38a1940..df95606e92 100644 --- a/src/modules/evas/engines/wayland_egl/evas_engine.c +++ b/src/modules/evas/engines/wayland_egl/evas_engine.c @@ -576,9 +576,17 @@ _create_internal_glue_resources(void *data) 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 (re->win->egl_surface[0]) + { + rsc->surface = re->win->egl_surface[0]; + } + else + { + 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.");