Skip to content

RibbonIcons: load all icons from resource/icons.zip if it exists - #7109

Open
Fedr wants to merge 2 commits into
masterfrom
icons-zip
Open

Fedr wants to merge 2 commits into
masterfrom
icons-zip

Conversation

@Fedr

@Fedr Fedr commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

RibbonIcons::load() now looks for resource/icons.zip and, if it exists, loads every icon type from it in one pass: the entries are read through the decompressZip callback overload (#7102), the PNGs are decoded in memory in parallel, and the textures are created on the calling thread. Entries are <type folder>/<size folder>/<name>.png, the same layout as the folders, relative to resource/. Without the zip the per-folder scan is unchanged (Logos stay lazy).

  • scripts/pack_icons.py <resource_dir> packs icons/, object_icons/, independent_icons/, logos/ into icons.zip (stored: PNG is already compressed) and deletes the folders; the MeshInspector installers will call it at packaging time.
  • ImageLoad::fromPng( std::istream& ) reports the consumed signature with png_set_sig_bytes instead of seeking back to 0, so it accepts non-seekable streams.
  • Test MRViewer.RibbonIconsFromZip.

Timing on Windows, MeshInspector's 1205 icons, warm file cache, no GL upload, min of 7 runs:

source load time
folders (master) 211 ms
icons.zip, sequential decoding 120 ms
icons.zip, parallel decoding 53 ms

A cold cache or antivirus scanning makes the per-file cost higher still. What remains is the zip read and the per-icon texture setup.

🤖 Generated with Claude Code

Fedr and others added 2 commits October 12, 2026 21:20
One zip read and decoded in memory via the decompressZip callback replaces opening ~1200 files on start: 211 -> 120 ms with a warm file cache on Windows for MeshInspector's icons. scripts/pack_icons.py creates that zip for installers. ImageLoad::fromPng( std::istream& ) uses png_set_sig_bytes instead of seeking back, so it accepts non-seekable streams.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Decoding takes most of the loading time: 120 -> 53 ms on Windows for MeshInspector's 1205 icons; the textures are still created on the calling thread.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.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