mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 06:10:06 -04:00
Introduce egui::FullOutput, returned from Context::run (#1292)
* Introduce `egui::FullOutput`, returned from `Context::run` * Rename `Output` to `PlatformOutput`
This commit is contained in:
@@ -13,10 +13,10 @@ pub fn criterion_benchmark(c: &mut Criterion) {
|
||||
// The most end-to-end benchmark.
|
||||
c.bench_function("demo_with_tessellate__realistic", |b| {
|
||||
b.iter(|| {
|
||||
let (_output, shapes) = ctx.run(RawInput::default(), |ctx| {
|
||||
let full_output = ctx.run(RawInput::default(), |ctx| {
|
||||
demo_windows.ui(ctx);
|
||||
});
|
||||
ctx.tessellate(shapes)
|
||||
ctx.tessellate(full_output.shapes)
|
||||
})
|
||||
});
|
||||
|
||||
@@ -28,11 +28,11 @@ pub fn criterion_benchmark(c: &mut Criterion) {
|
||||
})
|
||||
});
|
||||
|
||||
let (_output, shapes) = ctx.run(RawInput::default(), |ctx| {
|
||||
let full_output = ctx.run(RawInput::default(), |ctx| {
|
||||
demo_windows.ui(ctx);
|
||||
});
|
||||
c.bench_function("demo_only_tessellate", |b| {
|
||||
b.iter(|| ctx.tessellate(shapes.clone()))
|
||||
b.iter(|| ctx.tessellate(full_output.shapes.clone()))
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -145,10 +145,10 @@ fn test_egui_e2e() {
|
||||
|
||||
const NUM_FRAMES: usize = 5;
|
||||
for _ in 0..NUM_FRAMES {
|
||||
let (_output, shapes) = ctx.run(raw_input.clone(), |ctx| {
|
||||
let full_output = ctx.run(raw_input.clone(), |ctx| {
|
||||
demo_windows.ui(ctx);
|
||||
});
|
||||
let clipped_meshes = ctx.tessellate(shapes);
|
||||
let clipped_meshes = ctx.tessellate(full_output.shapes);
|
||||
assert!(!clipped_meshes.is_empty());
|
||||
}
|
||||
}
|
||||
@@ -164,10 +164,10 @@ fn test_egui_zero_window_size() {
|
||||
|
||||
const NUM_FRAMES: usize = 5;
|
||||
for _ in 0..NUM_FRAMES {
|
||||
let (_output, shapes) = ctx.run(raw_input.clone(), |ctx| {
|
||||
let full_output = ctx.run(raw_input.clone(), |ctx| {
|
||||
demo_windows.ui(ctx);
|
||||
});
|
||||
let clipped_meshes = ctx.tessellate(shapes);
|
||||
let clipped_meshes = ctx.tessellate(full_output.shapes);
|
||||
assert!(clipped_meshes.is_empty(), "There should be nothing to show");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user