The cue decode is held to the frame it appears on
Browse files at this commit536c87c7e9d49a4db670510ca719903c464521ceParent: 739bec4- test
- the cue decode is held to the frame it appears on
1 changed file +9 -4
crates/engine/tests/pgs_bitmaps.rsmodified+9 -4
| @@ -62,12 +62,17 @@ fn the_session_maps_a_pgs_track_onto_the_timeline_and_draws_it() { | ||
| 62 | 62 | let drawn = Instant::now(); |
| 63 | 63 | let image = cues[0].image.as_ref().expect("a picture cue"); |
| 64 | 64 | let rgba = image.rgba().expect("the first display set decodes"); |
| 65 | + let took = drawn.elapsed(); | |
| 65 | 66 | eprintln!( |
| 66 | - "cue 0 decoded to {}x{} in {:?}", | |
| 67 | - image.width, | |
| 68 | - image.height, | |
| 69 | - drawn.elapsed() | |
| 67 | + "cue 0 decoded to {}x{} in {took:?}", | |
| 68 | + image.width, image.height, | |
| 70 | 69 | ); |
| 70 | + // The run-length walk is paid once per cue *change* -- the window keeps the | |
| 71 | + // picture while it is up ([`Player::sub_picture`]) -- so what this holds is | |
| 72 | + // the cost of the one frame a new line appears on: 247 µs measured on this | |
| 73 | + // remux, a sixty-eighth of that frame's budget. A whole repaint's worth | |
| 74 | + // would mean the cache above it had stopped mattering. | |
| 75 | + assert!(took.as_millis() < 16, "a frame's worth of decode: {took:?}"); | |
| 71 | 76 | assert_eq!(rgba.len(), (image.width * image.height * 4) as usize); |
| 72 | 77 | let opaque = rgba.chunks_exact(4).filter(|px| px[3] > 0).count(); |
| 73 | 78 | assert!(opaque > 0, "the block decoded to an empty canvas"); |