diff options
author | danakj <danakj@chromium.org> | 2016-03-21 17:06:45 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-22 00:09:21 +0000 |
commit | f6cc81c7e7f6ae0cc7259a276375fa0ccceec26c (patch) | |
tree | 80167264c0f70c7b5bf78345d943cae653e66143 /gpu | |
parent | eb2e9f919ec99512c32c5c7879f28d0df23cbe95 (diff) | |
download | chromium_src-f6cc81c7e7f6ae0cc7259a276375fa0ccceec26c.zip chromium_src-f6cc81c7e7f6ae0cc7259a276375fa0ccceec26c.tar.gz chromium_src-f6cc81c7e7f6ae0cc7259a276375fa0ccceec26c.tar.bz2 |
Remove getError() and synthesizeGLError() from WebGraphicsContext3D.
This moves synthetic gl errors entirely into WebGLRenderingContextBase,
as all callers that need to synthesize errors have access to or are
inside that class.
We deleted some dead WebKit code in WebGLProgram to make the above true.
Callers to synthesizeGLError() now call the same public method of
WebGLRenderingContextBase instead, which allows them to provide
additional debug strings.
One caller to getError() was switched to GLES2Interface::GetError
in DrawingBuffer as that appears separate from the needs for synthetic
errors entirely.
R=bajones@chromium.org, chrishtr@chromium.org, kbr@chromium.org, pfeldman@chromium.org
BUG=584497
CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel
Review URL: https://codereview.chromium.org/1824433002
Cr-Commit-Position: refs/heads/master@{#382446}
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/blink/webgraphicscontext3d_impl.cc | 40 | ||||
-rw-r--r-- | gpu/blink/webgraphicscontext3d_impl.h | 3 |
2 files changed, 4 insertions, 39 deletions
diff --git a/gpu/blink/webgraphicscontext3d_impl.cc b/gpu/blink/webgraphicscontext3d_impl.cc index 2079772..4c1b790 100644 --- a/gpu/blink/webgraphicscontext3d_impl.cc +++ b/gpu/blink/webgraphicscontext3d_impl.cc @@ -192,13 +192,6 @@ WebGraphicsContext3DImpl::~WebGraphicsContext3DImpl() { } -void WebGraphicsContext3DImpl::synthesizeGLError(WGC3Denum error) { - if (std::find(synthetic_errors_.begin(), synthetic_errors_.end(), error) == - synthetic_errors_.end()) { - synthetic_errors_.push_back(error); - } -} - blink::WebString WebGraphicsContext3DImpl:: getRequestableExtensionsCHROMIUM() { return blink::WebString::fromUTF8( @@ -226,20 +219,11 @@ void WebGraphicsContext3DImpl::drawElements(WGC3Denum mode, bool WebGraphicsContext3DImpl::getActiveAttrib( WebGLId program, WGC3Duint index, ActiveInfo& info) { - if (!program) { - synthesizeGLError(GL_INVALID_VALUE); - return false; - } GLint max_name_length = -1; gl_->GetProgramiv( program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &max_name_length); - if (max_name_length < 0) - return false; - if (max_name_length == 0) { - // No active attributes exist. - synthesizeGLError(GL_INVALID_VALUE); - return false; - } + // The caller already checked that there is some active attribute. + DCHECK_GT(max_name_length, 0); scoped_ptr<GLchar[]> name(new GLchar[max_name_length]); GLsizei length = 0; GLint size = -1; @@ -260,13 +244,8 @@ bool WebGraphicsContext3DImpl::getActiveUniform( GLint max_name_length = -1; gl_->GetProgramiv( program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &max_name_length); - if (max_name_length < 0) - return false; - if (max_name_length == 0) { - // No active uniforms exist. - synthesizeGLError(GL_INVALID_VALUE); - return false; - } + // The caller already checked that there is some active uniform. + DCHECK_GT(max_name_length, 0); scoped_ptr<GLchar[]> name(new GLchar[max_name_length]); GLsizei length = 0; GLint size = -1; @@ -282,17 +261,6 @@ bool WebGraphicsContext3DImpl::getActiveUniform( return true; } -WGC3Denum WebGraphicsContext3DImpl::getError() { - if (!synthetic_errors_.empty()) { - std::vector<WGC3Denum>::iterator iter = synthetic_errors_.begin(); - WGC3Denum err = *iter; - synthetic_errors_.erase(iter); - return err; - } - - return gl_->GetError(); -} - blink::WebString WebGraphicsContext3DImpl::getProgramInfoLog( WebGLId program) { GLint logLength = 0; diff --git a/gpu/blink/webgraphicscontext3d_impl.h b/gpu/blink/webgraphicscontext3d_impl.h index 4448b72..a03f7f9d 100644 --- a/gpu/blink/webgraphicscontext3d_impl.h +++ b/gpu/blink/webgraphicscontext3d_impl.h @@ -49,7 +49,6 @@ class GPU_BLINK_EXPORT WebGraphicsContext3DImpl blink::WGC3Duint index, ActiveInfo&) override; - blink::WGC3Denum getError() override; blink::WebString getProgramInfoLog(blink::WebGLId program) override; blink::WebString getShaderInfoLog(blink::WebGLId shader) override; blink::WebString getShaderSource(blink::WebGLId shader) override; @@ -84,8 +83,6 @@ class GPU_BLINK_EXPORT WebGraphicsContext3DImpl void deleteRenderbuffer(blink::WebGLId) override; void deleteTexture(blink::WebGLId) override; - void synthesizeGLError(blink::WGC3Denum) override; - blink::WebString getRequestableExtensionsCHROMIUM() override; void blitFramebufferCHROMIUM(blink::WGC3Dint srcX0, |