egl/x11: flatten codeflow
authorEmil Velikov <emil.velikov@collabora.com>
Mon, 22 May 2017 17:23:03 +0000 (18:23 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 29 May 2017 15:59:38 +0000 (16:59 +0100)
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
src/egl/drivers/dri2/platform_x11.c

index ea9b5e15ba4dc028042b082e3c7fec435191f4a7..8d8c7cb4905b4f5dd5e1461cb10b0a59499c9516 100644 (file)
@@ -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