Commit 9284cb85 authored by bsalomon's avatar bsalomon Committed by Commit bot

Limit Skia to ES2 functionality in GLES2Interface/Skia bindings.

The ES3 implementation is not currently well tested enough to enable Skia's use of it. However, Skia is required to run the WebGL2 conformance tests. To work around this conundrum we'll temporarily limit Skia to using ES2 functionality within an ES3 context.

BUG=626431

CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2154373002
Cr-Commit-Position: refs/heads/master@{#406107}
parent f6e6069b
...@@ -22,11 +22,19 @@ std::function<R(Args...)> gles_bind(R (GLES2Interface::*func)(Args...), ...@@ -22,11 +22,19 @@ std::function<R(Args...)> gles_bind(R (GLES2Interface::*func)(Args...),
namespace skia_bindings { namespace skia_bindings {
sk_sp<GrGLInterface> CreateGLES2InterfaceBindings(GLES2Interface* impl) { sk_sp<GrGLInterface> CreateGLES2InterfaceBindings(GLES2Interface* impl) {
// Until Chromium is passing the WebGL 2.0 conformance we're limiting Skia to
// a GLES 2.0 interface (plus extensions).
auto get_string_version_override = [impl](GLenum name) {
if (name == GL_VERSION)
return reinterpret_cast<const GLubyte*>("OpenGL ES 2.0 Chromium");
return impl->GetString(name);
};
sk_sp<GrGLInterface> interface(new GrGLInterface); sk_sp<GrGLInterface> interface(new GrGLInterface);
interface->fStandard = kGLES_GrGLStandard; interface->fStandard = kGLES_GrGLStandard;
interface->fExtensions.init( interface->fExtensions.init(kGLES_GrGLStandard, get_string_version_override,
kGLES_GrGLStandard, gles_bind(&GLES2Interface::GetString, impl), nullptr, nullptr,
gles_bind(&GLES2Interface::GetIntegerv, impl)); gles_bind(&GLES2Interface::GetIntegerv, impl));
GrGLInterface::Functions* functions = &interface->fFunctions; GrGLInterface::Functions* functions = &interface->fFunctions;
functions->fActiveTexture = gles_bind(&GLES2Interface::ActiveTexture, impl); functions->fActiveTexture = gles_bind(&GLES2Interface::ActiveTexture, impl);
...@@ -91,7 +99,7 @@ sk_sp<GrGLInterface> CreateGLES2InterfaceBindings(GLES2Interface* impl) { ...@@ -91,7 +99,7 @@ sk_sp<GrGLInterface> CreateGLES2InterfaceBindings(GLES2Interface* impl) {
functions->fGetShaderiv = gles_bind(&GLES2Interface::GetShaderiv, impl); functions->fGetShaderiv = gles_bind(&GLES2Interface::GetShaderiv, impl);
functions->fGetShaderPrecisionFormat = functions->fGetShaderPrecisionFormat =
gles_bind(&GLES2Interface::GetShaderPrecisionFormat, impl); gles_bind(&GLES2Interface::GetShaderPrecisionFormat, impl);
functions->fGetString = gles_bind(&GLES2Interface::GetString, impl); functions->fGetString = get_string_version_override;
functions->fGetUniformLocation = functions->fGetUniformLocation =
gles_bind(&GLES2Interface::GetUniformLocation, impl); gles_bind(&GLES2Interface::GetUniformLocation, impl);
functions->fInsertEventMarker = functions->fInsertEventMarker =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment