perf(l2): the screen under a popup is frozen, not redrawn

Once a popup's dim is up, the screen below is drawn once into an image
(LV_USE_SNAPSHOT), darkened as the dim layer darkens it, and shown opaque
over the screen with the dim layer cleared. LVGL then starts drawing from
that image; an lv_image with no background never reports that it covers,
so it answers the cover check itself. A full frame under a popup: 45.7 ->
32.6 ms; freezing costs ~29 ms once, as the popup settles.

One popup at a time (a second one dims live), a strip keeps the status
bar dimmed under top-layer popups, the image goes with its popup, and the
popup dims live again if its screen goes first. POP_BOTTOM (over a live
map) isn't frozen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-09-30 14:33:32 +02:00
co-authored by Claude Opus 5.5
parent 36c647cd05
commit f70019f920
3 changed files with 107 additions and 4 deletions
+3 -3
View File
@@ -40,9 +40,9 @@ namespace anim {
}
// A popup: the dimmed backdrop fades up to `dim`, its first child (the
// panel) rises.
static void popup(lv_obj_t* overlay, lv_opa_t dim = LV_OPA_60) {
run(overlay, setBgOpa, LV_OPA_TRANSP, dim, POP_MS);
// panel) rises; `done` runs once it's up.
static void popup(lv_obj_t* overlay, lv_opa_t dim = LV_OPA_60, lv_anim_completed_cb_t done = nullptr) {
run(overlay, setBgOpa, LV_OPA_TRANSP, dim, POP_MS, done);
lv_obj_t* panel = lv_obj_get_child(overlay, 0);
if (panel) rise(panel);
}