Panics · P44 Rendering: atlas faults log and skip the draw

This commit is contained in:
ZacharyZhang-NY committed 2026-10-07 07:26:55 -04:00
1 parent 05c973abb7
commit 0040e851e2
2 files changed
+21 -10

No files matched your search

+19 -9
View File
@@ -61,6 +61,7 @@ impl RenderOnce for RenderSurface {
None
});
let (id, revision, draw) = (self.id.clone(), self.revision, self.draw);
let painted = self.id.clone();
framed(self.ratio, cx)
.id(self.id)
.debug_selector(|| "render-surface".into())
@@ -84,19 +85,28 @@ impl RenderOnce for RenderSurface {
frame,
})
});
if let Some(old) = old {
window
.drop_image(old.frame)
.expect("the atlas frees a frame");
if let Some(old) = old
&& let Err(error) = window.drop_image(old.frame)
{
log::error!("render surface {id}: the atlas kept a frame: {error}");
}
}
shown.read(cx).as_ref().map(|drawn| drawn.frame.clone())
},
|bounds: Bounds<Pixels>, frame, window, _| {
if let Some(frame) = frame {
window
.paint_image(bounds, bounds, Corners::default(), frame, 0, false)
.expect("the atlas takes the frame");
move |bounds: Bounds<Pixels>, frame, window, _| {
if let Some(frame) = frame
&& let Err(error) = window.paint_image(
bounds,
bounds,
Corners::default(),
frame,
0,
false,
)
{
log::error!(
"render surface {painted}: the frame did not paint: {error}"
);
}
},
)
+2 -1
View File
@@ -58,7 +58,7 @@ Each item reads every site in its folders, fixes what the rules name, updates ca
- [x] P41 Maps — `src/maps`
- [x] P42 Misc — `src/misc`
- [x] P43 Library Tooling — `src/tooling`
- [ ] P44 Rendering — `src/rendering`
- [x] P44 Rendering — `src/rendering`
- [ ] P45 Recount, acceptance table
## Log
@@ -109,3 +109,4 @@ One line per item: what changed, what stayed and why, review rounds.
- P41: no change. Kept: finite and unique values, places and zooms in range (the map's own moves clamp and wrap), heat weights, routes of two places, builder misuse, tile sources and zooms, unique pins, ISO codes, the bundled world. Review: 1 round.
- P42: Captcha, CookieBanner, Poll, QrCodeScanner and Survey take their handlers in `new`; the macOS web view shows wry's build and load failures in its box and logs failed bounds, visibility and focus calls (checked by reading, as Windows cannot build that module; CI builds it); kept state fits lists that changed: cookie switches, export formats, licenses, poll picks and votes, survey sheets, import mappings, quiz and flashcard places; a picture with no frame reads no code. Kept: lists present, a question's right answer, counts per option, unit tables, places from their own choices, Vote behind a pick. Review: 2 rounds.
- P43: a playground knob painted before the owner's knobs changed sets nothing. Kept: knobs present, unique and starting in range, the preview asking by its own names (code), fixed tables in the inspector, checker and tokens. Review: 1 round.
- P44: the render surface logs an atlas that cannot free or paint a frame and skips that draw. Kept: one picture at the size asked (the host's contract). Review: 1 round.