perf(sidecar): avoid second hardware warmup readback

This commit is contained in:
2026-05-16 04:55:47 -04:00
parent df092f285c
commit 76a56decff
3 changed files with 13 additions and 19 deletions
@@ -14,6 +14,7 @@
use dpi::PhysicalSize;
use ely_servo_host::HardwareOffscreenContext;
use servo::RenderingContext;
#[test]
fn constructs_or_explains_why_not() {
@@ -52,6 +53,8 @@ fn extracts_iosurface_mach_port_from_current_surface() -> Result<(), String> {
}
};
context.prepare_for_rendering();
context.present();
let first = context
.current_iosurface_mach_port()
.map_err(|error| format!("first IOSurface mach port extraction failed: {error:?}"))?;
@@ -163,6 +163,10 @@ fn run_live_bench() -> Result<(), Box<dyn Error>> {
);
if kind == "hardware" {
let full_readback_budget = viewport_bytes * u64::from(frames);
assert_eq!(
outcome.readback_rgba_bytes, viewport_bytes,
"hardware path should read back only the initial visible frame"
);
assert!(
total_rgba_bytes < full_readback_budget,
"hardware path stayed on full readback: {total_rgba_bytes} >= {full_readback_budget}"