From e75c19f6380dd07a19faa39edcdbd75c79c7414d Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Mon, 10 Oct 2016 11:26:43 -0400 Subject: 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 Commit-Queue: Brian Osman --- src/effects/gradients/SkGradientShaderPriv.h | 13 ++++++------- 1 file 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]; -- cgit v1.2.3