Skip to content
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

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 join this conversation on GitHub. Already have an account? Sign in to comment
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
5 participants