Bench: first screen is a drawn tile; handles checked by identity; clean record

This commit is contained in:
ZacharyZhang-NY committed 2026-10-08 21:59:06 -04:00
1 parent b7fca0146d
commit 946e5cf835
10 files changed
+154 -54

No files matched your search

+3
View File
@@ -107,6 +107,8 @@ pub struct LokView {
moves: u64,
last_edit: u64,
clock: clock::EditClock,
/// A tile reached the screen; logged once (PERF-03).
drawn: bool,
/// Tiles the last frame showed.
on_screen: Vec<(i32, i32)>,
/// The mark of this view's last copy.
@@ -218,6 +220,7 @@ impl LokView {
moves: 0,
last_edit: 0,
clock: clock::EditClock::default(),
drawn: false,
on_screen: Vec::new(),
copied: None,
cursor: None,
+8 -2
View File
@@ -91,6 +91,7 @@ impl Render for LokView {
}
},
move |bounds, painted, window, app| {
let mut drawn = false;
for page in &painted.pages {
window.paint_quad(fill(*page, paper));
window.with_content_mask(
@@ -108,13 +109,18 @@ impl Render for LokView {
false,
)
});
if let Err(error) = painted {
log::error!("lok: tile paint failed: {error}");
match painted {
Ok(()) => drawn = true,
Err(error) => log::error!("lok: tile paint failed: {error}"),
}
}
},
);
}
if drawn && !this.read(app).drawn {
this.update(app, |view, _| view.drawn = true);
log::info!("lok: first tile drawn");
}
window.with_content_mask(Some(ContentMask { bounds }), |window| {
for rect in painted.selection {
window.paint_quad(fill(rect, selection_color));