Update the getRenderTarget functions to return gl::Error objects.

BUG=angle:520

Change-Id: If1f4f71972b669704eff70b5f60927d8e6ac07b3
Reviewed-on: https://chromium-review.googlesource.com/218767
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libGLESv2/libGLESv2.cpp b/src/libGLESv2/libGLESv2.cpp
index 4f43af5..bd7774a 100644
--- a/src/libGLESv2/libGLESv2.cpp
+++ b/src/libGLESv2/libGLESv2.cpp
@@ -8283,7 +8283,12 @@
         gl::Framebuffer *framebuffer = context->getState().getTargetFramebuffer(target);
         if (framebuffer && framebuffer->completeness() == GL_FRAMEBUFFER_COMPLETE)
         {
-            framebuffer->invalidate(context->getCaps(), numAttachments, attachments);
+            gl::Error error = framebuffer->invalidate(context->getCaps(), numAttachments, attachments);
+            if (error.isError())
+            {
+                context->recordError(error);
+                return;
+            }
         }
     }
 }
@@ -8311,7 +8316,12 @@
         gl::Framebuffer *framebuffer = context->getState().getTargetFramebuffer(target);
         if (framebuffer && framebuffer->completeness() == GL_FRAMEBUFFER_COMPLETE)
         {
-            framebuffer->invalidateSub(context->getCaps(), numAttachments, attachments, x, y, width, height);
+            gl::Error error = framebuffer->invalidateSub(numAttachments, attachments, x, y, width, height);
+            if (error.isError())
+            {
+                context->recordError(error);
+                return;
+            }
         }
     }
 }