Simplify GrGradientEffect color handling

For analytic gradients, hoist the byte -> float, premultiplication,
and color space transformation to creation time. Eliminates second
array (only one was ever used), and four different onSetData helpers.

Bug: skia:
Change-Id: Ib5740b37ef2a5dcf2551e85b1e72f64d8cbcc5fa
Reviewed-on: https://skia-review.googlesource.com/62120
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/shaders/gradients/SkGradientShaderPriv.h b/src/shaders/gradients/SkGradientShaderPriv.h
index 0abfd35..da9098c 100644
--- a/src/shaders/gradients/SkGradientShaderPriv.h
+++ b/src/shaders/gradients/SkGradientShaderPriv.h
@@ -402,13 +402,7 @@
 
     PremulType getPremulType() const { return fPremulType; }
 
-    const SkColor* getColors(int pos) const {
-        SkASSERT(fColorType != kTexture_ColorType);
-        SkASSERT(pos < fColors.count());
-        return &fColors[pos];
-    }
-
-    const SkColor4f* getColors4f(int pos) const {
+    const GrColor4f* getColors4f(int pos) const {
         SkASSERT(fColorType != kTexture_ColorType);
         SkASSERT(pos < fColors4f.count());
         return &fColors4f[pos];
@@ -453,11 +447,9 @@
 private:
     static OptimizationFlags OptFlags(bool isOpaque);
 
-    // If we're in legacy mode, then fColors will be populated. If we're gamma-correct, then
-    // fColors4f and fColorSpaceXform will be populated.
-    SkTDArray<SkColor> fColors;
+    SkTDArray<GrColor4f> fColors4f;
 
-    SkTDArray<SkColor4f> fColors4f;
+    // Only present if a color space transformation is needed
     sk_sp<GrColorSpaceXform> fColorSpaceXform;
 
     SkTDArray<SkScalar> fPositions;