[Impeller] Fix morphology filter asymmetric dilation/erosion#184913
Conversation
The render target size was truncated via ISize(coverage.GetSize()), which drops fractional pixels on the right/bottom edges. Fixed by using std::ceil(), preventing asymmetric dilation/erosion coverage.
There was a problem hiding this comment.
Code Review
This pull request updates the morphology filter implementation to use ceiling dimensions for render targets, ensuring correct behavior when dealing with fractional coverage. It also adds a new golden test for fractional dilation and a dedicated unit test suite for morphology filters. The review feedback suggests improving the readability of the newly added tests by removing redundant conditional checks that follow terminal assertions.
flar
left a comment
There was a problem hiding this comment.
Thanks @walley892 I didn't realize this was hung up on waiting for an approval so it could proceed with tests. Hopefully it can go in soon...
|
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
flutter/flutter@31f1802...8e8a194 2026-04-17 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Fix ImageInfo.isCloneOf to correctly compare scale values (fixes #184626) (#184643)" (flutter/flutter#185203) 2026-04-17 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Roll Fuchsia Test Scripts from R2EllDf4DgBXVNuiN... to dQ4PjIJB5kZFU8Y32... (#185192)" (flutter/flutter#185199) 2026-04-17 [email protected] [iOS] Migrate FlutterLaunchEngine to Swift (flutter/flutter#185151) 2026-04-17 [email protected] Remove unused `FlutterRunArguments.java` file (flutter/flutter#184160) 2026-04-17 [email protected] Roll Fuchsia Test Scripts from R2EllDf4DgBXVNuiN... to dQ4PjIJB5kZFU8Y32... (flutter/flutter#185192) 2026-04-17 [email protected] [Impeller] Fix morphology filter asymmetric dilation/erosion (flutter/flutter#184913) 2026-04-17 [email protected] `AnimationStyle` methods (flutter/flutter#182333) 2026-04-17 [email protected] Fix _scheduleSystemFontsUpdate assertion during non-idle scheduler phase (flutter/flutter#184332) 2026-04-17 [email protected] Revert "Unpin sdk package dependencies" (flutter/flutter#185186) 2026-04-16 [email protected] Clarify why the `child` is nullable in `AnimatedTransitionBuilder` (flutter/flutter#182995) 2026-04-16 [email protected] Roll Fuchsia Linux SDK from IdBT8fSMYrYSip65j... to di3JdYrdE9OFu8Iyl... (flutter/flutter#185173) 2026-04-16 [email protected] Add dart_skills_lint to dev/tool with test and update readme instructions for new skills authors (flutter/flutter#185033) 2026-04-16 [email protected] [Impeller] Provide std::optional getter for stroke property (flutter/flutter#185112) 2026-04-16 [email protected] Validate itemExtent with geometry in RenderSliverFixedExtentBoxAdaptor (flutter/flutter#185159) 2026-04-16 [email protected] [iOS] Clarify provisioning profile error instructions (flutter/flutter#184051) 2026-04-16 [email protected] [Widget Preview] Fix flaky integration test timeout during flutter clean (flutter/flutter#184991) 2026-04-16 [email protected] Roll Dart SDK from fbddcbe0cd96 to 7c2564c18770 (2 revisions) (flutter/flutter#185143) 2026-04-16 [email protected] Unpin sdk package dependencies (flutter/flutter#184821) 2026-04-16 [email protected] Fix ImageInfo.isCloneOf to correctly compare scale values (fixes #184626) (flutter/flutter#184643) 2026-04-16 [email protected] Roll Skia from 391cdbe3ffe9 to d8415c5d7b91 (2 revisions) (flutter/flutter#185141) 2026-04-16 [email protected] Sync CHANGELOG.md from stable (flutter/flutter#185166) 2026-04-16 [email protected] Revert "Move widget_preview_scaffold into pub workspace" (flutter/flutter#185164) 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 Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: 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
…r#11523) flutter/flutter@31f1802...8e8a194 2026-04-17 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Fix ImageInfo.isCloneOf to correctly compare scale values (fixes #184626) (#184643)" (flutter/flutter#185203) 2026-04-17 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Roll Fuchsia Test Scripts from R2EllDf4DgBXVNuiN... to dQ4PjIJB5kZFU8Y32... (#185192)" (flutter/flutter#185199) 2026-04-17 [email protected] [iOS] Migrate FlutterLaunchEngine to Swift (flutter/flutter#185151) 2026-04-17 [email protected] Remove unused `FlutterRunArguments.java` file (flutter/flutter#184160) 2026-04-17 [email protected] Roll Fuchsia Test Scripts from R2EllDf4DgBXVNuiN... to dQ4PjIJB5kZFU8Y32... (flutter/flutter#185192) 2026-04-17 [email protected] [Impeller] Fix morphology filter asymmetric dilation/erosion (flutter/flutter#184913) 2026-04-17 [email protected] `AnimationStyle` methods (flutter/flutter#182333) 2026-04-17 [email protected] Fix _scheduleSystemFontsUpdate assertion during non-idle scheduler phase (flutter/flutter#184332) 2026-04-17 [email protected] Revert "Unpin sdk package dependencies" (flutter/flutter#185186) 2026-04-16 [email protected] Clarify why the `child` is nullable in `AnimatedTransitionBuilder` (flutter/flutter#182995) 2026-04-16 [email protected] Roll Fuchsia Linux SDK from IdBT8fSMYrYSip65j... to di3JdYrdE9OFu8Iyl... (flutter/flutter#185173) 2026-04-16 [email protected] Add dart_skills_lint to dev/tool with test and update readme instructions for new skills authors (flutter/flutter#185033) 2026-04-16 [email protected] [Impeller] Provide std::optional getter for stroke property (flutter/flutter#185112) 2026-04-16 [email protected] Validate itemExtent with geometry in RenderSliverFixedExtentBoxAdaptor (flutter/flutter#185159) 2026-04-16 [email protected] [iOS] Clarify provisioning profile error instructions (flutter/flutter#184051) 2026-04-16 [email protected] [Widget Preview] Fix flaky integration test timeout during flutter clean (flutter/flutter#184991) 2026-04-16 [email protected] Roll Dart SDK from fbddcbe0cd96 to 7c2564c18770 (2 revisions) (flutter/flutter#185143) 2026-04-16 [email protected] Unpin sdk package dependencies (flutter/flutter#184821) 2026-04-16 [email protected] Fix ImageInfo.isCloneOf to correctly compare scale values (fixes #184626) (flutter/flutter#184643) 2026-04-16 [email protected] Roll Skia from 391cdbe3ffe9 to d8415c5d7b91 (2 revisions) (flutter/flutter#185141) 2026-04-16 [email protected] Sync CHANGELOG.md from stable (flutter/flutter#185166) 2026-04-16 [email protected] Revert "Move widget_preview_scaffold into pub workspace" (flutter/flutter#185164) 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 Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: 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
This is the recreation of #184073, see the reasoning for this in #184073 (review)
The render target size was truncated via ISize(coverage.GetSize()),
which drops fractional pixels on the right/bottom edges. Fixed by
using std::ceil(), preventing asymmetric dilation coverage.
before:


after:
Golden test generated image:

Fixes: #184072
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.