From c5cd236b7380c3689792934aeaecd2942713fa67 Mon Sep 17 00:00:00 2001 From: Bingus Date: Tue, 29 Nov 2022 19:50:58 -0800 Subject: Initial profiling support for Iced. --- glow/src/quad.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'glow/src/quad.rs') diff --git a/glow/src/quad.rs b/glow/src/quad.rs index d9f1c6ae..fc918bf2 100644 --- a/glow/src/quad.rs +++ b/glow/src/quad.rs @@ -7,6 +7,9 @@ use glow::HasContext; use iced_graphics::layer; use iced_native::Rectangle; +#[cfg(feature = "trace")] +use iced_profiling::info_span; + #[derive(Debug)] pub enum Pipeline { Core(core::Pipeline), @@ -42,6 +45,9 @@ impl Pipeline { scale: f32, bounds: Rectangle, ) { + #[cfg(feature = "trace")] + let _ = info_span!("Glow::Quad", "DRAW").enter(); + match self { Pipeline::Core(pipeline) => { pipeline.draw( -- cgit From 4b6d3797d43acb1d78a292a7ec712a0be7c8f6a2 Mon Sep 17 00:00:00 2001 From: bungoboingo Date: Tue, 20 Dec 2022 20:41:09 -0800 Subject: Restructured everything to make profiling a feature of iced_winit. --- glow/src/quad.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'glow/src/quad.rs') diff --git a/glow/src/quad.rs b/glow/src/quad.rs index fc918bf2..67d9a098 100644 --- a/glow/src/quad.rs +++ b/glow/src/quad.rs @@ -7,8 +7,8 @@ use glow::HasContext; use iced_graphics::layer; use iced_native::Rectangle; -#[cfg(feature = "trace")] -use iced_profiling::info_span; +#[cfg(feature = "tracing")] +use tracing::info_span; #[derive(Debug)] pub enum Pipeline { @@ -45,7 +45,7 @@ impl Pipeline { scale: f32, bounds: Rectangle, ) { - #[cfg(feature = "trace")] + #[cfg(feature = "tracing")] let _ = info_span!("Glow::Quad", "DRAW").enter(); match self { -- cgit