modules: gl_x11: ensure we check the result of evas_eglMakeCurrent()
authorStefan Schmidt <s.schmidt@samsung.com>
Mon, 15 Jun 2020 10:48:37 +0000 (12:48 +0200)
committerJongmin Lee <jm105.lee@samsung.com>
Mon, 15 Jun 2020 21:29:06 +0000 (06:29 +0900)
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

src/modules/evas/engines/gl_x11/evas_x_main.c

index b8558d7..9f805ca 100755 (executable)
@@ -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);
      }