aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2016-10-10 11:26:43 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-10-10 15:47:05 +0000
commite75c19f6380dd07a19faa39edcdbd75c79c7414d (patch)
treec0cae14db9058b0425108bb957f94f3df1dbb906
parent1cebf7b4508ec8c6b258e7b0e53bed837c5676b2 (diff)
Update comment, move constant inside helper struct
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>
-rw-r--r--src/effects/gradients/SkGradientShaderPriv.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/effects/gradients/SkGradientShaderPriv.h b/src/effects/gradients/SkGradientShaderPriv.h
index bbc94907d8..d94363d466 100644
--- a/src/effects/gradients/SkGradientShaderPriv.h
+++ b/src/effects/gradients/SkGradientShaderPriv.h
@@ -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];