[mutter/gbsneto/graphene-frustrum: 8/13] clutter/stage: Don't setup view on pick




commit 0ad2a3d84c358e4718e5185c4fcd75df20094f45
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Oct 9 20:10:51 2020 -0300

    clutter/stage: Don't setup view on pick
    
    While refactoring the clipping planes / frustum code, it became more and
    more evident that we do not need to update them while picking. Picking
    nowadays goes through a completely different code path, that does not
    rely on paint volume culling.
    
    While it might be interesting to eventually also cull out based on paint
    volumes, it certainly won't go through the painting code anymore.
    
    Remove setting up the view when picking, and rename functions appropriatedly.

 clutter/clutter/clutter-stage.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c
index 7e223728ff..cddcb250a9 100644
--- a/clutter/clutter/clutter-stage.c
+++ b/clutter/clutter/clutter-stage.c
@@ -769,9 +769,9 @@ _cogl_util_get_eye_planes_for_screen_poly (float                   *polygon,
  * be able to cull them.
  */
 static void
-setup_view_for_pick_or_paint (ClutterStage                *stage,
-                              ClutterStageView            *view,
-                              const cairo_rectangle_int_t *clip)
+setup_view_for_paint (ClutterStage                *stage,
+                      ClutterStageView            *view,
+                      const cairo_rectangle_int_t *clip)
 {
   ClutterStagePrivate *priv = stage->priv;
   cairo_rectangle_int_t view_layout;
@@ -838,7 +838,7 @@ clutter_stage_do_paint_view (ClutterStage         *stage,
                                                       CLUTTER_PAINT_FLAG_NONE);
 
   cairo_region_get_extents (redraw_clip, &clip_rect);
-  setup_view_for_pick_or_paint (stage, view, &clip_rect);
+  setup_view_for_paint (stage, view, &clip_rect);
 
   clutter_actor_paint (CLUTTER_ACTOR (stage), paint_context);
   clutter_paint_context_destroy (paint_context);
@@ -1480,7 +1480,7 @@ _clutter_stage_do_pick_on_view (ClutterStage     *stage,
       pick_context = clutter_pick_context_new_for_view (view);
 
       context->pick_mode = mode;
-      setup_view_for_pick_or_paint (stage, view, NULL);
+      priv->cached_pick_mode = CLUTTER_PICK_NONE;
       clutter_actor_pick (CLUTTER_ACTOR (stage), pick_context);
       context->pick_mode = CLUTTER_PICK_NONE;
       priv->cached_pick_mode = mode;


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