summaryrefslogtreecommitdiffstats
path: root/webkit/gpu
diff options
context:
space:
mode:
authorzmo@google.com <zmo@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-17 23:53:13 +0000
committerzmo@google.com <zmo@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-17 23:53:13 +0000
commit1e037e1f5c48ea5e9aeecb7c82a8351dbb399aa2 (patch)
treefcbaca12c9afd2ad1b94f5ae543ed803ff8d3afa /webkit/gpu
parent41d513cb215f685eb5bd7b57ad91643773b0e9e2 (diff)
downloadchromium_src-1e037e1f5c48ea5e9aeecb7c82a8351dbb399aa2.zip
chromium_src-1e037e1f5c48ea5e9aeecb7c82a8351dbb399aa2.tar.gz
chromium_src-1e037e1f5c48ea5e9aeecb7c82a8351dbb399aa2.tar.bz2
Last straw for translated_shader_source extension.
While hooking up with webkit side of this extension, I realized something is missing. So this CL is the fix. BUG=95531 TEST=tested with the webkit side CL Review URL: http://codereview.chromium.org/8294002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105969 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/gpu')
-rw-r--r--webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc24
-rw-r--r--webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h2
2 files changed, 26 insertions, 0 deletions
diff --git a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
index ec03290..7ff9951 100644
--- a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
+++ b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
@@ -1308,6 +1308,30 @@ WebKit::WebString WebGraphicsContext3DInProcessCommandBufferImpl::
GLsizei returnedLogLength = 0;
gl_->GetShaderSource(
shader, logLength, &returnedLogLength, log.get());
+ if (!returnedLogLength)
+ return WebKit::WebString();
+ DCHECK_EQ(logLength, returnedLogLength + 1);
+ WebKit::WebString res =
+ WebKit::WebString::fromUTF8(log.get(), returnedLogLength);
+ return res;
+}
+
+WebKit::WebString WebGraphicsContext3DInProcessCommandBufferImpl::
+ getTranslatedShaderSourceANGLE(WebGLId shader) {
+ ClearContext();
+ GLint logLength = 0;
+ gl_->GetShaderiv(
+ shader, GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE, &logLength);
+ if (!logLength)
+ return WebKit::WebString();
+ scoped_array<GLchar> log(new GLchar[logLength]);
+ if (!log.get())
+ return WebKit::WebString();
+ GLsizei returnedLogLength = 0;
+ gl_->GetTranslatedShaderSourceANGLE(
+ shader, logLength, &returnedLogLength, log.get());
+ if (!returnedLogLength)
+ return WebKit::WebString();
DCHECK_EQ(logLength, returnedLogLength + 1);
WebKit::WebString res =
WebKit::WebString::fromUTF8(log.get(), returnedLogLength);
diff --git a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h
index ae162e7..f4ee402 100644
--- a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h
+++ b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h
@@ -421,6 +421,8 @@ class WebGraphicsContext3DInProcessCommandBufferImpl
WGC3Denum target, WGC3Dsizei samples, WGC3Denum internalformat,
WGC3Dsizei width, WGC3Dsizei height);
+ virtual WebKit::WebString getTranslatedShaderSourceANGLE(WebGLId shader);
+
virtual WebGLId createCompositorTexture(WGC3Dsizei width, WGC3Dsizei height);
virtual void deleteCompositorTexture(WebGLId parent_texture);
virtual void copyTextureToCompositor(WebGLId texture,