[mutter] clutter/stage-cogl: Don't push scissor clip with one clip rectangle



commit 3fed768db4687d0cbe7391b57615b6f94436bf91
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Fri Mar 6 11:59:54 2020 +0100

    clutter/stage-cogl: Don't push scissor clip with one clip rectangle
    
    While this is meant as an optimzation to only use the scissor clip and
    not the stencil buffer if there's only one clip rectangle, it's not
    needed since this optimization is going to be applied to region clips
    anyway inside _cogl_clip_stack_gl_flush() (see cogl-clip-stack-gl.c).
    
    So remove the unnecessary optimization here and rely on cogl-clip-stack
    to do it for us.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1113

 clutter/clutter/cogl/clutter-stage-cogl.c | 24 +-----------------------
 1 file changed, 1 insertion(+), 23 deletions(-)
---
diff --git a/clutter/clutter/cogl/clutter-stage-cogl.c b/clutter/clutter/cogl/clutter-stage-cogl.c
index 3ac09038d..9321aeb33 100644
--- a/clutter/clutter/cogl/clutter-stage-cogl.c
+++ b/clutter/clutter/cogl/clutter-stage-cogl.c
@@ -725,29 +725,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
     }
   else if (use_clipped_redraw)
     {
-      cairo_rectangle_int_t clip_rect;
-
-      if (cairo_region_num_rectangles (fb_clip_region) == 1)
-        {
-          cairo_region_get_extents (fb_clip_region, &clip_rect);
-
-          CLUTTER_NOTE (CLIPPING,
-                        "Stage clip pushed: x=%d, y=%d, width=%d, height=%d\n",
-                        clip_rect.x,
-                        clip_rect.y,
-                        clip_rect.width,
-                        clip_rect.height);
-
-          cogl_framebuffer_push_scissor_clip (fb,
-                                              clip_rect.x,
-                                              clip_rect.y,
-                                              clip_rect.width,
-                                              clip_rect.height);
-        }
-      else
-        {
-          cogl_framebuffer_push_region_clip (fb, fb_clip_region);
-        }
+      cogl_framebuffer_push_region_clip (fb, fb_clip_region);
 
       paint_stage (stage_cogl, view, redraw_clip);
 


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