Commit 56eeca9
fw/applib/graphics: only pre-load glyph bitmaps when rendering
text_resources_get_glyph_horiz_advance() loaded the glyph bitmap on every
call so the following render_glyph() would find it cached. But the advance
is also queried from measure/layout passes (e.g. a text node's get_size
walk), so measuring paid the deep glyph-bitmap flash load
(resource_load -> pfs_open -> flash). Reached through the launcher's
app-glance get_size, nested in the menu render, this overflowed the app
task's 2 KB stack.
Make the advance metadata-only again and pre-load the bitmap explicitly in
walk_line()'s render pass, so the deep flash I/O stays out of the render
call chain without charging measure passes for it.
walk_line() now references text_resources_get_glyph(), so add the matching
stub to stubs_text_resources.h for the layout/iterator unit tests.
Fixes FIRM-2160
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Joshua Jun <lets@throw.rocks>1 parent 02a44b2 commit 56eeca9
3 files changed
Lines changed: 18 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
580 | 580 | | |
581 | 581 | | |
582 | 582 | | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
583 | 586 | | |
584 | 587 | | |
585 | 588 | | |
| |||
885 | 888 | | |
886 | 889 | | |
887 | 890 | | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
888 | 897 | | |
889 | 898 | | |
890 | 899 | | |
| |||
941 | 950 | | |
942 | 951 | | |
943 | 952 | | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
944 | 956 | | |
945 | 957 | | |
946 | 958 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
613 | 613 | | |
614 | 614 | | |
615 | 615 | | |
616 | | - | |
617 | | - | |
618 | | - | |
| 616 | + | |
| 617 | + | |
619 | 618 | | |
620 | 619 | | |
621 | 620 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
0 commit comments