Commit dc459138 authored by oetuaho@nvidia.com's avatar oetuaho@nvidia.com

Fix WebGLDebugShaders::getTranslatedShaderSource returning null

The function should return an empty string in case no source has been
defined, compileShader() has not been called, or the translation has
failed for shader. It used to return null, after this patch it returns an
empty string like it is supposed to.

Also make getTranslatedShaderSourceANGLE pure virtual in
WebGraphicsContext3D.

BUG=358530
TEST=WebGL conformance tests with --enable-privileged-webgl-extensions
R=kbr@chromium.org

Review URL: https://codereview.chromium.org/216603004

git-svn-id: svn://svn.chromium.org/blink/trunk@170645 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 28af5f3e
...@@ -58,7 +58,7 @@ String WebGLDebugShaders::getTranslatedShaderSource(WebGLShader* shader) ...@@ -58,7 +58,7 @@ String WebGLDebugShaders::getTranslatedShaderSource(WebGLShader* shader)
return String(); return String();
if (!m_context->validateWebGLObject("getTranslatedShaderSource", shader)) if (!m_context->validateWebGLObject("getTranslatedShaderSource", shader))
return ""; return "";
return m_context->webGraphicsContext3D()->getTranslatedShaderSourceANGLE(shader->object()); return m_context->ensureNotNull(m_context->webGraphicsContext3D()->getTranslatedShaderSourceANGLE(shader->object()));
} }
bool WebGLDebugShaders::supported(WebGLRenderingContextBase* context) bool WebGLDebugShaders::supported(WebGLRenderingContextBase* context)
......
...@@ -284,6 +284,8 @@ public: ...@@ -284,6 +284,8 @@ public:
virtual void getQueryivEXT(GLenum, GLenum, GLint*) { } virtual void getQueryivEXT(GLenum, GLenum, GLint*) { }
virtual void getQueryObjectuivEXT(WebGLId, GLenum, GLuint*) { } virtual void getQueryObjectuivEXT(WebGLId, GLenum, GLuint*) { }
virtual WebString getTranslatedShaderSourceANGLE(WebGLId) { return WebString(); }
protected: protected:
unsigned m_nextTextureId; unsigned m_nextTextureId;
Attributes m_attrs; Attributes m_attrs;
......
...@@ -391,9 +391,7 @@ public: ...@@ -391,9 +391,7 @@ public:
// state is sticky, rather than reported only once. // state is sticky, rather than reported only once.
virtual WGC3Denum getGraphicsResetStatusARB() { return 0; /* GL_NO_ERROR */ } virtual WGC3Denum getGraphicsResetStatusARB() { return 0; /* GL_NO_ERROR */ }
// FIXME: make this function pure virtual once it is implemented in virtual WebString getTranslatedShaderSourceANGLE(WebGLId shader) = 0;
// both command buffer port and in-process port.
virtual WebString getTranslatedShaderSourceANGLE(WebGLId shader) { return WebString(); }
// GL_CHROMIUM_iosurface // GL_CHROMIUM_iosurface
virtual void texImageIOSurface2DCHROMIUM(WGC3Denum target, WGC3Dint width, WGC3Dint height, WGC3Duint ioSurfaceId, WGC3Duint plane) { } virtual void texImageIOSurface2DCHROMIUM(WGC3Denum target, WGC3Dint width, WGC3Dint height, WGC3Duint ioSurfaceId, WGC3Duint plane) { }
......
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