summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglsurface.c
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2017-07-31 14:49:31 +0100
committerEric Engestrom <[email protected]>2017-08-01 17:36:57 +0100
commit2714a8f3e95139d2c473f99e913562929ae3f5d7 (patch)
tree7dafe8237011053b0d1c795e0d6a8657be9c16d8 /src/egl/main/eglsurface.c
parent54826331b31d4cdcb3a7e444caf97b75c3364b54 (diff)
egl: deduplicate swap interval clamping logic
Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
Diffstat (limited to 'src/egl/main/eglsurface.c')
-rw-r--r--src/egl/main/eglsurface.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/src/egl/main/eglsurface.c b/src/egl/main/eglsurface.c
index f6e41f10d78..3bd14a8cd03 100644
--- a/src/egl/main/eglsurface.c
+++ b/src/egl/main/eglsurface.c
@@ -45,22 +45,6 @@
#include "eglsurface.h"
-static void
-_eglClampSwapInterval(_EGLSurface *surf, EGLint interval)
-{
- EGLint bound = surf->Config->MaxSwapInterval;
- if (interval >= bound) {
- interval = bound;
- }
- else {
- bound = surf->Config->MinSwapInterval;
- if (interval < bound)
- interval = bound;
- }
- surf->SwapInterval = interval;
-}
-
-
/**
* Parse the list of surface attributes and return the proper error code.
*/
@@ -319,7 +303,7 @@ _eglInitSurface(_EGLSurface *surf, _EGLDisplay *dpy, EGLint type,
surf->BufferAgeRead = EGL_FALSE;
/* the default swap interval is 1 */
- _eglClampSwapInterval(surf, 1);
+ surf->SwapInterval = 1;
err = _eglParseSurfaceAttribList(surf, attrib_list);
if (err != EGL_SUCCESS)
@@ -565,6 +549,5 @@ EGLBoolean
_eglSwapInterval(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
EGLint interval)
{
- _eglClampSwapInterval(surf, interval);
return EGL_TRUE;
}