Skip to content

app-grid-button: decode the icon before the first draw - #2

Open
wayne-tbl wants to merge 1 commit into
FuriLabs:forkyfrom
wayne-tbl:app-grid-icons
Open

app-grid-button: decode the icon before the first draw#2
wayne-tbl wants to merge 1 commit into
FuriLabs:forkyfrom
wayne-tbl:app-grid-icons

Conversation

@wayne-tbl

Copy link
Copy Markdown

gtk_image_set_from_gicon() defers the load to the first draw, and a GtkFlowBox
recycles nothing, so the first scroll through the app grid decoded an icon per
row it revealed, on the main thread. This decodes off the main thread instead
and keeps the result on the image as a scale-aware surface, refreshed when the
theme or the scale changes.

Worth knowing before reviewing: warming GtkIconTheme was tried first and buys
nothing, because every lookup returns a fresh GtkIconInfo, so nothing a
previous load produced is reused. That is why the fix holds the decoded surface
on the image rather than pre-warming a cache.

One commit, off forky, independent of everything else in this series.

Tested on an FLX1 (FuriOS, phosh 0.55).

gtk_image_set_from_gicon() defers the load to the first draw, and a
GtkFlowBox recycles nothing, so the first scroll through the grid decoded
an icon per row it revealed, on the main thread. Decode off the main
thread instead and keep the result on the image as a scale-aware surface,
refreshed when the theme or the scale changes.

Warming GtkIconTheme does not help: every lookup returns a fresh
GtkIconInfo, so nothing a previous load produced is reused.

Signed-off-by: wayne <wayne@furilabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant