25 explicit MockProperty(
const char* jprop) {
26 AnimationBuilder abuilder(
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
28 {100, 100}, 10, 1, 0);
31 fDidBind = this->
bind(abuilder, json_dom.root(), &fValue);
34 explicit operator bool()
const {
return fDidBind; }
36 const T& operator()(
float t) { this->
seek(t);
return fValue; }
49 MockProperty<ScalarValue>
prop(R
"({})");
53 MockProperty<ScalarValue> prop(R"({ "a": 1, "k": [] })");
58 MockProperty<ScalarValue>
prop(R
"({
79 MockProperty<ScalarValue>
prop(R
"({
82 { "t": 1, "s": 1, "h": true },
83 { "t": 2, "s": 2, "h": true },
84 { "t": 3, "s": 4, "h": true }
101 MockProperty<ScalarValue>
prop(R
"({
104 { "t": 1, "s": 1, "e": 2 },
105 { "t": 2, "s": 2, "e": 4 },
122 MockProperty<ScalarValue>
prop(R
"({
125 { "t": 1, "s": 1, "e": 2, "h": true },
126 { "t": 2, "s": 2, "e": 4, "h": true },
144 MockProperty<ScalarValue>
prop(R
"({
147 { "t": 1, "s": 42, "e": 42 },
148 { "t": 2, "s": 42, "e": 42 },
158 MockProperty<Vec2Value>
prop(R
"({
161 { "t": 1, "s": [4,2], "e": [4,2] },
162 { "t": 2, "s": [4,2], "e": [4,2] },
174 MockProperty<Vec2Value>
prop(R
"({
177 { "t": 0, "s": [100,100],
178 "o":{"x":[0.5], "y":[-0.5]}, "i":{"x":[0.5], "y":[1.5]},
179 "to": [10,15], "ti": [-10,-5]
181 { "t": 1, "s": [200,200]
DEF_TEST(Skottie_Keyframe, reporter)
static bool SkScalarNearlyEqual(SkScalar x, SkScalar y, SkScalar tolerance=SK_ScalarNearlyZero)
#define REPORTER_ASSERT(r, cond,...)
bool bind(const AnimationBuilder &, const skjson::ObjectValue *, T *)
StateChanged seek(float t)
static SkScalar prop(SkScalar radius, SkScalar newSize, SkScalar oldSize)