Skip to content

Commit b872e5b

Browse files
authored
feat: Add performance-overlay feature to freya crate (#809)
1 parent cb33aba commit b872e5b

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ devtools = ["freya/devtools"]
1212
use_camera = ["freya/use_camera"]
1313
hot-reload = ["freya/hot-reload"]
1414
custom-tokio-rt = ["freya/custom-tokio-rt"]
15+
performance-overlay = ["freya/performance-overlay"]
1516

1617
[patch.crates-io]
1718
# dioxus = { git = "https://github.com/DioxusLabs/dioxus", rev = "7beacdf9c76ae5412d3c2bcd55f7c5d87f486a0f" }

crates/freya/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ devtools = ["dep:freya-devtools"]
2424
use_camera = ["freya-hooks/use_camera"]
2525
mocked-engine-development = ["freya-engine/mocked-engine"] # This is just for the CI
2626
default = ["skia"]
27+
performance-overlay = []
2728

2829
[dependencies]
2930
freya-devtools = { workspace = true, optional = true }

crates/freya/src/launch.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ pub fn launch_with_props(app: AppComponent, title: &'static str, (width, height)
178178
/// }
179179
/// ```
180180
pub fn launch_cfg<T: 'static + Clone>(app: AppComponent, config: LaunchConfig<T>) {
181+
#[cfg(feature = "performance-overlay")]
182+
let config = config.with_plugin(crate::plugins::PerformanceOverlayPlugin::default());
183+
181184
use freya_core::prelude::{
182185
FreyaDOM,
183186
SafeDOM,

0 commit comments

Comments
 (0)