Support blitFramebuffer to and from IOSurface-backed textures.

Extend validation to allow texture rectangle-backed textures as
blitFramebuffer sources and destinations.

Add end-to-end test covering this functionality, and run the
IOSurfaceClientBufferTests against both ES2 and ES3.

Bug: angleproject:3669
Change-Id: I7b8815a2c98072c12de45717afbba9e9b29ba253
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1694483
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/validationES2.cpp b/src/libANGLE/validationES2.cpp
index 4be4d2d..49ee47d 100644
--- a/src/libANGLE/validationES2.cpp
+++ b/src/libANGLE/validationES2.cpp
@@ -2671,7 +2671,9 @@
         if (readColorAttachment && drawColorAttachment)
         {
             if (!(readColorAttachment->type() == GL_TEXTURE &&
-                  readColorAttachment->getTextureImageIndex().getType() == TextureType::_2D) &&
+                  (readColorAttachment->getTextureImageIndex().getType() == TextureType::_2D ||
+                   readColorAttachment->getTextureImageIndex().getType() ==
+                       TextureType::Rectangle)) &&
                 readColorAttachment->type() != GL_RENDERBUFFER &&
                 readColorAttachment->type() != GL_FRAMEBUFFER_DEFAULT)
             {
@@ -2688,7 +2690,9 @@
                 if (attachment)
                 {
                     if (!(attachment->type() == GL_TEXTURE &&
-                          attachment->getTextureImageIndex().getType() == TextureType::_2D) &&
+                          (attachment->getTextureImageIndex().getType() == TextureType::_2D ||
+                           attachment->getTextureImageIndex().getType() ==
+                               TextureType::Rectangle)) &&
                         attachment->type() != GL_RENDERBUFFER &&
                         attachment->type() != GL_FRAMEBUFFER_DEFAULT)
                     {