-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
[Impeller] tear down swapchain when backgrounding. #165259
Conversation
This should show up in our memory benchmarks |
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 code is simple and looks good to me. There is a mechanism outside of this PR that resurrects the swapchain. I'd love to have a test that exercises that. Maybe in the android view level?
At a minimum we should have a comment that explains the mechanism that resurrects the swapchain.
@@ -72,6 +72,10 @@ bool SurfaceContextVK::SetWindowSurface(vk::UniqueSurfaceKHR surface, | |||
return SetSwapchain(SwapchainVK::Create(parent_, std::move(surface), size)); | |||
} | |||
|
|||
void SurfaceContextVK::TeardownSwapchain() { | |||
swapchain_.reset(); |
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.
Probably worth commenting how this will get resurrected.
THe android engine tests background and foreground and test rendering. I think those will cover it |
Added unit test and doc 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
autosubmit label was removed for flutter/flutter/165259, because - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label. |
When we return to the foreground the swapchain is reconstructed anyway. Eagerly tearing the old one down releases memory faster. Highlighted by a regression in a customer: money benchmark.