mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-06 19:53:08 +00:00
Phase 5.1 of the launch-optimization plan: the cold-boot critical path loaded /icon.png up to four separate times (taskbar setup, Window icon, Tor splash, account-loading splash). Two of those sites also paid an ImageIO.read to obtain a BufferedImage, and the Window-icon site additionally round-tripped the image back through ImageIO.write so Skia could re-decode it. IconResources holds one lazy each for the bytes, the decoded BufferedImage, the platform-adapted BufferedImage (squircle on macOS), and the two BitmapPainters (raw + adapted). All four call sites in Main.kt now consume the cached values directly — no remember, no re-decode. IconResourcesTest pins the memoization invariants (same instance on repeated access). All 271 desktopApp tests pass. End-to-end delta vs the baseline will be measured once Phase 3 benchmarks land; the worst-case savings on cold boot are two ImageIO.read calls plus three resource reads plus one ImageIO.write, all on the main thread.