flutter_svg
flutter_svg copied to clipboard
Performance to render many SVG in an animation
Hi all,
I have an animation with basically many leaves falling of a tree and staying on the ground (in a 2D animation). Each leaf is an instance of one of 14 leaves, which are DrawableRoot read using this package. Now, with the leaves staying on the ground it gets slower and slower. And as leaves keep falling, I must render the picture many times per second.
Would it be more performant to convert the DrawableRoot to a ui.Image, Picture, a Bitmap? And then use those instead of the DrawableRoot? Or another solution?
Thanks, Tom
I got the same problem. FPS on list with too much svg that allways under 15fps eventhough I cached image
I reverted to using pre-loaded PNGs... It's much more efficient.
It really depends on the complexity of what you're drawing - sometimes using a rasterized version is more efficient, especially if there's a lot of complicated graphics ops in the drawing :\
I apologize to dust up this old issue. I have complex set of SVG files that take bit of time (3-4 seconds) to render. Once the svg files are loaded into memory (on drawn in canvas), the subsequent rendering is quick in other screens. Is there a way to preload the svg assets? I can show a loading screen upfront to the user when loading the svg files.
Rasterize it to an image.