-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[flutter_svg] feat: Expose the renderStrategy property in SvgPicture #9373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
45f91bd to
4a2a0bd
Compare
|
Looking forward to this getting merged asap! 🎉 |
4a2a0bd to
f0da9b2
Compare
domesticmouse
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once text is reformatted
…lexibility and performance.
f0da9b2 to
b5980ba
Compare
|
@stuartmorgan-g any idea why Linux CI is failing? |
|
As it says in the failure output:
|
|
What should I do about this failure? Should I remove the Next section and append it to this PR? |
|
@stuartmorgan-g @domesticmouse Are there any further changes needed for this PR? Could you advise on how to deal with the “NEXT” tag and version update in the changelog? We are very interested in the performance improvements this change brings. Thank you very much! |
Yes. Please see my previous comment. PRs cannot land with CI failures.
I quoted the error message with instructions, and linked to our documentation on what the update needs to look like; I'm not sure what other information I can provide. |
43c73f2 to
20a8e4c
Compare
20a8e4c to
d7ce13c
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
flutter/packages@6d3aaf4...c5ab57a 2025-06-13 [email protected] [flutter_svg] feat: Expose the renderStrategy property in SvgPicture (flutter/packages#9373) 2025-06-12 [email protected] [go_router] Add routing functions to GoRouteData (flutter/packages#9277) 2025-06-12 [email protected] [various] Update example apps to Swift (flutter/packages#9347) 2025-06-12 [email protected] Roll Flutter from 824868f to f79452e (94 revisions) (flutter/packages#9419) 2025-06-12 [email protected] [android_camera_camerax] Fix incorrect camera mirroring for front cameras on devices using `ImageReader` Impeller backend (flutter/packages#9233) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#9373) This PR exposes the `renderStrategy` property from the `vector_graphics` package to address the performance issue discussed in [#166184](flutter/flutter#166184). By default, SVG widgets are rendered using the picture strategy, which records a list of drawing commands and replays them each frame. While this offers greater flexibility (e.g., for scaling), it can result in significant raster time when many SVGs are present in the widget tree. As demonstrated in [#166184](flutter/flutter#166184), using the default strategy can lead to frame drops due to high raster time: <img width="820" alt="image" src="https://github.com/user-attachments/assets/dfc58d50-c8b2-477e-9a75-fe0eb742f9c7" /> Switching to the raster strategy renders the SVGs into images ahead of time, reducing the raster workload: <img width="894" alt="image" src="https://github.com/user-attachments/assets/2fd8ddbf-3693-4797-be99-8b0919ef1703" /> Exposing this property allows developers to choose between flexibility and performance based on their app’s needs. Fixes flutter/flutter#166184 ## Pre-Review Checklist
flutter/packages@6d3aaf4...c5ab57a 2025-06-13 [email protected] [flutter_svg] feat: Expose the renderStrategy property in SvgPicture (flutter/packages#9373) 2025-06-12 [email protected] [go_router] Add routing functions to GoRouteData (flutter/packages#9277) 2025-06-12 [email protected] [various] Update example apps to Swift (flutter/packages#9347) 2025-06-12 [email protected] Roll Flutter from 824868f to f79452e (94 revisions) (flutter/packages#9419) 2025-06-12 [email protected] [android_camera_camerax] Fix incorrect camera mirroring for front cameras on devices using `ImageReader` Impeller backend (flutter/packages#9233) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#9373) This PR exposes the `renderStrategy` property from the `vector_graphics` package to address the performance issue discussed in [#166184](flutter/flutter#166184). By default, SVG widgets are rendered using the picture strategy, which records a list of drawing commands and replays them each frame. While this offers greater flexibility (e.g., for scaling), it can result in significant raster time when many SVGs are present in the widget tree. As demonstrated in [#166184](flutter/flutter#166184), using the default strategy can lead to frame drops due to high raster time: <img width="820" alt="image" src="https://github.com/user-attachments/assets/dfc58d50-c8b2-477e-9a75-fe0eb742f9c7" /> Switching to the raster strategy renders the SVGs into images ahead of time, reducing the raster workload: <img width="894" alt="image" src="https://github.com/user-attachments/assets/2fd8ddbf-3693-4797-be99-8b0919ef1703" /> Exposing this property allows developers to choose between flexibility and performance based on their app’s needs. Fixes flutter/flutter#166184 ## Pre-Review Checklist
This PR exposes the
renderStrategyproperty from thevector_graphicspackage to address the performance issue discussed in #166184.By default, SVG widgets are rendered using the picture strategy, which records a list of drawing commands and replays them each frame. While this offers greater flexibility (e.g., for scaling), it can result in significant raster time when many SVGs are present in the widget tree.
As demonstrated in #166184, using the default strategy can lead to frame drops due to high raster time:
Switching to the raster strategy renders the SVGs into images ahead of time, reducing the raster workload:
Exposing this property allows developers to choose between flexibility and performance based on their app’s needs.
Fixes flutter/flutter#166184
Pre-Review Checklist
[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under[^1].CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under[^1].///).