Make SkGpuDevice::drawVertices perform color byte order swap and premul step using vertex shader.

Change-Id: I8153ba8c6bb48d8b15d524fbfafbe3c6d83f39c5
Reviewed-on: https://skia-review.googlesource.com/7727
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/include/gpu/GrRenderTargetContext.h b/include/gpu/GrRenderTargetContext.h
index 3056449..040e896 100644
--- a/include/gpu/GrRenderTargetContext.h
+++ b/include/gpu/GrRenderTargetContext.h
@@ -195,6 +195,10 @@
                   const SkPath&,
                   const GrStyle& style);
 
+    enum class ColorArrayType {
+        kPremulGrColor,
+        kSkColor,
+    };
     /**
      * Draws vertices with a paint.
      *
@@ -211,6 +215,7 @@
      *                          are drawn non-indexed.
      * @param   indexCount      if indices is non-null then this is the
      *                          number of indices.
+     * @param   ColorArrayType  Determines how the color array should be interpreted.
      */
     void drawVertices(const GrClip&,
                       GrPaint&& paint,
@@ -219,9 +224,10 @@
                       int vertexCount,
                       const SkPoint positions[],
                       const SkPoint texs[],
-                      const GrColor colors[],
+                      const uint32_t colors[],
                       const uint16_t indices[],
-                      int indexCount);
+                      int indexCount,
+                      ColorArrayType = ColorArrayType::kPremulGrColor);
 
     /**
      * Draws textured sprites from an atlas with a paint. This currently does not support AA for the