Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Unified Diff: include/utils/SkRandom.h

Issue 1846773002: Make SkRandom::next[US]Fixed1 private; update documentation for SkRandom::nextSScalar1. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bench/GrMemoryPoolBench.cpp ('k') | src/effects/SkDiscretePathEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/utils/SkRandom.h
diff --git a/include/utils/SkRandom.h b/include/utils/SkRandom.h
index aee2d7a0aaef057d03f557ccada28b1f7ad8fa96..ecaedafc2fc051817d982c52c9332f6e8a261544 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 {
« no previous file with comments | « bench/GrMemoryPoolBench.cpp ('k') | src/effects/SkDiscretePathEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698