[cogl/cogl-1.12] Clear the scissor before calling glBlitFramebuffer in swap_region



commit f1baa4d60f1b48ee431c4aa78735baba8ec1d50b
Author: Neil Roberts <neil linux intel com>
Date:   Wed Dec 19 13:58:55 2012 +0000

    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 <robert linux intel com>
    Tested-by: Aaron Plattner <aplattner nvidia com>
    
    (cherry picked from commit 65da3f88af9c7b8d72758d116c2652aff68195c1)

 cogl/winsys/cogl-winsys-glx.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/cogl/winsys/cogl-winsys-glx.c b/cogl/winsys/cogl-winsys-glx.c
index 839464f..b24ebf1 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++)
         {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]