perf(sidecar): avoid second hardware warmup readback
This commit is contained in:
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user