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

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: 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 30030b2ab7871c071bd9c84184bf13a030dacae3..89099ec356b21b311e771ee4a707b3c108d44fe3 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);
- }
-}
-
bool WebGraphicsContext3DImpl::genSyncTokenCHROMIUM(WGC3Duint64 fenceSync,
WGC3Dbyte* syncToken) {
gl_->GenSyncTokenCHROMIUM(fenceSync, syncToken);
@@ -232,20 +225,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;
@@ -266,13 +250,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;
@@ -288,17 +267,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;

Powered by Google App Engine
This is Rietveld 408576698