Repository navigation
Fix incorrect UberSDF pixelsize used for stroked shapes - #192659
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds a new unit test to verify rendering of transformed rectangles with near-vertical edge hairlines, refactors the strokedSDF function in uber_sdf.frag to simplify variable usage, and updates the Mali offline compiler performance metrics in malioc.json. Feedback suggests further simplifying the SDFStroke assignment in uber_sdf.frag by directly assigning the .x component to sdf to avoid declaring an unused temporary variable.
|
Golden results look good: https://flutter-gold.skia.org/search?issue=192659&crs=github&patchsets=2&corpus=flutter A bunch of small artifacts near the corners of stroked shapes get fixed. |
|
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. |
gaaclarke
left a comment
There was a problem hiding this comment.
lgtm, and goldens look good to me too
See #192267 (comment):
We get bad hairline stroking due to uber_sdf.frag calculating pixel size for stroked shapes using
pixelSize(sdf)here.pixelSize(sdf)can give incorrect results when dealing with shapes/strokes with width that is close to or less than 1 pixel (due to resolution limits of thedFdx(sdf), dFdy(sdf)that it uses). For stroked shapes, we can simply use the pixel size of the base filled shape.Fixes #192658
Added a new golden test that draws the shape from those comments.
Before:
After:
Zoomed in version of before/after from #192267 (comment):
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.