3 ms·
Is it not feasible to load a vector graphic into a raster equivalent on first load? Startup time would, predictably, be slower, but just moving something aroun
by taeric 13y ago
Is it not feasible to load a vector graphic into a raster equivalent on first load? Startup time would, predictably, be slower, but just moving something around the screen would then be equivalent. (Obviously, some actions could trigger a redraw of the vectors, but I would think this would actually be a limited set of interactions.)
- georgemcbay 13y agoYes, this is feasible and Flash did this (optionally). Flash supported this as a trade-off via the cacheAsBitmap attribute on elements. Basically you'd set that to true if you knew the sprite was just going to be translated around in x/y and not scaled or rotated. It wasn't on as the default for new sprites because this mode would actually bite you in the ass if the sprite was going to scale/rotate nearly each frame because the cost of recreating the "cached" version would then be added to the render time without actually ever being useful. So it is a good idea in practical usage to make this an optional feature, though I think Flash could have been smarter about it (like soft-default to caching and only override that once it sees a scale or rotate taking place).
- jarek-foksa 13y agoSVG 1.1 spec defines suspendRedraw() and unsuspendRedraw() methods which seem to have somehow similar purpose, though those can be applied only on <svg> elements, are supported only by Firefox and are going to be deprecated in SVG 2.0.