Source: https://github.com/anbox/anbox/pull/1877/commits/3e71a84065ca09c605f36ecf2825debf161c1be6 From 3e71a84065ca09c605f36ecf2825debf161c1be6 Mon Sep 17 00:00:00 2001 From: kuailexs <952415538@qq.com> Date: Fri, 30 Jul 2021 23:54:11 +0800 Subject: [PATCH] fix webview,GL_SHADING_LANGUAGE_VERSION and EGL_RENDERABLE_TYPE --- android/opengl/system/egl/egl.cpp | 4 ++++ src/anbox/graphics/emugl/RenderControl.cpp | 3 +++ 2 files changed, 7 insertions(+) diff --git a/android/opengl/system/egl/egl.cpp b/android/opengl/system/egl/egl.cpp index ae5a8892c..981830243 100644 --- a/android/opengl/system/egl/egl.cpp +++ b/android/opengl/system/egl/egl.cpp @@ -606,6 +606,10 @@ EGLBoolean eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute if (s_display.getConfigAttrib(config, attribute, value)) { + if (attribute == EGL_RENDERABLE_TYPE && *value > EGL_OPENGL_ES2_BIT){ + ALOGE("[%s] EGL_RENDERABLE_TYPE -> EGL_OPENGL_ES2_BIT\n", __FUNCTION__); + *value = EGL_OPENGL_ES2_BIT; + } return EGL_TRUE; } else diff --git a/src/anbox/graphics/emugl/RenderControl.cpp b/src/anbox/graphics/emugl/RenderControl.cpp index 9f2558553..99f30015d 100644 --- a/src/anbox/graphics/emugl/RenderControl.cpp +++ b/src/anbox/graphics/emugl/RenderControl.cpp @@ -144,6 +144,9 @@ static EGLint rcGetGLString(EGLenum name, void* buffer, EGLint bufferSize) { }; result = filter_extensions(result, whitelisted_extensions); + }else if (name == GL_SHADING_LANGUAGE_VERSION) { + // GL_VERSION:"OpenGL ES 2.0" matched GL_SHADING_LANGUAGE_VERSION:"OpenGL ES GLSL ES 1.00" + result = "OpenGL ES GLSL ES 1.00"; } int nextBufferSize = result.size() + 1;