st/mesa: add support for GL_EXT_window_rectangles
[mesa.git] / src / mesa / state_tracker / st_cb_blit.c
index a05a5aff4c6ee2d153c17001e939335965ae5336..be0b103099656e82eaeba6b013321e07ed5ba8cb 100644 (file)
@@ -40,6 +40,7 @@
 #include "st_cb_blit.h"
 #include "st_cb_fbo.h"
 #include "st_manager.h"
+#include "st_scissor.h"
 
 #include "util/u_format.h"
 
@@ -117,6 +118,7 @@ st_BlitFramebuffer(struct gl_context *ctx,
                         &clip.dstX0, &clip.dstY0, &clip.dstX1, &clip.dstY1)) {
       return; /* nothing to draw/blit */
    }
+   memset(&blit, 0, sizeof(struct pipe_blit_info));
    blit.scissor_enable =
       (dstX0 != clip.dstX0) ||
       (dstY0 != clip.dstY0) ||
@@ -190,6 +192,9 @@ st_BlitFramebuffer(struct gl_context *ctx,
       blit.src.box.height = srcY0 - srcY1;
    }
 
+   if (drawFB != ctx->WinSysDrawBuffer)
+      st_window_rectangles_to_blit(ctx, &blit);
+
    blit.filter = pFilter;
    blit.render_condition_enable = TRUE;
    blit.alpha_blend = FALSE;