-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Always composite PhysicalModels #28919
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
Conversation
mklim
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, but @jason-simmons or @liyuqian should probably also review this before it's merged.
|
As written right now, this is a breaking change. We'd no longer be calling |
|
This substantially improves Android benchmarks for gallery transitions perf, and slightly worsens them for worst frame time on iOS. Android before and after on an S8: iOS before and after on an iPhone8+: I'm curious as to why there'd be such a difference between Android and iOS on this, but the improvement on Android is substantial. |
|
Adding @HansMuller since this required reworking tests for Material. This shouldn't actually be changing any behavior - although I was a bit puzzled by why |
ee00a09 to
86a4f0a
Compare
|
I'm looking into the golden failures. |
|
This results in nearly imperceptible changes to goldens. I've updated them as part of this PR. |
This comment has been minimized.
This comment has been minimized.
liyuqian
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
| await expectLater( | ||
| find.byKey(key), | ||
| matchesGoldenFile('bottom_app_bar.custom_shape.1.png'), | ||
| matchesGoldenFile('bottom_app_bar.custom_shape.1.1.png'), |
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 guess that these new golden files are just temporary? Once this PR landed, we should be able to either replace the old png with this new png, or delete the old png?
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.
We delete the old ones.
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.
The instructions are to append a number to the end of the name - unfortunately for this file, it already has a number at the end of its name.
goderbauer
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
Seems fine if performance is not negatively impacted :)
| expect(find.text('Item 2'), findsOneWidget); | ||
| expect(find.text('Item 18'), findsNothing); | ||
| expect(find.byType(NestedScrollView), isNot(paints..shadow())); | ||
| _checkPhysicalLayer(0); |
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.
nit: maybe make elevation a required named parameter so it's clear right here what the 0 is?
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.
Done
|
I did another test on an iPhone 6, which is closer to what the devicelab uses if not exactly: It looks like the numbers go slightly up, but are still under our goals. That said, these numbers are still a little lower than devicelab so it may be on a less powerful 6 or 5 or something. |
|
Tree isn't actually red, landing this. |
|
complex_layout_scroll_perf__timeline_summary average_frame_rasterizer_time_millis went red on this PR. Everything else seems better or just noisy. |
|
@liyuqian can you help me look into that regression tomorrow? |
|
omplex_layout_ios__start_up timeToFirstFrameMicros also may have regressed, although that one has been noisy. |
|
Actually, I strongly suspect the regression on the rasterizer is expected. Rasterizer average time went up by ~.5ms, but frame build time went down by ~.5 ms. If I'm understanding correctly, this is because we moved some work from the framework to the engine. |
|
Calling canvas.drawXXX in the UI thread before this PR or in the GPU thread after this PR shouldn't be too much a difference. In the end, everything goes to the GPU thread for I suspect that this PR changes how the layer tree looks like and that affects our raster caching. For example, before this PR, the PhysicalShapeLayer is painted on the UI thread so everything is recorded in an SkPicture which is ready for raster cache. After this PR, it's no longer recorded in an SkPicture so no raster cache is done. It explains why the average raster time changes more than other metrics (e.g., 90th percentile). I wouldn't worry about the 0.5ms regression here if this PR fixes some critical correctness issues. Finally, I'm more curious why the MotoG4/iPhone6S in our device lab gave us very different performance changes than the Galaxy S8 and iPhone8+ as described in this PR. Maybe the older devices need more raster cache to be performant? It would be nice to confirm that in local tests with MotoG4. To test whether it's the raster cache that's causing a difference, one can let IsPictureWorthRasterizing always return false. |
Sure, I'm happy to help any time. |
Description
Currently, we only composite Physical layers for Fuchsia. This PR will enable compositing them on all platforms, which in turn will enable us to validate whether layers are being painted in the correct order or potentially paint with respect to elevation instead of the given painting order.
This PR should not land until flutter/engine#8044 has landed, which resolves an issue that would result in clipping shadows in this PR.
I'm not entirely sure how to test this - I don't believe the old fork in the logic was tested.
Related Issues
Fixes #27891
Helps #25673, #25226
Depends on flutter/engine#8044
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Does your PR require Flutter developers to manually update their apps to accommodate your change?