diff options
author | Eric Engestrom <[email protected]> | 2017-07-31 14:49:31 +0100 |
---|---|---|
committer | Eric Engestrom <[email protected]> | 2017-08-01 17:36:57 +0100 |
commit | 2714a8f3e95139d2c473f99e913562929ae3f5d7 (patch) | |
tree | 7dafe8237011053b0d1c795e0d6a8657be9c16d8 /src/egl/drivers | |
parent | 54826331b31d4cdcb3a7e444caf97b75c3364b54 (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/drivers')
-rw-r--r-- | src/egl/drivers/dri2/platform_wayland.c | 14 | ||||
-rw-r--r-- | src/egl/drivers/dri2/platform_x11.c | 9 |
2 files changed, 2 insertions, 21 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index ff35507d255..02db473c8ca 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -63,10 +63,6 @@ enum wl_drm_format_flags { HAS_RGB565 = 4, }; -static EGLBoolean -dri2_wl_swap_interval(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf, - EGLint interval); - static int roundtrip(struct dri2_egl_display *dri2_dpy) { @@ -230,8 +226,7 @@ dri2_wl_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp, goto cleanup_surf; } - dri2_wl_swap_interval(drv, disp, &dri2_surf->base, - dri2_dpy->default_swap_interval); + dri2_surf->base.SwapInterval = dri2_dpy->default_swap_interval; return &dri2_surf->base; @@ -1150,13 +1145,6 @@ dri2_wl_swap_interval(_EGLDriver *drv, _EGLSurface *surf, EGLint interval) { - if (interval > surf->Config->MaxSwapInterval) - interval = surf->Config->MaxSwapInterval; - else if (interval < surf->Config->MinSwapInterval) - interval = surf->Config->MinSwapInterval; - - surf->SwapInterval = interval; - return EGL_TRUE; } diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c index b01f739010b..35c62a4975a 100644 --- a/src/egl/drivers/dri2/platform_x11.c +++ b/src/egl/drivers/dri2/platform_x11.c @@ -956,16 +956,9 @@ dri2_x11_swap_interval(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf, struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf); - if (interval > surf->Config->MaxSwapInterval) - interval = surf->Config->MaxSwapInterval; - else if (interval < surf->Config->MinSwapInterval) - interval = surf->Config->MinSwapInterval; - - if (interval != surf->SwapInterval && dri2_dpy->swap_available) + if (dri2_dpy->swap_available) xcb_dri2_swap_interval(dri2_dpy->conn, dri2_surf->drawable, interval); - surf->SwapInterval = interval; - return EGL_TRUE; } |