flutter_svg
flutter_svg copied to clipboard
Avoid saveLayer with colorFilter when a single path/shape is drawn
From discussion it seems like the saveLayer call is unnecessary when the drawn content is just a single path/shape. The saveLayer call should be omitted in that case.
Related: https://github.com/flutter/flutter/issues/92874
Internal: b/204888249
We can probably even do better if flutter_svg keeps an RTree to track overlapping draws.
Doing this here when the Picture is generated amortizes the cost well. It would be even better if there was an off-line tool that could optimize an SVG file.
Yes. Something to render optimize svg would be really cool.