From f4c1c21306060c904210fd596421cf077b2eb613 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Sun, 2 Aug 2020 00:43:52 +0200 Subject: [PATCH] egl: simplify eglSwapInterval() fallback logic Signed-off-by: Eric Engestrom Reviewed-by: Emil Velikov Part-of: --- src/egl/main/eglapi.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index e6ee31ceb18..405be0367d9 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -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; -- 2.30.2