test(sidecar): align live perf bench

This commit is contained in:
2026-05-16 01:12:10 -04:00
parent 5f49786c6e
commit c6de666d1c
2 changed files with 49 additions and 78 deletions
@@ -103,7 +103,7 @@ impl LiveOutcome {
}
}
#[cfg(any(test, all(feature = "hardware-render", target_os = "macos")))]
#[cfg(test)]
pub fn from_report(report: LiveFrameReport, partial_timings: PartialFrameTimings) -> Self {
Self {
response: LiveResponse::frame(report),
@@ -204,33 +204,6 @@ impl LiveFrameReport {
sample_hash: frame.sample_hash(),
}
}
/// Build a report for the hardware IOSurface path. Pixel metrics
/// are unavailable because the path skips framebuffer readback.
#[cfg(all(feature = "hardware-render", target_os = "macos"))]
pub fn new_hardware_surface(
snapshot: &WebViewSnapshot,
width: u32,
height: u32,
device_pixel_ratio: f32,
) -> Self {
let (css_viewport_width, css_viewport_height) =
css_viewport_size(width, height, device_pixel_ratio);
Self {
loaded_url: snapshot.url().map(str::to_string),
title: snapshot.title().map(str::to_string),
state: state_label(snapshot.state()),
width,
height,
device_pixel_ratio,
css_viewport_width,
css_viewport_height,
rgba_byte_count: 0,
non_white_pixel_count: 0,
content_pixel_count: 0,
sample_hash: 0,
}
}
}
fn css_viewport_size(width: u32, height: u32, device_pixel_ratio: f32) -> (u32, u32) {