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

Unified Diff: gpu/blink/webgraphicscontext3d_impl.cc

Issue 1824433002: Remove getError() and synthesizeGLError() from WebGraphicsContext3D. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simples-tplus
Patch Set: errors: rebase Created 4 years, 9 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: gpu/blink/webgraphicscontext3d_impl.cc
diff --git a/gpu/blink/webgraphicscontext3d_impl.cc b/gpu/blink/webgraphicscontext3d_impl.cc
index 207977247d4cd30839fa9aa52b766ae0079cba03..4c1b7903aba5e4689cbb0697e3f0777b26fe30a4 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;
« no previous file with comments | « gpu/blink/webgraphicscontext3d_impl.h ('k') | third_party/WebKit/Source/modules/webgl/EXTDisjointTimerQuery.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698