[mutter] clutter/stage: Move out tracing from do_update() to callees



commit 14dfe929f2a80efbc30fa249616f80495d595ac6
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Sat Apr 4 01:00:26 2020 +0200

    clutter/stage: Move out tracing from do_update() to callees
    
    This makes the function a bit more cluttered, and it'll always trace
    when the same functions are called from other places.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285

 clutter/clutter/clutter-stage.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c
index f46865e78e..b95861763c 100644
--- a/clutter/clutter/clutter-stage.c
+++ b/clutter/clutter/clutter-stage.c
@@ -1218,6 +1218,8 @@ _clutter_stage_maybe_relayout (ClutterActor *actor)
   if (priv->pending_relayouts == NULL)
     return;
 
+  COGL_TRACE_BEGIN_SCOPED (ClutterStageRelayout, "Layout");
+
   CLUTTER_NOTE (ACTOR, ">>> Recomputing layout");
 
   stolen_list = g_steal_pointer (&priv->pending_relayouts);
@@ -1266,6 +1268,8 @@ clutter_stage_do_redraw (ClutterStage *stage)
   if (priv->impl == NULL)
     return;
 
+  COGL_TRACE_BEGIN_SCOPED (ClutterStagePaint, "Paint");
+
   CLUTTER_NOTE (PAINT, "Redraw started for stage '%s'[%p]",
                 _clutter_actor_get_debug_name (actor),
                 stage);
@@ -1421,12 +1425,8 @@ _clutter_stage_do_update (ClutterStage *stage)
    * check or clear the pending redraws flag since a relayout may
    * queue a redraw.
    */
-  COGL_TRACE_BEGIN (ClutterStageRelayout, "Layout");
-
   _clutter_stage_maybe_relayout (CLUTTER_ACTOR (stage));
 
-  COGL_TRACE_END (ClutterStageRelayout);
-
   if (!priv->redraw_pending)
     return FALSE;
 
@@ -1435,13 +1435,9 @@ _clutter_stage_do_update (ClutterStage *stage)
 
   update_actor_stage_views (stage);
 
-  COGL_TRACE_BEGIN (ClutterStagePaint, "Paint");
-
   clutter_stage_maybe_finish_queue_redraws (stage);
   clutter_stage_do_redraw (stage);
 
-  COGL_TRACE_END (ClutterStagePaint);
-
   /* reset the guard, so that new redraws are possible */
   priv->redraw_pending = FALSE;
 
@@ -3362,6 +3358,8 @@ clutter_stage_maybe_finish_queue_redraws (ClutterStage *stage)
 {
   ClutterStagePrivate *priv = stage->priv;
 
+  COGL_TRACE_BEGIN_SCOPED (ClutterStageFinishQueueRedraws, "FinishQueueRedraws");
+
   if (!priv->pending_finish_queue_redraws)
     return;
 


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