Unify the layout metadata model and collapse the single-row entry emitters

This commit is contained in:
Dennis Kobert
2026-08-12 13:11:48 +00:00
parent b6f73b0691
commit 83fbaca6f2
4 changed files with 246 additions and 277 deletions

View File

@@ -221,6 +221,20 @@ mod tests {
}
}
#[test]
fn layout_meta_folds_to_construction() {
let base = f64_layout(&[]);
let carried = multiply_opacity_layout(&base);
assert_eq!(multiply_opacity_layout_meta().fold(&[Some(&base)]), multiply_opacity_layout(&base));
assert_eq!(multiply_opacity_layout_meta().fold(&[Some(&carried)]), multiply_opacity_layout(&carried));
assert_eq!(measure_layout_meta().fold(&[Some(&base)]), measure_layout(&base));
assert_eq!(strip_opacity_layout_meta().fold(&[Some(&carried)]), strip_opacity_layout(&carried));
assert_eq!(relength_layout_meta().fold(&[Some(&base)]), relength_layout(&base));
assert_eq!(transfer_opacity_layout_meta().fold(&[Some(&base), None]), transfer_opacity_layout(&base));
assert_eq!(source_opacity_layout_meta().fold(&[]), source_opacity_layout());
}
#[test]
fn defaults_then_modify_then_stack() {
let arena = Arena::new(1024).unwrap();