-
Notifications
You must be signed in to change notification settings - Fork 29.1k
[Impeller] Fix overdraw in Impeller DrawRect geomtry #174735
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
base: master
Are you sure you want to change the base?
Conversation
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.
Code Review
This pull request addresses an overdraw issue in DrawRect
geometry for stroked rectangles. For Bevel
and Miter
joins, the vertex generation has been updated to create geometry without inherent overdraw, and a special case has been added for thick strokes that collapse on themselves. For Round
joins, the geometry is now flagged to use the pipeline's overdraw prevention, which fixes the visual artifact at a performance cost as noted. New tests are included to verify the rendering of wide stroked rectangles.
engine/src/flutter/impeller/display_list/aiks_dl_basic_unittests.cc
Outdated
Show resolved
Hide resolved
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. |
Golden file changes are available for triage from new commit, Click here to view. 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. |
All tests passed and the goldens for the new tests look correct (no overdraw anomalies that I could see). This PR is ready for review now. |
Fixes #174579
Bevel and Miter (and later Round) joins were fixed by being more careful about the creation of the vertices so that they have no inherent overdraw,
but Round joins would take much more time and thought to fix so I tag them as needing overdraw prevention from the pipeline and they no longer exhibit the problem, but take a 50% hit in rendering.I will submit an issue to try to recover their performance in a follow-on fix by doing a better job of creating their vertices.Update: I got inspired and implemented overdraw-less round-join rectangle vertices with no loss of performance.