Add integer texture support.

This allows us to create integer textures and sample them from a GrProcessor's code.

Filtering is limited to NEAREST.

Adds tests for reading/writing pixels, copying, and drawing. These operations are not allowed to convert to fixed/float configs.

Vulkan support is TBD.


GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4348

Change-Id: If38d89a03285d4bd98d1f14f9638b0320977e43d
Reviewed-on: https://skia-review.googlesource.com/4348
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
diff --git a/src/gpu/vk/GrVkUniformHandler.cpp b/src/gpu/vk/GrVkUniformHandler.cpp
index 4a6e977..7c11b9d 100644
--- a/src/gpu/vk/GrVkUniformHandler.cpp
+++ b/src/gpu/vk/GrVkUniformHandler.cpp
@@ -25,10 +25,11 @@
         0x7, // kMat22f_GrSLType
         0xF, // kMat33f_GrSLType
         0xF, // kMat44f_GrSLType
-        0x0, // Sampler2D_GrSLType, should never return this
-        0x0, // SamplerExternal_GrSLType, should never return this
-        0x0, // Sampler2DRect_GrSLType, should never return this
-        0x0, // SamplerBuffer_GrSLType, should never return this
+        0x0, // kTexture2DSampler_GrSLType, should never return this
+        0x0, // kTexture2DISampler_GrSLType, should never return this
+        0x0, // kTextureExternalSampler_GrSLType, should never return this
+        0x0, // kTexture2DSamplerRect_GrSLType, should never return this
+        0x0, // ktextureBufferSampler_GrSLType, should never return this
         0x0, // kBool_GrSLType
         0x7, // kInt_GrSLType
         0x7, // kUint_GrSLType
@@ -44,14 +45,15 @@
     GR_STATIC_ASSERT(6 == kMat33f_GrSLType);
     GR_STATIC_ASSERT(7 == kMat44f_GrSLType);
     GR_STATIC_ASSERT(8 == kTexture2DSampler_GrSLType);
-    GR_STATIC_ASSERT(9 == kTextureExternalSampler_GrSLType);
-    GR_STATIC_ASSERT(10 == kTexture2DRectSampler_GrSLType);
-    GR_STATIC_ASSERT(11 == kTextureBufferSampler_GrSLType);
-    GR_STATIC_ASSERT(12 == kBool_GrSLType);
-    GR_STATIC_ASSERT(13 == kInt_GrSLType);
-    GR_STATIC_ASSERT(14 == kUint_GrSLType);
-    GR_STATIC_ASSERT(15 == kTexture2D_GrSLType);
-    GR_STATIC_ASSERT(16 == kSampler_GrSLType);
+    GR_STATIC_ASSERT(9 == kTexture2DISampler_GrSLType);
+    GR_STATIC_ASSERT(10 == kTextureExternalSampler_GrSLType);
+    GR_STATIC_ASSERT(11 == kTexture2DRectSampler_GrSLType);
+    GR_STATIC_ASSERT(12 == kTextureBufferSampler_GrSLType);
+    GR_STATIC_ASSERT(13 == kBool_GrSLType);
+    GR_STATIC_ASSERT(14 == kInt_GrSLType);
+    GR_STATIC_ASSERT(15 == kUint_GrSLType);
+    GR_STATIC_ASSERT(16 == kTexture2D_GrSLType);
+    GR_STATIC_ASSERT(17 == kSampler_GrSLType);
     GR_STATIC_ASSERT(SK_ARRAY_COUNT(kAlignmentMask) == kGrSLTypeCount);
     return kAlignmentMask[type];
 }
@@ -71,6 +73,7 @@
         12 * sizeof(float),       // kMat33f_GrSLType
         16 * sizeof(float),       // kMat44f_GrSLType
         0,                        // kTexture2DSampler_GrSLType
+        0,                        // kTexture2DISampler_GrSLType
         0,                        // kTextureExternalSampler_GrSLType
         0,                        // kTexture2DRectSampler_GrSLType
         0,                        // kTextureBufferSampler_GrSLType
@@ -91,14 +94,15 @@
     GR_STATIC_ASSERT(6 == kMat33f_GrSLType);
     GR_STATIC_ASSERT(7 == kMat44f_GrSLType);
     GR_STATIC_ASSERT(8 == kTexture2DSampler_GrSLType);
-    GR_STATIC_ASSERT(9 == kTextureExternalSampler_GrSLType);
-    GR_STATIC_ASSERT(10 == kTexture2DRectSampler_GrSLType);
-    GR_STATIC_ASSERT(11 == kTextureBufferSampler_GrSLType);
-    GR_STATIC_ASSERT(12 == kBool_GrSLType);
-    GR_STATIC_ASSERT(13 == kInt_GrSLType);
-    GR_STATIC_ASSERT(14 == kUint_GrSLType);
-    GR_STATIC_ASSERT(15 == kTexture2D_GrSLType);
-    GR_STATIC_ASSERT(16 == kSampler_GrSLType);
+    GR_STATIC_ASSERT(9 == kTexture2DISampler_GrSLType);
+    GR_STATIC_ASSERT(10 == kTextureExternalSampler_GrSLType);
+    GR_STATIC_ASSERT(11 == kTexture2DRectSampler_GrSLType);
+    GR_STATIC_ASSERT(12 == kTextureBufferSampler_GrSLType);
+    GR_STATIC_ASSERT(13 == kBool_GrSLType);
+    GR_STATIC_ASSERT(14 == kInt_GrSLType);
+    GR_STATIC_ASSERT(15 == kUint_GrSLType);
+    GR_STATIC_ASSERT(16 == kTexture2D_GrSLType);
+    GR_STATIC_ASSERT(17 == kSampler_GrSLType);
     GR_STATIC_ASSERT(SK_ARRAY_COUNT(kSizes) == kGrSLTypeCount);
 }