Implement stable serialization and restoration for dock layouts, including auto-hidden and floating panels
- Add `persistence.rs` for stable serialization of dock layouts without runtime identifiers. - Introduce `preview.rs` for geometry handling of dock drop previews. - Create `sizing.rs` to manage content-aware sizing policies and constraint solving for dock panels. - Implement `welcome.rs` to provide a welcome surface when no documents are open, featuring New and Open actions.
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
//! - Allocates ~400MB of pixel/tile/mask buffers.
|
||||
//! - Uses `std::time::Instant` for measurement; results depend on the host CPU.
|
||||
|
||||
use hcie_engine_api::{Engine, BrushTip, BrushStyle};
|
||||
use hcie_engine_api::{BrushStyle, BrushTip, Engine};
|
||||
|
||||
const W: u32 = 3840;
|
||||
const H: u32 = 2160;
|
||||
@@ -112,18 +112,29 @@ fn benchmark_4k_stroke_on_multilayer_document() {
|
||||
let total_us = total_start.elapsed().as_micros() as f64;
|
||||
|
||||
let avg_segment_us = segment_times.iter().sum::<f64>() / segment_times.len().max(1) as f64;
|
||||
let avg_composite_us = composite_times.iter().sum::<f64>() / composite_times.len().max(1) as f64;
|
||||
let avg_composite_us =
|
||||
composite_times.iter().sum::<f64>() / composite_times.len().max(1) as f64;
|
||||
let max_segment_us = segment_times.iter().copied().fold(0.0, f64::max);
|
||||
let max_composite_us = composite_times.iter().copied().fold(0.0, f64::max);
|
||||
|
||||
println!("\n=== 4K Multi-Layer Stroke Benchmark ===");
|
||||
println!("Canvas: {}x{}, Layers: {}, Segments: {}", W, H, LAYERS, SEGMENTS);
|
||||
println!(
|
||||
"Canvas: {}x{}, Layers: {}, Segments: {}",
|
||||
W, H, LAYERS, SEGMENTS
|
||||
);
|
||||
println!("Average stroke_to: {:>8.1} us", avg_segment_us);
|
||||
println!("Max stroke_to: {:>8.1} us", max_segment_us);
|
||||
println!("Average composite: {:>8.1} us", avg_composite_us);
|
||||
println!("Max composite: {:>8.1} us", max_composite_us);
|
||||
println!("Total wall time: {:>8.1} us ({:.2} s)", total_us, total_us / 1_000_000.0);
|
||||
println!("Segments per second: {:>8.1}", SEGMENTS as f64 / (total_us / 1_000_000.0));
|
||||
println!(
|
||||
"Total wall time: {:>8.1} us ({:.2} s)",
|
||||
total_us,
|
||||
total_us / 1_000_000.0
|
||||
);
|
||||
println!(
|
||||
"Segments per second: {:>8.1}",
|
||||
SEGMENTS as f64 / (total_us / 1_000_000.0)
|
||||
);
|
||||
|
||||
// Soft sanity check: the engine must still report a valid top layer and the
|
||||
// document must be marked modified after painting.
|
||||
|
||||
Reference in New Issue
Block a user