Evas GL: Don't call eglMakeCurrent if already null
authorJean-Philippe Andre <jp.andre@samsung.com>
Wed, 14 Oct 2015 12:32:11 +0000 (21:32 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Thu, 15 Oct 2015 07:20:53 +0000 (16:20 +0900)
If the current context & surface are already null, avoid
calling eglMakeCurrent again, since it can return an error
(EGL_FALSE but with no error code, thanks Nvidia).

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

index bdbd86f..930092d 100644 (file)
@@ -179,6 +179,10 @@ evgl_eng_make_current(void *data, void *surface, void *context, int flush)
 
    if ((!context) && (!surface))
      {
+        if (!eglGetCurrentContext() &&
+            !eglGetCurrentSurface(EGL_READ) &&
+            !eglGetCurrentSurface(EGL_DRAW))
+          return 1;
         ret = eglMakeCurrent(dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
         if (!ret)
           {