[mutter/wip/carlosg/tracing-checks: 1/3] clutter: Add COGL_HAS_TRACING checks around tracing code




commit 1d42771bc42338d7497ed7d3beffe417569b234e
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Aug 2 17:14:02 2021 +0200

    clutter: Add COGL_HAS_TRACING checks around tracing code
    
    This code sneaked unconditionally, even though we can disable
    tracing code with -Dprofiler=false. Add some COGL_HAS_TRACING
    checks so that this code is also optionally built.

 clutter/clutter/clutter-actor.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index a8e5da59e8..b8814009f1 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -3651,6 +3651,7 @@ clutter_actor_paint (ClutterActor        *self,
   if (!CLUTTER_ACTOR_IS_MAPPED (self))
     return;
 
+#ifdef COGL_HAS_TRACING
   COGL_TRACE_SCOPED_ANCHOR (ClutterActorPaint);
 
   if (G_UNLIKELY (clutter_debug_flags & CLUTTER_DEBUG_DETAILED_TRACE))
@@ -3660,6 +3661,7 @@ clutter_actor_paint (ClutterActor        *self,
       COGL_TRACE_DESCRIBE (ClutterActorPaint,
                            _clutter_actor_get_debug_name (self));
     }
+#endif
 
   actor_node = clutter_actor_node_new (self, -1);
   root_node = clutter_paint_node_ref (actor_node);
@@ -9203,6 +9205,7 @@ clutter_actor_allocate (ClutterActor          *self,
       !clutter_actor_has_mapped_clones (self))
     return;
 
+#ifdef COGL_HAS_TRACING
   COGL_TRACE_SCOPED_ANCHOR (ClutterActorAllocate);
 
   if (G_UNLIKELY (clutter_debug_flags & CLUTTER_DEBUG_DETAILED_TRACE))
@@ -9212,6 +9215,7 @@ clutter_actor_allocate (ClutterActor          *self,
       COGL_TRACE_DESCRIBE (ClutterActorAllocate,
                            _clutter_actor_get_debug_name (self));
     }
+#endif
 
   old_allocation = priv->allocation;
   real_allocation = *box;


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