flutter_svg icon indicating copy to clipboard operation
flutter_svg copied to clipboard

Avoid saveLayer with colorFilter when a single path/shape is drawn

Open goderbauer opened this issue 3 years ago • 3 comments

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

goderbauer avatar Nov 02 '21 17:11 goderbauer

We can probably even do better if flutter_svg keeps an RTree to track overlapping draws.

dnfield avatar Nov 02 '21 17:11 dnfield

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.

flar avatar Nov 02 '21 19:11 flar

Yes. Something to render optimize svg would be really cool.

dnfield avatar Nov 02 '21 19:11 dnfield