Add texture rectangle extension.

This is needed to support binding IOSurfaces to textures on OSX. This
commit adds support in the API and tests, but didn't need to implement
compiler changes as it already supported ARB_texture_rectangle.

Implementation of CHROMIUM_opy_texture for rectangle texture and the
spec are left for follow-up commits.

Change-Id: I45c66be763a9d3f6f619640f9f95f39b05c70867
Reviewed-on: https://chromium-review.googlesource.com/559106
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index 2e7ec29..1c5c6a1 100644
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -334,6 +334,13 @@
         }
     }
 
+    if (mExtensions.textureRectangle)
+    {
+        Texture *zeroTextureRectangle =
+            new Texture(mImplementation.get(), 0, GL_TEXTURE_RECTANGLE_ANGLE);
+        mZeroTextures[GL_TEXTURE_RECTANGLE_ANGLE].set(this, zeroTextureRectangle);
+    }
+
     if (mExtensions.eglImageExternal || mExtensions.eglStreamConsumerExternal)
     {
         Texture *zeroTextureExternal =
@@ -1422,6 +1429,9 @@
         case GL_MAX_TEXTURE_SIZE:
             *params = mCaps.max2DTextureSize;
             break;
+        case GL_MAX_RECTANGLE_TEXTURE_SIZE_ANGLE:
+            *params = mCaps.maxRectangleTextureSize;
+            break;
         case GL_MAX_CUBE_MAP_TEXTURE_SIZE:
             *params = mCaps.maxCubeMapTextureSize;
             break;
@@ -3028,6 +3038,10 @@
         {
             index = ImageIndex::Make2D(level);
         }
+        else if (textarget == GL_TEXTURE_RECTANGLE_ANGLE)
+        {
+            index = ImageIndex::MakeRectangle(level);
+        }
         else if (textarget == GL_TEXTURE_2D_MULTISAMPLE)
         {
             ASSERT(level == 0);