[mutter/wip/carlosg/tracing-checks: 2/3] compositor: Add COGL_HAS_TRACING checks around tracing code




commit fd33c0eed9e9ba9b14d01cd0b2b35bad7dab0fb1
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Aug 2 17:15:23 2021 +0200

    compositor: 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.

 src/compositor/meta-window-actor-x11.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/compositor/meta-window-actor-x11.c b/src/compositor/meta-window-actor-x11.c
index 44cf5a67c4..664baafdd6 100644
--- a/src/compositor/meta-window-actor-x11.c
+++ b/src/compositor/meta-window-actor-x11.c
@@ -190,6 +190,7 @@ do_send_frame_drawn (MetaWindowActorX11 *actor_x11,
   XFlush (xdisplay);
   meta_x11_error_trap_pop (display->x11_display);
 
+#ifdef COGL_HAS_TRACING
   if (G_UNLIKELY (cogl_is_tracing_enabled ()))
     {
       g_autofree char *description = NULL;
@@ -202,6 +203,7 @@ do_send_frame_drawn (MetaWindowActorX11 *actor_x11,
                            description);
       COGL_TRACE_END (MetaWindowActorX11FrameDrawn);
     }
+#endif
 }
 
 static void
@@ -251,6 +253,7 @@ do_send_frame_timings (MetaWindowActorX11 *actor_x11,
   XFlush (xdisplay);
   meta_x11_error_trap_pop (display->x11_display);
 
+#ifdef COGL_HAS_TRACING
   if (G_UNLIKELY (cogl_is_tracing_enabled ()))
     {
       g_autofree char *description = NULL;
@@ -265,6 +268,7 @@ do_send_frame_timings (MetaWindowActorX11 *actor_x11,
       COGL_TRACE_DESCRIBE (MetaWindowActorX11FrameTimings, description);
       COGL_TRACE_END (MetaWindowActorX11FrameTimings);
     }
+#endif
 }
 
 static void


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