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/triangle.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'glow/src/triangle.rs') diff --git a/glow/src/triangle.rs b/glow/src/triangle.rs index d0205e08..11d24349 100644 --- a/glow/src/triangle.rs +++ b/glow/src/triangle.rs @@ -9,6 +9,9 @@ use iced_graphics::triangle::{ColoredVertex2D, Vertex2D}; use glow::HasContext; use std::marker::PhantomData; +#[cfg(feature = "trace")] +use iced_profiling::info_span; + const DEFAULT_VERTICES: usize = 1_000; const DEFAULT_INDICES: usize = 1_000; @@ -58,6 +61,9 @@ impl Pipeline { transformation: Transformation, scale_factor: f32, ) { + #[cfg(feature = "trace")] + let _ = info_span!("Glow::Triangle", "DRAW").enter(); + unsafe { gl.enable(glow::MULTISAMPLE); gl.enable(glow::SCISSOR_TEST); -- cgit