logoalt Hacker News

throw10920last Tuesday at 9:29 PM1 replyview on HN

Huh, is there a requirement that they be rasterized at build time? If I had a choice, I'd rather ship the SVGs in the bundle alongside a renderer like ThorVG and render at runtime. The renders could even be cached if the rendering itself was expensive.


Replies

fingerlockslast Wednesday at 11:41 AM

If you’re including these assets as UI elements, they would be rasterized anyway and copied to a GPU bound buffer for the frame blit. Doing so at compile time increases runtime performance.

You can of course override this behavior and redraw your vector every 8.3 ms if you want, but I promise you that this is not faster. For sparse pyramid-tiled vector images like Google/Apple maps, this is a two step process using the latter method followed by the former.