Update comment, move constant inside helper struct
authorBrian Osman <brianosman@google.com>
Mon, 10 Oct 2016 15:26:43 +0000 (11:26 -0400)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Mon, 10 Oct 2016 15:47:05 +0000 (15:47 +0000)
BUG=skia:

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

Change-Id: Ife8a2434ff591bd77be1cd0fbcce50430e18c86c
Reviewed-on: https://skia-review.googlesource.com/3109
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>

src/effects/gradients/SkGradientShaderPriv.h

index bbc9490..d94363d 100644 (file)
@@ -400,15 +400,14 @@ public:
     }
 
 protected:
-    /** Populates a pair of arrays with colors and stop info to construct a random gradient.
-        The function decides whether stop values should be used or not. The return value indicates
-        the number of colors, which will be capped by kMaxRandomGradientColors. colors should be
-        sized to be at least kMaxRandomGradientColors. stops is a pointer to an array of at least
-        size kMaxRandomGradientColors. It may be updated to nullptr, indicating that nullptr should
-        be passed to the gradient factory rather than the array.
+    /** Helper struct that stores (and populates) parameters to construct a random gradient.
+        The constructor decides whether stop values should be used or not (fStops may be nullptr
+        after construction). fColorCount will be the number of color stops, and fColors and fStops
+        can be passed to the gradient factory.
     */
-    static const int kMaxRandomGradientColors = 4;
     struct RandomGradientParams {
+        static const int kMaxRandomGradientColors = 4;
+
         RandomGradientParams(SkRandom* r);
 
         SkColor fColors[kMaxRandomGradientColors];