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

Unified Diff: include/utils/SkRandom.h

Issue 23576015: Change old PRG to be SkLCGRandom; change new one to SkRandom (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix some spurious SkMWCRandoms Created 7 years, 3 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 | « include/gpu/GrEffectUnitTest.h ('k') | samplecode/SampleAnimBlur.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 3e2ef201ad42ddbde6daf5b3846afd8149180c3b..eeaa701c6ec64bf209e11bd3c5aecbd09c3ea570 100644
--- a/include/utils/SkRandom.h
+++ b/include/utils/SkRandom.h
@@ -13,16 +13,16 @@
#include "Sk64.h"
#include "SkScalar.h"
-/** \class SkRandom
+/** \class SkLCGRandom
Utility class that implements pseudo random 32bit numbers using a fast
linear equation. Unlike rand(), this class holds its own seed (initially
set to 0), so that multiple instances can be used with no side-effects.
*/
-class SkRandom {
+class SkLCGRandom {
public:
- SkRandom() : fSeed(0) {}
- SkRandom(uint32_t seed) : fSeed(seed) {}
+ SkLCGRandom() : fSeed(0) {}
+ SkLCGRandom(uint32_t seed) : fSeed(seed) {}
/** Return the next pseudo random number as an unsigned 32bit value.
*/
@@ -151,7 +151,7 @@ private:
uint32_t fSeed;
};
-/** \class SkMWCRandom
+/** \class SkRandom
Utility class that implements pseudo random 32bit numbers using Marsaglia's
multiply-with-carry "mother of all" algorithm. Unlike rand(), this class holds
@@ -159,13 +159,13 @@ private:
Has a large period and all bits are well-randomized.
*/
-class SkMWCRandom {
+class SkRandom {
public:
- SkMWCRandom() { init(0); }
- SkMWCRandom(uint32_t seed) { init(seed); }
- SkMWCRandom(const SkMWCRandom& rand) : fK(rand.fK), fJ(rand.fJ) {}
+ SkRandom() { init(0); }
+ SkRandom(uint32_t seed) { init(seed); }
+ SkRandom(const SkRandom& rand) : fK(rand.fK), fJ(rand.fJ) {}
- SkMWCRandom& operator=(const SkMWCRandom& rand) {
+ SkRandom& operator=(const SkRandom& rand) {
fK = rand.fK;
fJ = rand.fJ;
« no previous file with comments | « include/gpu/GrEffectUnitTest.h ('k') | samplecode/SampleAnimBlur.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698