-
Notifications
You must be signed in to change notification settings - Fork 6k
Do not share the GrDirectContext across engine instances on Android #28694
Conversation
The AndroidContext is owned by the PlatformViewAndroid and is destructed on the platform thread. If the AndroidContext owns the GrDirectContext, then the GrDirectContext will also be destructed on the platform thread. This is unsafe because the platform thread does not have the EGL context required to invoke OpenGL ES APIs. See flutter/flutter#87937 See flutter/flutter#89658
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
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!
(note: releaseResourcesAndAbandonContext is now called in GPUSurface GL because context_owner_ = true).
What do we want to do about tests? Since this is sort of revert, we just want to add the test to the PR that reverts it? |
yes - this is reverting to the approach used on the Android platform prior to a4f02b7 |
…ndroid (flutter#28694)" This reverts commit 27281c4.
…ndroid (flutter#28694)" This reverts commit 27281c4.
…ndroid (flutter#28694)" This reverts commit 27281c4.
The AndroidContext is owned by the PlatformViewAndroid and is
destructed on the platform thread. If the AndroidContext owns the
GrDirectContext, then the GrDirectContext will also be destructed on
the platform thread.
This is unsafe because the platform thread does not have the EGL
context required to invoke OpenGL ES APIs.
See flutter/flutter#87937
See flutter/flutter#89658