Particles: Improvements to SkCurve
Added explicit Linear segment type, merge math evaluation helpers for
scalar and color curves. Add logic to visitFields that cuts down on the
serialized size of simple curves, and makes the GUI easier to work with.
Remove the curve plot from the GUI. It was incorrect (wrong points at
cubic handle locations), not terribly helpful, and difficult to
maintain.
Bug: skia:
Change-Id: I190cb5d118b1f4b910984e4df50ee3351c8be895
Reviewed-on: https://skia-review.googlesource.com/c/195884
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/resources/particles/snowfall.json b/resources/particles/snowfall.json
index aa8b0bb..843e65f 100644
--- a/resources/particles/snowfall.json
+++ b/resources/particles/snowfall.json
@@ -6,17 +6,10 @@
"XValues": [],
"Segments": [
{
- "Constant": true,
+ "Type": "Constant",
"Ranged": false,
"Bidirectional": false,
- "A0": 10,
- "B0": 0,
- "C0": 0,
- "D0": 0,
- "A1": 0,
- "B1": 0,
- "C1": 0,
- "D1": 0
+ "A0": 10
}
]
},
@@ -39,17 +32,11 @@
"XValues": [],
"Segments": [
{
- "Constant": true,
+ "Type": "Constant",
"Ranged": true,
"Bidirectional": false,
"A0": 170,
- "B0": 1,
- "C0": 0,
- "D0": 0,
- "A1": 190,
- "B1": 0,
- "C1": 0,
- "D1": 0
+ "A1": 190
}
]
},
@@ -57,17 +44,11 @@
"XValues": [],
"Segments": [
{
- "Constant": true,
+ "Type": "Constant",
"Ranged": true,
"Bidirectional": false,
"A0": 10,
- "B0": 0,
- "C0": 0,
- "D0": 0,
- "A1": 30,
- "B1": 0,
- "C1": 0,
- "D1": 0
+ "A1": 30
}
]
}
@@ -81,7 +62,7 @@
"XValues": [],
"Segments": [
{
- "Constant": false,
+ "Type": "Cubic",
"Ranged": true,
"Bidirectional": false,
"A0": 10,