[mutter/gbsneto/graphene-frustrum: 3/4] clutter/stage: Simplify frustum setup function




commit f7d0461768483a343c34e9e451fc5b1c79b999d9
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sat Oct 10 19:14:52 2020 -0300

    clutter/stage: Simplify frustum setup function
    
    We guarantee to never pass NULL clips anymore, so there's no need
    to check for such case.
    
    Remove the check for NULL clip, and remove all related variables.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489

 clutter/clutter/clutter-stage.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
---
diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c
index 9726ba0ba8..297d3b5020 100644
--- a/clutter/clutter/clutter-stage.c
+++ b/clutter/clutter/clutter-stage.c
@@ -768,12 +768,10 @@ _cogl_util_get_eye_planes_for_screen_poly (float                    *polygon,
  */
 static void
 setup_view_for_paint (ClutterStage                *stage,
-                      ClutterStageView            *view,
                       const cairo_rectangle_int_t *clip,
                       graphene_frustum_t          *out_frustum)
 {
   ClutterStagePrivate *priv = stage->priv;
-  cairo_rectangle_int_t view_layout;
   float clip_poly[8];
   float viewport[4];
   cairo_rectangle_int_t geom;
@@ -785,12 +783,6 @@ setup_view_for_paint (ClutterStage                *stage,
   viewport[2] = priv->viewport[2];
   viewport[3] = priv->viewport[3];
 
-  if (!clip)
-    {
-      clutter_stage_view_get_layout (view, &view_layout);
-      clip = &view_layout;
-    }
-
   clip_poly[0] = MAX (clip->x, 0);
   clip_poly[1] = MAX (clip->y, 0);
 
@@ -848,7 +840,7 @@ clutter_stage_do_paint_view (ClutterStage         *stage,
       for (i = 0; i < n_rectangles; i++)
         {
           cairo_region_get_rectangle (redraw_clip, i, &clip_rect);
-          setup_view_for_paint (stage, view, &clip_rect, &clip_frustum);
+          setup_view_for_paint (stage, &clip_rect, &clip_frustum);
           g_array_append_val (clip_frusta, clip_frustum);
         }
     }
@@ -862,7 +854,7 @@ clutter_stage_do_paint_view (ClutterStage         *stage,
       else
         clutter_stage_view_get_layout (view, &clip_rect);
 
-      setup_view_for_paint (stage, view, &clip_rect, &clip_frustum);
+      setup_view_for_paint (stage, &clip_rect, &clip_frustum);
       g_array_append_val (clip_frusta, clip_frustum);
     }
 


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