diff options
author | benjaminwagner <benjaminwagner@google.com> | 2016-03-31 06:13:22 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-31 06:13:22 -0700 |
commit | 1263448196dec4a5b601dabeb56b5fb24c1d72fa (patch) | |
tree | 7ec519c1f0cf54a1f18a939fc399c21914a4ccba /include/utils/SkRandom.h | |
parent | cce19c821ce0a76886078c6df24fba57fd2f12de (diff) |
Make SkRandom::next[US]Fixed1 private; update documentation for SkRandom::nextSScalar1.
SkRandom is unused in Chromium, Android, Mozilla, and Google3.
SkRandom::nextSScalar1 and LCGRandom::nextSScalar1 appear to me by inspection to potentially return -1, so I updated the documentation to match.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1846773002
Review URL: https://codereview.chromium.org/1846773002
Diffstat (limited to 'include/utils/SkRandom.h')
-rw-r--r-- | include/utils/SkRandom.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/include/utils/SkRandom.h b/include/utils/SkRandom.h index aee2d7a0aa..ecaedafc2f 100644 --- a/include/utils/SkRandom.h +++ b/include/utils/SkRandom.h @@ -97,16 +97,6 @@ public: return this->nextRangeU(0, count - 1); } - /** Return the next pseudo random number expressed as an unsigned SkFixed - in the range [0..SK_Fixed1). - */ - SkFixed nextUFixed1() { return this->nextU() >> 16; } - - /** Return the next pseudo random number expressed as a signed SkFixed - in the range (-SK_Fixed1..SK_Fixed1). - */ - SkFixed nextSFixed1() { return this->nextS() >> 15; } - /** Return the next pseudo random number expressed as a SkScalar in the range [0..SK_Scalar1). */ @@ -120,7 +110,7 @@ public: } /** Return the next pseudo random number expressed as a SkScalar - in the range (-SK_Scalar1..SK_Scalar1). + in the range [-SK_Scalar1..SK_Scalar1). */ SkScalar nextSScalar1() { return SkFixedToScalar(this->nextSFixed1()); } @@ -164,6 +154,16 @@ private: } static uint32_t NextLCG(uint32_t seed) { return kMul*seed + kAdd; } + /** Return the next pseudo random number expressed as an unsigned SkFixed + in the range [0..SK_Fixed1). + */ + SkFixed nextUFixed1() { return this->nextU() >> 16; } + + /** Return the next pseudo random number expressed as a signed SkFixed + in the range [-SK_Fixed1..SK_Fixed1). + */ + SkFixed nextSFixed1() { return this->nextS() >> 15; } + // See "Numerical Recipes in C", 1992 page 284 for these constants // For the LCG that sets the initial state from a seed enum { |