Add SkParticleValue to allow further customization of curve behavior

All curves (and path affectors) are driven by an SkParticleValue. The
value can derive its value from the current defaults (age of particle
or effect), or explicitly choose the other one, a random value, or any
other particle value. Values can be range adjusted and support repeat,
clamp, and mirror tiling.

Also fixed some more issues related to resource path in the slide GUI.

Bug: skia:
Change-Id: I4755018d5b57ae2d5ec400d541055ca4fb542978
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196760
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/modules/particles/include/SkCurve.h b/modules/particles/include/SkCurve.h
index 076a1aa..044c0f4 100644
--- a/modules/particles/include/SkCurve.h
+++ b/modules/particles/include/SkCurve.h
@@ -9,6 +9,7 @@
 #define SkCurve_DEFINED
 
 #include "SkColor.h"
+#include "SkParticleData.h"
 #include "SkScalar.h"
 #include "SkTArray.h"
 
@@ -73,10 +74,12 @@
         fSegments.push_back().setConstant(c);
     }
 
-    // Evaluate this curve at x, using random for curves that have ranged or bidirectional segments.
-    SkScalar eval(SkScalar x, SkRandom& random) const;
+    SkScalar eval(const SkParticleUpdateParams& params, SkParticleState& ps) const;
     void visitFields(SkFieldVisitor* v);
 
+    // Parameters that determine our x-value during evaluation
+    SkParticleValue                fInput;
+
     // It should always be true that (fXValues.count() + 1) == fSegments.count()
     SkTArray<SkScalar, true>       fXValues;
     SkTArray<SkCurveSegment, true> fSegments;
@@ -96,7 +99,7 @@
         }
     }
 
-    SkColor4f eval(SkScalar x, SkRandom& random) const;
+    SkColor4f eval(SkScalar x, SkScalar t) const;
     void visitFields(SkFieldVisitor* v);
 
     void setConstant(SkColor4f c) {
@@ -117,9 +120,10 @@
         fSegments.push_back().setConstant(c);
     }
 
-    SkColor4f eval(SkScalar x, SkRandom& random) const;
+    SkColor4f eval(const SkParticleUpdateParams& params, SkParticleState& ps) const;
     void visitFields(SkFieldVisitor* v);
 
+    SkParticleValue                     fInput;
     SkTArray<SkScalar, true>            fXValues;
     SkTArray<SkColorCurveSegment, true> fSegments;
 };