Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Unified Diff: gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc

Issue 2154373002: Limit Skia to ES2 functionality in GLES2Interface/Skia bindings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc
diff --git a/gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc b/gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc
index e9ca9868d1623eb437d84d203fd151933390b7cf..b07f8fb44ad76a6f83907e29b9044ff6e1538c57 100644
--- a/gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc
+++ b/gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc
@@ -22,11 +22,19 @@ std::function<R(Args...)> gles_bind(R (GLES2Interface::*func)(Args...),
namespace skia_bindings {
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);
interface->fStandard = kGLES_GrGLStandard;
- interface->fExtensions.init(
- kGLES_GrGLStandard, gles_bind(&GLES2Interface::GetString, impl), nullptr,
- gles_bind(&GLES2Interface::GetIntegerv, impl));
+ interface->fExtensions.init(kGLES_GrGLStandard, get_string_version_override,
+ nullptr,
+ gles_bind(&GLES2Interface::GetIntegerv, impl));
GrGLInterface::Functions* functions = &interface->fFunctions;
functions->fActiveTexture = gles_bind(&GLES2Interface::ActiveTexture, impl);
@@ -91,7 +99,7 @@ sk_sp<GrGLInterface> CreateGLES2InterfaceBindings(GLES2Interface* impl) {
functions->fGetShaderiv = gles_bind(&GLES2Interface::GetShaderiv, impl);
functions->fGetShaderPrecisionFormat =
gles_bind(&GLES2Interface::GetShaderPrecisionFormat, impl);
- functions->fGetString = gles_bind(&GLES2Interface::GetString, impl);
+ functions->fGetString = get_string_version_override;
functions->fGetUniformLocation =
gles_bind(&GLES2Interface::GetUniformLocation, impl);
functions->fInsertEventMarker =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698