[mutter/gbsneto/graphene-frustrum: 48/49] clutter/stage: Simplify frustum setup function




commit 5c16bb10da4fdc351b8129d8661cd6c532df4122
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 8c8b6d9be1..74a105ded9 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);
 
@@ -843,7 +835,7 @@ clutter_stage_do_paint_view (ClutterStage         *stage,
       for (i = 0; i < cairo_region_num_rectangles (redraw_clip); 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);
         }
     }
@@ -854,7 +846,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]