Skip to content

Commit fd8e6ce

Browse files
committed
test(compositor): fix two local-only D3D11 render tests
output_geometry_golden still sent roundnessPx, gone from the scene contract since the px-to-fraction refactor: every golden test panicked on a missing roundnessFrac. 24 px at 1080p is 0.0222, the value scene.rs uses for the same conversion. the_device_trails_with_the_screen_under_motion_blur built its OPENSCREEN_DEVICE_OUT file names from the rotation JSON, which for the orbit camera contains quotes and a colon (os error 123 on Windows). Each rotation now carries a short label for the file name.
1 parent 29736d4 commit fd8e6ce

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎crates/compositor/tests/device_frame_render.rs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,8 @@ fn the_device_trails_with_the_screen_under_motion_blur() {
550550
json
551551
};
552552
for device in ["laptop", "window"] {
553-
for rotation in ["null", r#""iso""#, ORBIT] {
553+
// Un libellé par rotation : ORBIT est un fragment JSON, illégal dans un nom de fichier Windows.
554+
for (label, rotation) in [("flat", "null"), ("iso", r#""iso""#), ("orbit", ORBIT)] {
554555
let case = format!("{device} {rotation}");
555556
let still = |blur| render(&comp, &blue, &json(device, rotation, blur), None, 4.0);
556557
assert!(still(0.0) == still(1.0), "{case} : immobile, le flou ne doit rien changer");
@@ -579,7 +580,7 @@ fn the_device_trails_with_the_screen_under_motion_blur() {
579580
}
580581
println!("{case:<24} {smeared:>5} / {probes:>5} sondes du cadre changent avec le flou");
581582
if let Some(dir) = out_dir("OPENSCREEN_DEVICE_OUT") {
582-
let name = format!("trail-{device}-{}", rotation.trim_matches('"'));
583+
let name = format!("trail-{device}-{label}");
583584
save(&dir, &format!("{name}-sharp"), &sharp, (W, H));
584585
save(&dir, &format!("{name}-blurred"), &blurred, (W, H));
585586
}

‎crates/compositor/tests/output_geometry_golden.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ fn scene_json(screen: &str, webcam: &str, w: u32, h: u32) -> String {
9595
r##"{{
9696
"clips": [{{"screenPath":"{s}","webcamPath":"{c}","sourceStartSec":0,"sourceEndSec":30,"webcamOffsetSec":0,"hasAudio":true}}],
9797
"layout": {{"preset":"picture-in-picture","webcamSize":1.0,"webcamShape":"rounded","webcamMirror":false,"webcamPosition":null,"webcamReactiveZoom":false}},
98-
"effects": {{"padding":0.1,"blur":true,"shadow":1.0,"roundnessPx":24,"motionBlur":0.0}},
98+
"effects": {{"padding":0.1,"blur":true,"shadow":1.0,"roundnessFrac":0.0222,"motionBlur":0.0}},
9999
"background": {{"kind":"gradient","angleDeg":135,"stops":["#eaebed","#bcc0c6"]}},
100100
"zoomRegions": [],
101101
"speedRegions": [],
@@ -212,7 +212,7 @@ fn golden_side_by_side_webcam_is_not_stretched() {
212212
"clips": [{{"screenPath":"{s}","webcamPath":"{c}","sourceStartSec":0,"sourceEndSec":30,"webcamOffsetSec":0,"hasAudio":true}}],
213213
"layout": {{"preset":"dual-frame","webcamSize":1.0,"webcamShape":"rectangle","webcamMirror":false,
214214
"webcamRect":{{"x":0.66,"y":0.06,"width":0.31,"height":0.88}},"webcamReactiveZoom":false}},
215-
"effects": {{"padding":0.0,"blur":true,"shadow":1.0,"roundnessPx":24,"motionBlur":0.0}},
215+
"effects": {{"padding":0.0,"blur":true,"shadow":1.0,"roundnessFrac":0.0222,"motionBlur":0.0}},
216216
"background": {{"kind":"gradient","angleDeg":135,"stops":["#b02a2a","#7a1414"]}},
217217
"zoomRegions": [], "speedRegions": [],
218218
"cursor": {{"show":false,"size":1,"smoothing":0,"motionBlur":0,"clickBounce":0,"clipToBounds":false,"theme":"default"}},
@@ -278,7 +278,7 @@ fn golden_cropped_clip_is_not_stretched() {
278278
"clips": [{{"screenPath":"{s}","webcamPath":"{c}","sourceStartSec":0,"sourceEndSec":30,"webcamOffsetSec":0,"hasAudio":true}}],
279279
"layout": {{"preset":"no-webcam","webcamSize":1.0,"webcamShape":"rectangle","webcamMirror":false,
280280
"screenRect":{{"x":{sx},"y":{sy},"width":{rect_w},"height":{rect_h}}},"webcamReactiveZoom":false}},
281-
"effects": {{"padding":0.0,"blur":true,"shadow":1.0,"roundnessPx":24,"motionBlur":0.0}},
281+
"effects": {{"padding":0.0,"blur":true,"shadow":1.0,"roundnessFrac":0.0222,"motionBlur":0.0}},
282282
"background": {{"kind":"gradient","angleDeg":135,"stops":["#1e3a5f","#0d1b2a"]}},
283283
"zoomRegions": [], "speedRegions": [],
284284
"cursor": {{"show":false,"size":1,"smoothing":0,"motionBlur":0,"clickBounce":0,"clipToBounds":false,"theme":"default"}},

0 commit comments

Comments
 (0)