[Impeller] acquire the gpu sync switch when flush stored GPU tasks.#169596
[Impeller] acquire the gpu sync switch when flush stored GPU tasks.#169596auto-submit[bot] merged 4 commits intoflutter:masterfrom
Conversation
gaaclarke
left a comment
There was a problem hiding this comment.
This approach is looking good to me.
| for (const auto& task : tasks_awaiting_gpu) { | ||
| task.task(); | ||
| } |
There was a problem hiding this comment.
Do you think we should acquire the lock inside the loop? My concern is that if this takes too much time the OS might kill the process.
There was a problem hiding this comment.
hmm, yeah that is a good point.
|
@jonahwilliams The internal customer is reporting that after this change, the images still briefly show up as pink before loading in correctly. Does that sound plausible? |
|
We can do #169378 too.
There is no automated retry built into this system, likely they have some business logic that is refreshing the images which covers up the images that were incorrectly decoded. |
…lutter#169596) Potential fix for flutter#166668 See: * https://github.com/flutter/flutter/blob/master/engine/src/flutter/impeller/renderer/backend/metal/context_mtl.mm#L429 * https://github.com/flutter/flutter/blob/5d013c73baa70a8b3e1c541cb63e4c22654aa3cc/engine/src/flutter/fml/synchronization/sync_switch.cc#L41 We don't hold the sync switch lock when we flush tasks. So if we start flushing then immediately go to the background, then we might execute while backgrounded.
Includes: * flutter/flutter#169596 * flutter/flutter#169378 Fix image decode errors on iOS that could occur if a push notification triggered image decoding while the app is backgrounded.
Potential fix for #166668
See:
flutter/engine/src/flutter/fml/synchronization/sync_switch.cc
Line 41 in 5d013c7
We don't hold the sync switch lock when we flush tasks. So if we start flushing then immediately go to the background, then we might execute while backgrounded.