diff options
author | Emil Velikov <[email protected]> | 2017-05-22 18:23:03 +0100 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2017-05-29 16:59:38 +0100 |
commit | 6b46854269ed50f405faeb0f1f7e484b11dca2b4 (patch) | |
tree | a8e2348a80f22d0f10c103a96d5bf55f63de013a /src/egl | |
parent | 14e51d526ff68e3e4b054b8e5d7df83f0cc313d6 (diff) |
egl/x11: flatten codeflow
Signed-off-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/egl')
-rw-r--r-- | src/egl/drivers/dri2/platform_x11.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c index ea9b5e15ba4..8d8c7cb4905 100644 --- a/src/egl/drivers/dri2/platform_x11.c +++ b/src/egl/drivers/dri2/platform_x11.c @@ -891,19 +891,17 @@ dri2_x11_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw) struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw); - if (dri2_dpy->flush) { - if (dri2_x11_swap_buffers_msc(drv, disp, draw, 0, 0, 0) != -1) { - return EGL_TRUE; - } + if (!dri2_dpy->flush) { + dri2_dpy->core->swapBuffers(dri2_surf->dri_drawable); + return EGL_TRUE; + } + + if (dri2_x11_swap_buffers_msc(drv, disp, draw, 0, 0, 0) == -1) { /* Swap failed with a window drawable. */ _eglError(EGL_BAD_NATIVE_WINDOW, __func__); return EGL_FALSE; - } else { - assert(dri2_dpy->swrast); - - dri2_dpy->core->swapBuffers(dri2_surf->dri_drawable); - return EGL_TRUE; } + return EGL_TRUE; } static EGLBoolean |