-
Notifications
You must be signed in to change notification settings - Fork 6k
Use Impeller geometry classes in DLMatrixClipTracker #51919
Use Impeller geometry classes in DLMatrixClipTracker #51919
Conversation
|
This change introduces small performance regressions at the level of the DisplayListBuilder microbenchmarks, but those should not be evident over the entire course of a running app.
Since there were unit tests failing due to the difference in behavior between Skia's Here are the representative numbers:
|
jonahwilliams
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.
I haven't fully looked through all of the math yet, though I trust it will be good :)
Do we still need to do an additional heap allocation for the DisplayListMatrixClipState? Or can we store that in the vector as is
|
I think the perspective bug is flutter/flutter#131445 . |
Good catch. That is a remnant of when there were 2 kinds of state and I didn't think to remove that, I was focused on the change to impeller structures and making the individual State structures public. I'll fix that up [Done]. Eventually, though, Tracker will go away and the Builder, which already has a state stack of its own, and other similar classes will just inline the State into their own state stacks. If anyone is using Tracker that doesn't already have their own vector/stack then it might stay around, but there is no reason I can't make it more efficient by eliminating the redirection in the Tracker vector. Also, at one point I thought "maybe tracker should just have an |
|
The DiffContext failure definitely seems to be due to trying to transform a rectangle with a perspective matrix that produces negative weights. I may have to solve that compatibility issue before this can be pushed. I'd like to do that separately from this PR... |
|
This PR now includes the new If this fixes all of the outstanding test failures, I'll still want to add new targeted unit tests for the couple of new methods I've added to Impeller. |
9687c89 to
3c83209
Compare
|
|
jonahwilliams
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!
We have a few places where we stop culling due to the old transform issue. If the new implementation is good we should make sure we update those.
What about just merging them? We will see the comparative trends in the benchmark data in a few days. |
…146475) flutter/engine@932c550...0226114 2024-04-09 [email protected] Use Impeller geometry classes in DLMatrixClipTracker (flutter/engine#51919) 2024-04-09 [email protected] Roll Dart SDK from 28b5735ad7dc to 78174b41ab0f (1 revision) (flutter/engine#51976) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[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#146475) flutter/engine@932c550...0226114 2024-04-09 [email protected] Use Impeller geometry classes in DLMatrixClipTracker (flutter/engine#51919) 2024-04-09 [email protected] Roll Dart SDK from 28b5735ad7dc to 78174b41ab0f (1 revision) (flutter/engine#51976) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[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
The
DisplayListMatrixClipTrackerclass performs the working of maintaining a stack of cull rects and transforms for classes in the engine that require such functionality (such asDisplayListBuilder,DiffContext, andLayerStateStack.Until now it has been using a mixture of SkMatrix and SkM44 along with an SkRect to maintain this information, but that complexity involves overhead and implementation complexity which complicates future work on these areas.
By reimplementing the class to use Impeller geometry objects, the internal architecture is greatly simplified allowing for easier future maintenance.