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

Unified Diff: content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc

Issue 7782038: Prepare WebGL contexts for resource sharing with the compositor context. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Add an additional feature to GLES2DecoderImpl that is used to force the context to obey WebGL fea... Created 9 years, 3 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
Index: content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc
===================================================================
--- content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc (revision 102813)
+++ content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc (working copy)
@@ -66,14 +66,6 @@
delete context_;
}
-// This string should only be passed for WebGL contexts. Nothing ELSE!!!
-// Compositor contexts, Canvas2D contexts, Pepper Contexts, nor any other use of
-// a context should not pass this string.
-static const char* kWebGLPreferredGLExtensions =
- "GL_OES_packed_depth_stencil "
- "GL_OES_depth24 "
- "GL_CHROMIUM_webglsl";
-
bool WebGraphicsContext3DCommandBufferImpl::initialize(
WebGraphicsContext3D::Attributes attributes,
WebKit::WebView* web_view,
@@ -143,8 +135,7 @@
RendererGLContext::NONE,
};
- const char* preferred_extensions = attributes_.noExtensions ?
- kWebGLPreferredGLExtensions : "*";
+ const char* preferred_extensions = "*";
// We need to lock g_all_shared_contexts until after RendererGLContext::Create
// to ensure that the context we picked for our share group isn't deleted.
@@ -180,6 +171,12 @@
return false;
gl_ = context_->GetImplementation();
+
+ // TODO(twiz): This code is too fragile in that it assumes that only WebGL
+ // contexts will request noExtensions.
+ if (gl_ && attributes_.noExtensions)
+ gl_->EnableFeatureCHROMIUM("webgl_enable_glsl_webgl_validation");
+
context_->SetContextLostCallback(
NewCallback(this,
&WebGraphicsContext3DCommandBufferImpl::OnContextLost));
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698