Half float vertex colors (when necessary) in small path renderer

Bug: skia:
Change-Id: I34fa12e8d7dbf003d4776df779967dd273228502
Reviewed-on: https://skia-review.googlesource.com/c/174302
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/src/gpu/GrGeometryProcessor.h b/src/gpu/GrGeometryProcessor.h
index a12ab00..f6d3ef5 100644
--- a/src/gpu/GrGeometryProcessor.h
+++ b/src/gpu/GrGeometryProcessor.h
@@ -39,6 +39,14 @@
         fSampleShading = sampleShading;
     }
 
+    // GPs that need to use either half-float or ubyte colors can just call this to get a correctly
+    // configured Attribute struct
+    static Attribute MakeColorAttribute(const char* name, bool wideColor) {
+        return { name,
+                 wideColor ? kHalf4_GrVertexAttribType : kUByte4_norm_GrVertexAttribType,
+                 kHalf4_GrSLType };
+    }
+
 private:
     bool fWillUseGeoShader;
     float fSampleShading;