summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-17 19:24:18 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-17 19:24:18 +0000
commitb1d2dcb6ca00ca1aab7017702a882f9df9eeaa5f (patch)
tree724b4744870f078601c0fef591e538fcc28b22bb /chrome
parent8d84301ae5bbb424b8c3e0f22c69841519324f10 (diff)
downloadchromium_src-b1d2dcb6ca00ca1aab7017702a882f9df9eeaa5f.zip
chromium_src-b1d2dcb6ca00ca1aab7017702a882f9df9eeaa5f.tar.gz
chromium_src-b1d2dcb6ca00ca1aab7017702a882f9df9eeaa5f.tar.bz2
Makes shader translation a runtime switch.
For WebGL the shader translation is off. For Pepper and other processes it is on. This will be removed and the tranlator will always be on at some point in the future TEST=More conformance tests pass, manually ran WebGL demos in Chrome. BUG=none Review URL: http://codereview.chromium.org/2127001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47441 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/renderer/ggl/ggl.cc17
-rw-r--r--chrome/renderer/ggl/ggl.h3
-rw-r--r--chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc2
3 files changed, 22 insertions, 0 deletions
diff --git a/chrome/renderer/ggl/ggl.cc b/chrome/renderer/ggl/ggl.cc
index 9ab30c4..8bc0177 100644
--- a/chrome/renderer/ggl/ggl.cc
+++ b/chrome/renderer/ggl/ggl.cc
@@ -18,6 +18,7 @@
#include "gpu/command_buffer/client/gles2_implementation.h"
#include "gpu/command_buffer/client/gles2_lib.h"
#include "gpu/command_buffer/common/constants.h"
+#include "gpu/GLES2/gles2_command_buffer.h"
#endif // ENABLE_GPU
namespace ggl {
@@ -82,6 +83,9 @@ class Context {
// Get the current error code.
Error GetError();
+ // TODO(gman): Remove this.
+ void DisableShaderTranslation();
+
private:
scoped_refptr<GpuChannelHost> channel_;
Context* parent_;
@@ -248,6 +252,11 @@ Error Context::GetError() {
}
}
+// TODO(gman): Remove This
+void Context::DisableShaderTranslation() {
+ gles2_implementation_->CommandBufferEnable(PEPPER3D_SKIP_GLSL_TRANSLATION);
+}
+
#endif // ENABLE_GPU
Context* CreateViewContext(GpuChannelHost* channel, gfx::NativeViewId view) {
@@ -345,4 +354,12 @@ Error GetError() {
#endif
}
+// TODO(gman): Remove This
+void DisableShaderTranslation(Context* context) {
+#if defined(ENABLE_GPU)
+ if (context) {
+ context->DisableShaderTranslation();
+ }
+#endif
+}
} // namespace ggl
diff --git a/chrome/renderer/ggl/ggl.h b/chrome/renderer/ggl/ggl.h
index e5c661f..cd02c1f 100644
--- a/chrome/renderer/ggl/ggl.h
+++ b/chrome/renderer/ggl/ggl.h
@@ -75,6 +75,9 @@ bool SwapBuffers();
// Destroy the given GGL context.
bool DestroyContext(Context* context);
+// TODO(gman): Remove this
+void DisableShaderTranslation(Context* context);
+
// Return the current GGL error.
Error GetError();
diff --git a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc
index 73e3aa0..6caa0ae 100644
--- a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc
+++ b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc
@@ -40,6 +40,8 @@ bool WebGraphicsContext3DCommandBufferImpl::initialize(
context_ = ggl::CreateOffscreenContext(host, NULL, gfx::Size(1, 1));
if (!context_)
return false;
+ // TODO(gman): Remove this.
+ DisableShaderTranslation(context_);
return true;
}