From f1baa4d60f1b48ee431c4aa78735baba8ec1d50b Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Wed, 19 Dec 2012 13:58:55 +0000 Subject: [PATCH] Clear the scissor before calling glBlitFramebuffer in swap_region glBlitFramebuffer is affected by the scissor so we need to ensure there is an empty clip flushed before using it. This is similar to what is done in _cogl_blit_framebuffer(). https://bugzilla.gnome.org/show_bug.cgi?id=690451 Reviewed-by: Robert Bragg Tested-by: Aaron Plattner (cherry picked from commit 65da3f88af9c7b8d72758d116c2652aff68195c1) --- cogl/winsys/cogl-winsys-glx.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cogl/winsys/cogl-winsys-glx.c b/cogl/winsys/cogl-winsys-glx.c index 839464f53..b24ebf197 100644 --- a/cogl/winsys/cogl-winsys-glx.c +++ b/cogl/winsys/cogl-winsys-glx.c @@ -1285,6 +1285,15 @@ _cogl_winsys_onscreen_swap_region (CoglOnscreen *onscreen, int i; /* XXX: checkout how this state interacts with the code to use * glBlitFramebuffer in Neil's texture atlasing branch */ + + /* glBlitFramebuffer is affected by the scissor so we need to + * ensure we have flushed an empty clip stack to get rid of it. + * We also mark that the clip state is dirty so that it will be + * flushed to the correct state the next time something is + * drawn */ + _cogl_clip_stack_flush (NULL, framebuffer); + context->current_draw_buffer_changes |= COGL_FRAMEBUFFER_STATE_CLIP; + context->glDrawBuffer (GL_FRONT); for (i = 0; i < n_rectangles; i++) {