perf: fast display (row runs, bulk fills, pixel scroll), terminal draws changed cells only + scrolls pixels, print! batched (was IPC per fmt fragment), snake sleeps on timer
This commit is contained in:
@@ -167,3 +167,18 @@ fn text_past_the_edge_is_cut_not_wrapped() {
|
||||
server.handle(DisplayRequest::DrawText(low));
|
||||
assert_eq!(server.framebuffer().pixel_count(), 256);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_scroll_off_the_screen_moves_nothing() {
|
||||
let mut s = test_server();
|
||||
let scroll = |top| DisplayRequest::Scroll {
|
||||
top: ScreenCoord::new(top),
|
||||
height: Dimension::new(u16::MAX),
|
||||
by: Dimension::new(u16::MAX),
|
||||
fill: Color::from_raw(0),
|
||||
};
|
||||
s.handle(scroll(u16::MAX));
|
||||
assert_eq!(s.framebuffer().scrolls(), 0);
|
||||
s.handle(scroll(0));
|
||||
assert_eq!(s.framebuffer().scrolls(), 1, "clipped, then done");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user