Fix perf regression with checkStatus.

Returning an Error was costing us performance in extra
error checks. This intead uses the Context to process the
Error immediately, and returns a value from isComplete and
checkStatus.

Improves performance in draw call validation.

Bug: chromium:822235
Change-Id: I0793fc690e86137425fed593d45083e40aee8db9
Reviewed-on: https://chromium-review.googlesource.com/1011370
Reviewed-by: Luc Ferron <lucferron@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index fada66e..608fc97 100644
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -2420,7 +2420,7 @@
     UNIMPLEMENTED();
 }
 
-void Context::handleError(const Error &error)
+void Context::handleError(const Error &error) const
 {
     if (error.isError())
     {
@@ -2454,7 +2454,7 @@
 }
 
 // NOTE: this function should not assume that this context is current!
-void Context::markContextLost()
+void Context::markContextLost() const
 {
     if (mResetStrategy == GL_LOSE_CONTEXT_ON_RESET_EXT)
     {
@@ -2464,7 +2464,7 @@
     mContextLost = true;
 }
 
-bool Context::isContextLost()
+bool Context::isContextLost() const
 {
     return mContextLost;
 }
@@ -3643,9 +3643,7 @@
     Framebuffer *framebuffer = mGLState.getTargetFramebuffer(target);
     ASSERT(framebuffer);
 
-    bool complete = false;
-    ANGLE_CONTEXT_TRY(framebuffer->isComplete(this, &complete));
-    if (!complete)
+    if (!framebuffer->isComplete(this))
     {
         return;
     }
@@ -3667,9 +3665,7 @@
     Framebuffer *framebuffer = mGLState.getTargetFramebuffer(target);
     ASSERT(framebuffer);
 
-    bool complete = false;
-    ANGLE_CONTEXT_TRY(framebuffer->isComplete(this, &complete));
-    if (!complete)
+    if (!framebuffer->isComplete(this))
     {
         return;
     }
@@ -4918,15 +4914,7 @@
 {
     Framebuffer *framebuffer = mGLState.getTargetFramebuffer(target);
     ASSERT(framebuffer);
-
-    GLenum status = GL_NONE;
-    Error err     = framebuffer->checkStatus(this, &status);
-    if (err.isError())
-    {
-        handleError(err);
-        return 0;
-    }
-    return status;
+    return framebuffer->checkStatus(this);
 }
 
 void Context::compileShader(GLuint shader)