diff --git a/egui/benches/benchmark.rs b/egui/benches/benchmark.rs index 0d828f45..0792b990 100644 --- a/egui/benches/benchmark.rs +++ b/egui/benches/benchmark.rs @@ -2,7 +2,7 @@ use criterion::{criterion_group, criterion_main, Criterion}; pub fn criterion_benchmark(c: &mut Criterion) { let mut example_app = egui::examples::ExampleApp::default(); - let mut ctx = egui::Context::new(1.0); + let mut ctx = egui::Context::new(); let raw_input = egui::RawInput { screen_size: egui::vec2(1280.0, 1024.0), @@ -11,8 +11,7 @@ pub fn criterion_benchmark(c: &mut Criterion) { c.bench_function("example_app", |b| { b.iter(|| { - ctx.begin_frame(raw_input.clone()); - let mut ui = ctx.fullscreen_ui(); + let mut ui = ctx.begin_frame(raw_input.clone()); example_app.ui(&mut ui, ""); ctx.end_frame() }) diff --git a/egui/src/context.rs b/egui/src/context.rs index 867c1314..4dd93df8 100644 --- a/egui/src/context.rs +++ b/egui/src/context.rs @@ -16,13 +16,14 @@ struct PaintStats { /// `Ui`:s keep an Arc pointer to this. /// This allows us to create several child `Ui`:s at once, /// all working against the same shared Context. +#[derive(Default)] pub struct Context { /// The default style for new `Ui`:s style: Mutex