diff options
-rw-r--r-- | src/effects/gradients/SkGradientShaderPriv.h | 13 |
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]; |