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
Prevent app from accessing the GPU in the background in MultiFrameCodec #28159
Conversation
acab744
to
1db3fa9
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.
Awesome, high quality PR, thanks. I just have a nit to factor out a helper function (feel free to pass if you are tight on time) also you just have to move the comment back where it was.
// Defer decoding until time of draw later on the raster thread. Can | ||
// happen when GL operations are currently forbidden such as in the | ||
// background on iOS. |
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 comment goes with the other MakeFromBitmap call.
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
runners.GetIOTaskRunner()->PostTask([&]() { | ||
io_manager.reset(); | ||
latch.Signal(); | ||
}); | ||
|
||
latch.Wait(); |
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: This pattern of synchronously executing a task happens multiple times in this test. I'd prefer that you pulled out a helper function so the test is easier to parse/maintain. Here's an example here:
engine/shell/common/engine_unittests.cc
Line 117 in 9c6c211
void PostUITaskSync(const std::function<void()>& function) { |
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.
It's indeed a good idea. I will file a PR to do this later.
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.
FWIW this pattern happens so often in code (especially testing code) that I tried to add it to the TaskRunner API but was met with resistance under the fear that it would be misused. That's why I just made it a local method to the test suite.
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 filed a PR to do this: #28467
f25e963
to
b549fcf
Compare
b549fcf
to
64b7d96
Compare
Fix the issue : flutter/flutter#88353
Pre-launch Checklist
writing and running engine tests.
///
).