st/xlib: Flush the front buffer before doing CopySubBuffer
authorStéphane Marchesin <marcheu@chromium.org>
Sat, 11 May 2013 01:30:46 +0000 (18:30 -0700)
committerStéphane Marchesin <marcheu@chromium.org>
Sat, 8 Jun 2013 01:53:54 +0000 (18:53 -0700)
We flush pending rendering before running CopySubBuffer, which
ensures that the right bits get to the screen.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/state_trackers/glx/xlib/xm_api.c

index c39968dc7cfcd87b997bc8f0eab936b40407247b..b758c8eaae74c97ce949f1f86595eccd6a9641d0 100644 (file)
@@ -1253,6 +1253,10 @@ void XMesaSwapBuffers( XMesaBuffer b )
  */
 void XMesaCopySubBuffer( XMesaBuffer b, int x, int y, int width, int height )
 {
+   XMesaContext xmctx = XMesaGetCurrentContext();
+
+   xmctx->st->flush( xmctx->st, ST_FLUSH_FRONT, NULL);
+
    xmesa_copy_st_framebuffer(b->stfb,
          ST_ATTACHMENT_BACK_LEFT, ST_ATTACHMENT_FRONT_LEFT,
          x, b->height - y - height, width, height);