[clutter/clutter-1.6] cogl-journal: Fix software clipping for non-intersecting rectangles



commit 52aa38663dc23b61b13dce0d5a57fa0ef448cf3c
Author: Neil Roberts <neil linux intel com>
Date:   Wed Sep 14 16:34:35 2011 +0100

    cogl-journal: Fix software clipping for non-intersecting rectangles
    
    When the clip contains two rectangles which do not intersect it was
    generating a clip bounds where the bottom-right corner was above or to
    the left of the top-left corner. This would end up allowing the pixels
    between the two rectangles instead of clipping everything like it
    should. To fix this there is now an extra check which detects this
    situation and just clears the clip bounds to all zeroes in a similar
    way to what cogl-clip-stack does.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=659029
    
    Reviewed-by: Robert Bragg <robert linux intel com>
    
    Backported from e81c1f3e9 on the Cogl master branch

 clutter/cogl/cogl/cogl-journal.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/clutter/cogl/cogl/cogl-journal.c b/clutter/cogl/cogl/cogl-journal.c
index ea152f3..7b6bb2c 100644
--- a/clutter/cogl/cogl/cogl-journal.c
+++ b/clutter/cogl/cogl/cogl-journal.c
@@ -894,6 +894,10 @@ can_software_clip_entry (CoglJournalEntry *journal_entry,
       clip_bounds_out->y_2 = MIN (clip_bounds_out->y_2, rect_y2 - ty);
     }
 
+  if (clip_bounds_out->x_2 <= clip_bounds_out->x_1 ||
+      clip_bounds_out->y_2 <= clip_bounds_out->y_1)
+    memset (clip_bounds_out, 0, sizeof (ClipBounds));
+
   return TRUE;
 }
 



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