-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Revert "remove forced compositing from opacity" #105489
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
Revert "remove forced compositing from opacity" #105489
Conversation
This reverts commit febc6a1.
|
RIP |
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
|
It seems like we might not be doing the peephole optimization if we don't end up compositing the opacity layer, though @flar would be the expert here |
|
It looks like they do check for an "opacity saveLayer", but it looks like it doesn't trigger for some reason: |
|
It looks like the grid of opacity benchmark is failing to distribute opacity because the conservative tests in the saveLayer dispatch method linked above will refuse to propagate the opacity if a bounds is supplied for the saveLayer. This is "safe", but unnecessary if the bounds for the saveLayer are large enough to hold all of the children. For OpacityLayer, the bounds of the saveLayer are known to contain all of the children because the bounds are provided by child_layer_bounds, so it can more aggressively apply this optimization. For DL, unfortunately, the bounds are not known while the DL is being constructed so this information cannot be used to gate the optimization. Other peephole benchmarks that try to apply opacity to a number of overlapping children take advantage of the overlap testing inside A quick test of commenting out the bounds check inside the saveLayer dispatch method above shows that performance not only improves, it beats the previous benchmark results by a wide margin. In order to enable equal conditions for the saveLayer dispatch method compared to the OpacityLayer conditions we will need to fix the following issues (the RTree stuff will enable better overlap testing, but a simple overlap condition similar to what is done in the PrerollChildren code can be done by only fixing the first 2 issues): |
Reverts #105334
There is a large regression in the opacity peephole optimization benchmarks:
https://flutter-flutter-perf.skia.org/e/?begin=1654519388&end=1654557788&keys=X1fc868f0016de48451d2e45a1b72160c&num_commits=50&request_type=1&xbaroffset=29332