improve drawing performance

the trailing update after every event seems redundant now that
the gam is cleaned up

also fix a bug that causes overflow text on tl fitted text
to overflow the drawing region
This commit is contained in:
bunnie 2021-09-18 02:21:12 +08:00
parent 5df4e38caf
commit bdbaba027b
2 changed files with 7 additions and 7 deletions

View file

@ -113,8 +113,6 @@ impl XousDisplay {
self.srfb.resume();
if drew_note {
let note = crate::sleep_note::LOGO_MAP;
let note_lines = note.len() / FB_WIDTH_WORDS;
let hwfb: *mut [u32; FB_SIZE] = self.hwfb.as_mut_ptr() as *mut [u32; FB_SIZE];
for lines in 0..FB_LINES {
// set the dirty bits of all lines to force a redraw of the restored data

View file

@ -101,7 +101,6 @@ fn xmain() -> ! {
let sid = xns
.register_name(api::SERVER_NAME_GFX, Some(2))
.expect("can't register server");
log::trace!("Server listening on address {:?}", sid);
// Create a new monochrome simulator display.
let mut display = XousDisplay::new();
@ -336,12 +335,17 @@ fn xmain() -> ! {
tv.bounds_computed
);
} else {
log::warn!(
log::debug!(
"does not intersect, clip_rect: {:?}, br: {:?}",
clip_rect,
br
);
tv.bounds_computed = Some(Rectangle::new(tl, clip_rect.br()));
tv.bounds_computed = Some(Rectangle::new(tl,
Point::new(
if br.x < clip_rect.br.x { br.x } else { clip_rect.br.x - tv.margin.x },
if br.y < clip_rect.br.y { br.y } else { clip_rect.br.y - tv.margin.y },
)
));
}
}
TextBounds::GrowableFromBl(bl, width) => {
@ -723,8 +727,6 @@ fn xmain() -> ! {
log::error!("received opcode scalar that is not handled");
}
}
display.update();
display.redraw();
}
log::trace!("main loop exit, destroying servers");
xns.unregister_server(sid).unwrap();