Move the early-return case of zero mask to Context::blitFramebuffer

When the mask is zero, no buffers are copied in BlitFramebuffer. But we still
need to check all the error situations. So mask of zero should be put in
blitFramebuffer not the validation file.

Meanwhile, we adjust the checking sequence to pass the deqp case.

BUG=angleproject:2375
TEST=dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.blit_framebuffer

Change-Id: I73c78ffb8853153f70fc30e8ae0e704e08e454ac
Reviewed-on: https://chromium-review.googlesource.com/938573
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/validationES.cpp b/src/libANGLE/validationES.cpp
index 90a65de..0657124 100644
--- a/src/libANGLE/validationES.cpp
+++ b/src/libANGLE/validationES.cpp
@@ -1231,13 +1231,6 @@
         return false;
     }
 
-    if (mask == 0)
-    {
-        // ES3.0 spec, section 4.3.2 specifies that a mask of zero is valid and no
-        // buffers are copied.
-        return false;
-    }
-
     // ES3.0 spec, section 4.3.2 states that linear filtering is only available for the
     // color buffer, leaving only nearest being unfiltered from above
     if ((mask & ~GL_COLOR_BUFFER_BIT) != 0 && filter != GL_NEAREST)
@@ -1256,12 +1249,6 @@
         return false;
     }
 
-    if (readFramebuffer->id() == drawFramebuffer->id())
-    {
-        context->handleError(InvalidOperation());
-        return false;
-    }
-
     if (readFramebuffer->checkStatus(context) != GL_FRAMEBUFFER_COMPLETE)
     {
         context->handleError(InvalidFramebufferOperation());
@@ -1274,6 +1261,12 @@
         return false;
     }
 
+    if (readFramebuffer->id() == drawFramebuffer->id())
+    {
+        context->handleError(InvalidOperation());
+        return false;
+    }
+
     if (drawFramebuffer->getSamples(context) != 0)
     {
         context->handleError(InvalidOperation());