modules: gl_x11: ensure we check the result of evas_eglMakeCurrent()

In case we fail make sure we error out to allow better debugging.
Also fix some surrounding indent.

CID: 1402693, 1402670

Reviewed-by: Christopher Michael <devilhorns@comcast.net>
Differential Revision: https://phab.enlightenment.org/D11976
This commit is contained in:
Stefan Schmidt 2020-06-15 12:48:37 +02:00
parent 2982306ece
commit d74fb0dbc3
1 changed files with 6 additions and 4 deletions

View File

@ -661,9 +661,10 @@ eng_window_free(Outbuf *gw)
}
#ifdef GL_GLES
SET_RESTORE_CONTEXT();
evas_eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (!evas_eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT))
ERR("evas_eglMakeCurrent() failed!");
if (gw->egl_surface != EGL_NO_SURFACE)
eglDestroySurface(gw->egl_disp, gw->egl_surface);
eglDestroySurface(gw->egl_disp, gw->egl_surface);
if (gw->egl_context != context)
eglDestroyContext(gw->egl_disp, gw->egl_context);
if (ref == 0)
@ -802,9 +803,10 @@ eng_window_unsurf(Outbuf *gw)
if (xwin == gw)
{
SET_RESTORE_CONTEXT();
evas_eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (!evas_eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT))
ERR("evas_eglMakeCurrent() failed!");
if (gw->egl_surface != EGL_NO_SURFACE)
eglDestroySurface(gw->egl_disp, gw->egl_surface);
eglDestroySurface(gw->egl_disp, gw->egl_surface);
gw->egl_surface = EGL_NO_SURFACE;
_tls_outbuf_set(NULL);
}