-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Adds geometry dirty nodes #180375
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?
Adds geometry dirty nodes #180375
Conversation
1b7d1ca to
fbd95d6
Compare
dadd476 to
5b5c6db
Compare
1d90f77 to
d081513
Compare
d081513 to
4d83a82
Compare
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 introduces a more granular mechanism for tracking semantics geometry updates by adding a _nodesNeedingSemanticsGeometryUpdate set to PipelineOwner. This should improve performance by avoiding unnecessary geometry recalculations. The changes are well-contained and include necessary test updates. I have one suggestion to improve the readability of a complex loop.
justinmc
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.
Makes sense to me at a high level, but @LongCatIsLooong should definitely review and follow up on his old ideas (#166173 (comment)). Otherwise LGTM 👍
| // Clear geometry for nodes that needs geometry update. | ||
| for (final node in nodesToProcessGeometry) { | ||
| if (node._semantics.shouldFormSemanticsNode && node._semantics.geometryDirty) { | ||
| // This is node is already dirty, skip it. |
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.
"This is node" => "This node"
| // the geometry of the blocked branch half-heartly will cause a gap of render | ||
| // object with dirty geometry where the future update may never reach. | ||
| // | ||
| // Either we update entire tree regardless of been blocked or not, or we only update |
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.
"been blocked" => "whether it is blocked"


fixes #166173
Highlevel:
instead of clearing the entire geometry from the node that markSemanticsNeedsUpdate up to the first semantics boundary. and recalculate everything in between. This code now only clear the geometry for node that are markSemanticsNeedsUpdate. This requires us to keep a separate list for geomtry dirty node. Thus this change.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
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.