-
Notifications
You must be signed in to change notification settings - Fork 6k
Prevent app from accessing the GPU in the background in MultiFrameCodec #28159
Conversation
acab744 to
1db3fa9
Compare
gaaclarke
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.
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.
///).