Particles: remove non-stable random, add better enum reflection
The other generator was never used (or useful). String-based serialization
of enums is quite helpful, though.
Bug: skia:
Change-Id: Ic9d58f8d20cfe7aba47722bd74f1e6f8f0f219e5
Reviewed-on: https://skia-review.googlesource.com/c/195368
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/modules/particles/src/SkParticleEffect.cpp b/modules/particles/src/SkParticleEffect.cpp
index 922d364..5443548 100644
--- a/modules/particles/src/SkParticleEffect.cpp
+++ b/modules/particles/src/SkParticleEffect.cpp
@@ -68,7 +68,6 @@
SkParticleUpdateParams updateParams;
updateParams.fDeltaTime = deltaTime;
- updateParams.fRandom = &fRandom;
// Advance age for existing particles, and remove any that have reached their end of life
for (int i = 0; i < fCount; ++i) {
@@ -106,7 +105,7 @@
fParticles[fCount].fColor = { 1.0f, 1.0f, 1.0f, 1.0f };
fParticles[fCount].fFrame = 0.0f;
- fParticles[fCount].fStableRandom = fStableRandoms[fCount] = fRandom;
+ fParticles[fCount].fRandom = fStableRandoms[fCount] = fRandom;
fCount++;
}
@@ -123,7 +122,7 @@
// Restore all stable random generators so update affectors get consistent behavior each frame
for (int i = 0; i < fCount; ++i) {
- fParticles[i].fStableRandom = fStableRandoms[i];
+ fParticles[i].fRandom = fStableRandoms[i];
}
// Apply update rules