22 float evaluate(
float t)
override {
return 7.0f; }
27 std::vector<float>
evaluate(
float t)
override {
return {0.1f, 0.2f, 0.3f, 1.0f}; }
38 const char expression[])
override {
39 return sk_make_sp<FakeScalarExpressionEvaluator>();
43 const char expression[])
override {
44 return sk_make_sp<FakeStringExpressionEvaluator>();
48 const char expression[])
override {
49 return sk_make_sp<FakeVectorExpressionEvaluator>();
56 const LazyHandle<OpacityPropertyHandle>& opacity_handle)
override {
57 opacity_handle_ = opacity_handle();
61 const LazyHandle<TransformPropertyHandle>& transform_handle)
override {
62 transform_handle_ = transform_handle();
66 const LazyHandle<ColorPropertyHandle>& color_handle)
override {
67 color_handle_ = color_handle();
71 const LazyHandle<TextPropertyHandle>& text_handle)
override {
72 text_handle_ = text_handle();
75 std::unique_ptr<OpacityPropertyHandle> opacity_handle_;
76 std::unique_ptr<TransformPropertyHandle> transform_handle_;
77 std::unique_ptr<ColorPropertyHandle> color_handle_;
78 std::unique_ptr<TextPropertyHandle> text_handle_;
83 static constexpr char json[] =
103 "x": "fake; return value is specified by the FakeScalarExpressionEvaluator."
129 "x": "fake; return value is specified by the FakeArrayExpressionEvaluator."
154 "mn": "ADBE Fill-0001",
165 "mn": "ADBE Fill-0007",
176 "mn": "ADBE Fill-0002",
187 "x": "fake; return value is specified by the FakeArrayExpressionEvaluator."
193 "mn": "ADBE Fill-0006",
203 "nm": "Horizontal Feather",
204 "mn": "ADBE Fill-0003",
214 "nm": "Vertical Feather",
215 "mn": "ADBE Fill-0004",
226 "mn": "ADBE Fill-0005",
249 auto em = sk_make_sp<FakeExpressionManager>();
250 auto observer = sk_make_sp<FakePropertyObserver>();
253 .setExpressionManager(em)
255 .setPropertyObserver(observer)
260 anim->seekFrameTime(0);
263 SkPoint anchor_point = observer->transform_handle_->get().fAnchorPoint;
269DEF_TEST(Skottie_ExpressionText, r) {
270 static constexpr char text_json[] =
304 "t":"will be replaced.",
324 "x": "fake; return value is specified by the FakeStringExpressionEvaluator."
336 "nm":"skottie_animation",
340 "fName": "Helvetica",
341 "fFamily":"external_font_family",
350 auto em = sk_make_sp<FakeExpressionManager>();
351 auto observer = sk_make_sp<FakePropertyObserver>();
354 .setExpressionManager(em)
356 .setPropertyObserver(observer)
361 anim->seekFrameTime(0);
DEF_TEST(Skottie_Expression, r)
static bool SkScalarNearlyEqual(SkScalar x, SkScalar y, SkScalar tolerance=SK_ScalarNearlyZero)
#define REPORTER_ASSERT(r, cond,...)
virtual T evaluate(float t)=0
virtual sk_sp< ExpressionEvaluator< std::vector< float > > > createArrayExpressionEvaluator(const char expression[])=0
virtual sk_sp< ExpressionEvaluator< SkString > > createStringExpressionEvaluator(const char expression[])=0
virtual sk_sp< ExpressionEvaluator< float > > createNumberExpressionEvaluator(const char expression[])=0
virtual void onTransformProperty(const char node_name[], const LazyHandle< TransformPropertyHandle > &)
virtual void onOpacityProperty(const char node_name[], const LazyHandle< OpacityPropertyHandle > &)
virtual void onTextProperty(const char node_name[], const LazyHandle< TextPropertyHandle > &)
virtual void onColorProperty(const char node_name[], const LazyHandle< ColorPropertyHandle > &)
DlVertices::Builder Builder