Original commit: https://github.com/anbox/anbox/pull/1875/commits/a38b10b6bd519faa781d43d45f9740e5e82c4ca6 From a38b10b6bd519faa781d43d45f9740e5e82c4ca6 Mon Sep 17 00:00:00 2001 From: kuailexs <952415538@qq.com> Date: Wed, 28 Jul 2021 20:54:32 +0800 Subject: [PATCH] emugl:fix webview,GL_SHADING_LANGUAGE_VERSION and EGL_RENDERABLE_TYPE --- src/anbox/graphics/emugl/RenderControl.cpp | 3 +++ src/anbox/graphics/emugl/RendererConfig.cpp | 7 +++++++ 2 files changed, 10 insertions(+) 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; diff --git a/src/anbox/graphics/emugl/RendererConfig.cpp b/src/anbox/graphics/emugl/RendererConfig.cpp index 02b6b7882..f7027dc9d 100644 --- a/src/anbox/graphics/emugl/RendererConfig.cpp +++ b/src/anbox/graphics/emugl/RendererConfig.cpp @@ -142,6 +142,13 @@ int RendererConfigList::chooseConfig(const EGLint* attribs, EGLint* configs, mustReplaceSurfaceType = true; } } + // EGL_RENDERABLE_TYPE , fix webview + if (attribs[numAttribs] == EGL_RENDERABLE_TYPE) { + if (attribs[numAttribs + 1] > EGL_OPENGL_ES2_BIT) { + ERROR("EGL_RENDERABLE_TYPE can not > EGL_OPENGL_ES2_BIT"); + return 0; + } + } numAttribs += 2; }