Texturing support for RECTANGLE textures.

Uses textureSize() to unnormalize texture coords when reading from a RECTANGLE texture. Because of this we also require a later GLSL version to use rectangle textures (1.40).

Note that this causes a issue with the bicubic effect. The texture coords seem to have poor precision and the result is ugly. textureSize() is intended as a workaround until effects can be updated to handle unnormalized coords themselves.

Updates places where we were looking for OpenGL version 3.2 for rectangle support. It was actually added in 3.1.

BUG=skia:3868

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1594483003

Review URL: https://codereview.chromium.org/1594483003
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 30181f6..9a2a5ac 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -220,9 +220,13 @@
         }
     }
 
-    if ((kGL_GrGLStandard == standard && version >= GR_GL_VER(3, 2)) ||
+    if ((kGL_GrGLStandard == standard && version >= GR_GL_VER(3, 1)) ||
         ctxInfo.hasExtension("GL_ARB_texture_rectangle")) {
-        fRectangleTextureSupport = true;
+        // We also require textureSize() support for rectangle 2D samplers which was added in GLSL
+        // 1.40.
+        if (ctxInfo.glslGeneration() >= k140_GrGLSLGeneration) {
+            fRectangleTextureSupport = true;
+        }
     }
 
     if (kGL_GrGLStandard == standard) {