modify the fb pop routine so it doesn't overwrite the status bar

this eliminates a small glitch in the time display/security infos
whenever transitioning between foreground/background contexts
This commit is contained in:
bunnie 2022-07-05 03:24:15 +08:00
parent db569dd6e0
commit 148bf71a94
4 changed files with 8 additions and 6 deletions

View file

@ -179,10 +179,9 @@ perform the Xous firmware upgrade. This requires running manual update commands,
- fuzzer added to push many more corner cases than before -- disk is filled to ~75% capacity with dozens of Bases, - fuzzer added to push many more corner cases than before -- disk is filled to ~75% capacity with dozens of Bases,
triggering roughly 4 FSCB ops, and then all Bases and keys are verified to be correct. triggering roughly 4 FSCB ops, and then all Bases and keys are verified to be correct.
- Optimize GAM performance - Optimize GAM performance
- context switches that revert to a prior app screen are restored from a stashed bitmap instead of a full redraw. this can cause - context switches that revert to a prior app screen are restored from a stashed bitmap instead of a full redraw. This
a slight glitch on the status bar where the wrong time/status is displayed for up to a second after the context swap reverts, but prevents old menus, contexts, and defacements from "piling up" when an app is blocked due to an exceptional condition
it is a minor trade-off for the main purpose, which is to prevent old menus, contexts, and defacements from "piling up" when an being raised (such as the PDDB requesting a full basis unlock to generate the FSCB)
app is blocked due to an exceptional condition being raised (such as the PDDB requesting a full basis unlock to generate the FSCB)
## Roadmap to 1.0 ## Roadmap to 1.0

View file

@ -75,6 +75,7 @@ fn wrapped_main() -> ! {
let status_canvas = Canvas::new( let status_canvas = Canvas::new(
Rectangle::new_coords( Rectangle::new_coords(
0, 0, screensize.x, 0, 0, screensize.x,
// note: if this gets modified, the "pop" routine in gfx/backend/betrusted.rs also needs to be updated
gfx.glyph_height_hint(GlyphStyle::Cjk).expect("couldn't get glyph height") as i16 * 2), gfx.glyph_height_hint(GlyphStyle::Cjk).expect("couldn't get glyph height") as i16 * 2),
255, &trng, None, crate::api::CanvasType::Status 255, &trng, None, crate::api::CanvasType::Status
).expect("couldn't create status canvas"); ).expect("couldn't create status canvas");

View file

@ -114,7 +114,9 @@ impl XousDisplay {
} }
pub fn pop(&mut self) { pub fn pop(&mut self) {
let fb: &mut [u32] = self.fb.as_slice_mut(); let fb: &mut [u32] = self.fb.as_slice_mut();
fb[..FB_SIZE].copy_from_slice(&self.srfb); // skip copying the status bar, so that the status info is not overwritten by the pop.
// this is "fixed" at 32 pixels high (2 * Cjk glyph height hint) per line 79 in gam/src/main.rs
fb[FB_WIDTH_WORDS * 32..FB_SIZE].copy_from_slice(&self.srfb[FB_WIDTH_WORDS * 32..FB_SIZE]);
self.redraw(); self.redraw();
} }

View file

@ -88,7 +88,7 @@ impl XousDisplay {
self.srfb.copy_from_slice(&self.emulated_buffer); self.srfb.copy_from_slice(&self.emulated_buffer);
} }
pub fn pop(&mut self) { pub fn pop(&mut self) {
self.emulated_buffer.copy_from_slice(&self.srfb); self.emulated_buffer[FB_WIDTH_WORDS*32..].copy_from_slice(&self.srfb[FB_WIDTH_WORDS*32..]);
self.redraw(); self.redraw();
self.update(); self.update();
} }