Restructured everything to make profiling a feature of iced_winit.

This commit is contained in:
bungoboingo 2022-12-20 20:41:09 -08:00 committed by Héctor Ramón Jiménez
parent c5cd236b73
commit 4b6d3797d4
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
23 changed files with 184 additions and 254 deletions

View file

@ -21,8 +21,8 @@ use glow::HasContext;
use std::cell::RefCell;
#[cfg(feature = "trace")]
use iced_profiling::info_span;
#[cfg(feature = "tracing")]
use tracing::info_span;
#[derive(Debug)]
pub(crate) struct Pipeline {
@ -151,7 +151,7 @@ impl Pipeline {
images: &[layer::Image],
layer_bounds: Rectangle<u32>,
) {
#[cfg(feature = "trace")]
#[cfg(feature = "tracing")]
let _ = info_span!("Glow::Image", "DRAW").entered();
unsafe {

View file

@ -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<u32>,
) {
#[cfg(feature = "trace")]
#[cfg(feature = "tracing")]
let _ = info_span!("Glow::Quad", "DRAW").enter();
match self {

View file

@ -9,8 +9,8 @@ use iced_graphics::triangle::{ColoredVertex2D, Vertex2D};
use glow::HasContext;
use std::marker::PhantomData;
#[cfg(feature = "trace")]
use iced_profiling::info_span;
#[cfg(feature = "tracing")]
use tracing::info_span;
const DEFAULT_VERTICES: usize = 1_000;
const DEFAULT_INDICES: usize = 1_000;
@ -61,7 +61,7 @@ impl Pipeline {
transformation: Transformation,
scale_factor: f32,
) {
#[cfg(feature = "trace")]
#[cfg(feature = "tracing")]
let _ = info_span!("Glow::Triangle", "DRAW").enter();
unsafe {