summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2020-06-15 12:48:37 +0200
committerStefan Schmidt <s.schmidt@samsung.com>2020-06-15 15:04:20 +0200
commitd74fb0dbc39a0cb72e15e0d76b4f771150f7cd75 (patch)
tree34bc004b95dca807159dde5d8f01f67049f4e9f7
parent2982306ecea7d4ca800fb4e2b5b91fb8ba53213c (diff)
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
-rw-r--r--src/modules/evas/engines/gl_x11/evas_x_main.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/modules/evas/engines/gl_x11/evas_x_main.c b/src/modules/evas/engines/gl_x11/evas_x_main.c
index f247758a2d..4e578efa94 100644
--- a/src/modules/evas/engines/gl_x11/evas_x_main.c
+++ b/src/modules/evas/engines/gl_x11/evas_x_main.c
@@ -661,9 +661,10 @@ eng_window_free(Outbuf *gw)
661 } 661 }
662#ifdef GL_GLES 662#ifdef GL_GLES
663 SET_RESTORE_CONTEXT(); 663 SET_RESTORE_CONTEXT();
664 evas_eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); 664 if (!evas_eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT))
665 ERR("evas_eglMakeCurrent() failed!");
665 if (gw->egl_surface != EGL_NO_SURFACE) 666 if (gw->egl_surface != EGL_NO_SURFACE)
666 eglDestroySurface(gw->egl_disp, gw->egl_surface); 667 eglDestroySurface(gw->egl_disp, gw->egl_surface);
667 if (gw->egl_context != context) 668 if (gw->egl_context != context)
668 eglDestroyContext(gw->egl_disp, gw->egl_context); 669 eglDestroyContext(gw->egl_disp, gw->egl_context);
669 if (ref == 0) 670 if (ref == 0)
@@ -802,9 +803,10 @@ eng_window_unsurf(Outbuf *gw)
802 if (xwin == gw) 803 if (xwin == gw)
803 { 804 {
804 SET_RESTORE_CONTEXT(); 805 SET_RESTORE_CONTEXT();
805 evas_eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); 806 if (!evas_eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT))
807 ERR("evas_eglMakeCurrent() failed!");
806 if (gw->egl_surface != EGL_NO_SURFACE) 808 if (gw->egl_surface != EGL_NO_SURFACE)
807 eglDestroySurface(gw->egl_disp, gw->egl_surface); 809 eglDestroySurface(gw->egl_disp, gw->egl_surface);
808 gw->egl_surface = EGL_NO_SURFACE; 810 gw->egl_surface = EGL_NO_SURFACE;
809 _tls_outbuf_set(NULL); 811 _tls_outbuf_set(NULL);
810 } 812 }