egl: simplify eglSwapInterval() fallback logic
authorEric Engestrom <eric@engestrom.ch>
Sat, 1 Aug 2020 22:43:52 +0000 (00:43 +0200)
committerMarge Bot <eric+marge@anholt.net>
Fri, 28 Aug 2020 08:55:06 +0000 (08:55 +0000)
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6153>

src/egl/main/eglapi.c

index e6ee31ceb1853091513dee63dec0d0e2511c04e0..405be0367d958fc065dfb9a6ef8c8aa485825bf3 100644 (file)
@@ -1287,15 +1287,10 @@ eglSwapInterval(EGLDisplay dpy, EGLint interval)
                     surf->Config->MinSwapInterval,
                     surf->Config->MaxSwapInterval);
 
-   if (surf->SwapInterval != interval) {
-      if (disp->Driver->SwapInterval)
-         ret = disp->Driver->SwapInterval(disp, surf, interval);
-      else
-         ret = EGL_TRUE;
-   }
-   else {
+   if (surf->SwapInterval != interval && disp->Driver->SwapInterval)
+      ret = disp->Driver->SwapInterval(disp, surf, interval);
+   else
       ret = EGL_TRUE;
-   }
 
    if (ret)
       surf->SwapInterval = interval;