1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 06:10:06 -04:00

Add opt-in puffin feature to egui-extras (#3307)

* Add opt-in `puffin` feature to `egui-extras`

Image loading can be slow.

Related to https://github.com/emilk/egui/pull/3297

* Silence warning
This commit is contained in:
Emil Ernerfeldt
2023-09-05 14:11:29 +02:00
committed by GitHub
parent 67168be069
commit 707ca04c08
4 changed files with 45 additions and 3 deletions

View File

@@ -28,6 +28,38 @@ pub use crate::sizing::Size;
pub use crate::strip::*;
pub use crate::table::*;
// ---------------------------------------------------------------------------
mod profiling_scopes {
#![allow(unused_macros)]
#![allow(unused_imports)]
/// Profiling macro for feature "puffin"
macro_rules! profile_function {
($($arg: tt)*) => {
#[cfg(not(target_arch = "wasm32"))] // Disabled on web because of the coarse 1ms clock resolution there.
#[cfg(feature = "puffin")]
puffin::profile_function!($($arg)*);
};
}
pub(crate) use profile_function;
/// Profiling macro for feature "puffin"
macro_rules! profile_scope {
($($arg: tt)*) => {
#[cfg(not(target_arch = "wasm32"))] // Disabled on web because of the coarse 1ms clock resolution there.
#[cfg(feature = "puffin")]
puffin::profile_scope!($($arg)*);
};
}
pub(crate) use profile_scope;
}
#[allow(unused_imports)]
pub(crate) use profiling_scopes::*;
// ---------------------------------------------------------------------------
/// Log an error with either `log` or `eprintln`
macro_rules! log_err {
($fmt: literal, $($arg: tt)*) => {{