Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Workaround for an Android emulator EGL bug that can cause inaccurate GL version strings #21258

Merged
merged 1 commit into from
Oct 2, 2020

Conversation

jason-simmons
Copy link
Member

Some versions of the Android emulator EGL implementation will only
update the GL_VERSION string when the process calls eglMakeCurrent
on an EGLContext for the first time. If you select a GLES2 context,
then a GLES1 context, and then the original GLES2 context, the version
string will not be updated by the second eglMakeCurrent(GLES2) call.

So if a GLES1 context was previously current, then when the engine makes
its GLES2 context current Skia will continue to see the GLES1 version
string and will fail to build a GrGLInterface.

This workaround checks for the emulator GL renderer and creates a new
context to force a version string update before making the
GrGLInterface.

See internal bug b/168748787

Fixes flutter/flutter#63663

…GL version strings

Some versions of the Android emulator EGL implementation will only
update the GL_VERSION string when the process calls eglMakeCurrent
on an EGLContext for the first time.  If you select a GLES2 context,
then a GLES1 context, and then the original GLES2 context, the version
string will not be updated by the second eglMakeCurrent(GLES2) call.

So if a GLES1 context was previously current, then when the engine makes
its GLES2 context current Skia will continue to see the GLES1 version
string and will fail to build a GrGLInterface.

This workaround checks for the emulator GL renderer and creates a new
context to force a version string update before making the
GrGLInterface.

See internal bug b/168748787

Fixes flutter/flutter#63663
@flutter-dashboard
Copy link

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.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@jason-simmons jason-simmons added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Oct 2, 2020
@fluttergithubbot fluttergithubbot merged commit 43828e8 into flutter:master Oct 2, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 2, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 2, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 2, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 2, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 3, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 3, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 3, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 3, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 3, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 3, 2020
@amorenew
Copy link

amorenew commented Nov 3, 2020

@chinmaygarde is this fix on stable or still in master?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes platform-android waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[image_picker with google_maps_flutter] Emulator Crash after getImage - Failed to setup Skia Gr context.
5 participants