mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-02 19:02:00 +00:00
perf(l2): cheaper frames -- less overdraw and blending
Measured on the L2 (steady full frames): Settings page 37.7 -> 31.4 ms, Display 41.5 -> 37.9, Contacts 34.6 -> 32.9, Home 37.3 -> 32.4. - styleSurface() leaves boxes in the page colour unpainted; styleOpaque() for the screen and the status bar, which things slide under. - group() cards clip their corners only while a row is held (rowPressable(), shared by the tappable rows). - rowSlider(): the track an opaque tint (theme::mix(), also behind ACCENT_DIM) instead of 20 % accent blended every frame. - Map buttons, pills, scale, nav bar and the Home minimap labels opaque. - Screens drift in without the fading cover: its full-screen blend was in every entrance frame (page 39 -> 29 ms). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -47,19 +47,13 @@ namespace anim {
|
||||
if (panel) rise(panel);
|
||||
}
|
||||
|
||||
// A new screen emerges: a cover in the background colour fades away over
|
||||
// it while its content drifts a few pixels into place (up going deeper,
|
||||
// down coming back). A plain fill blended on top -- far cheaper than
|
||||
// fading the screen itself (a full-screen layer) or sliding two screens.
|
||||
// A fading cover's end: it goes.
|
||||
static void coverDone(lv_anim_t* a) { lv_obj_delete((lv_obj_t*)a->var); }
|
||||
static void screenIn(lv_obj_t* scr, lv_obj_t* body, bool back) {
|
||||
lv_obj_t* cover = lv_obj_create(scr);
|
||||
lv_obj_remove_style_all(cover);
|
||||
lv_obj_remove_flag(cover, LV_OBJ_FLAG_CLICKABLE); // taps go through to the screen
|
||||
lv_obj_add_flag(cover, LV_OBJ_FLAG_IGNORE_LAYOUT);
|
||||
lv_obj_set_size(cover, LV_PCT(100), LV_PCT(100));
|
||||
lv_obj_set_style_bg_color(cover, lv_obj_get_style_bg_color(scr, LV_PART_MAIN), 0);
|
||||
run(cover, setBgOpa, LV_OPA_COVER, LV_OPA_TRANSP, SCREEN_MS, coverDone);
|
||||
|
||||
// A new screen emerges: its content drifts a few pixels into place (up
|
||||
// going deeper, down coming back). No fade: a cover fading over the screen
|
||||
// blended a full-screen fill into every frame of it (~7 ms each on the L2).
|
||||
static void screenIn(lv_obj_t* body, bool back) {
|
||||
if (body) run(body, setTy, back ? -6 : 6, 0, SCREEN_MS);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user