[skotty] De-templatize the Animator apply function

We can use a raw function pointer.

TBR=
Change-Id: I66d19ed563171dc314c862b35c3c98d462337f18
Reviewed-on: https://skia-review.googlesource.com/91461
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
diff --git a/experimental/skotty/Skotty.cpp b/experimental/skotty/Skotty.cpp
index 3635c2c..8c48d1f 100644
--- a/experimental/skotty/Skotty.cpp
+++ b/experimental/skotty/Skotty.cpp
@@ -53,9 +53,9 @@
 
 // This is the workhorse for binding properties: depending on whether the property is animated,
 // it will either apply immediately or instantiate and attach a keyframe animator.
-template <typename ValueT, typename AttrT, typename NodeT, typename ApplyFuncT>
+template <typename ValueT, typename AttrT, typename NodeT>
 bool AttachProperty(const Json::Value& jprop, AttachContext* ctx, const sk_sp<NodeT>& node,
-                    ApplyFuncT&& apply) {
+                    typename Animator<ValueT, AttrT, NodeT>::ApplyFuncT&& apply) {
     if (!jprop.isObject())
         return false;
 
@@ -102,15 +102,15 @@
                 node->setScale(s);
             });
     auto rotation_attached = AttachProperty<ScalarValue, SkScalar>(t["r"], ctx, composite,
-            [](const sk_sp<CompositeTransform>& node, SkScalar r) {
+            [](const sk_sp<CompositeTransform>& node, const SkScalar& r) {
                 node->setRotation(r);
             });
     auto skew_attached = AttachProperty<ScalarValue, SkScalar>(t["sk"], ctx, composite,
-            [](const sk_sp<CompositeTransform>& node, SkScalar sk) {
+            [](const sk_sp<CompositeTransform>& node, const SkScalar& sk) {
                 node->setSkew(sk);
             });
     auto skewaxis_attached = AttachProperty<ScalarValue, SkScalar>(t["sa"], ctx, composite,
-            [](const sk_sp<CompositeTransform>& node, SkScalar sa) {
+            [](const sk_sp<CompositeTransform>& node, const SkScalar& sa) {
                 node->setSkewAxis(sa);
             });
 
@@ -160,7 +160,7 @@
     auto s_attached = AttachProperty<VectorValue, SkSize>(jrect["s"], ctx, composite,
             [](const sk_sp<CompositeRRect>& node, const SkSize& sz) { node->setSize(sz); });
     auto r_attached = AttachProperty<ScalarValue, SkScalar>(jrect["r"], ctx, composite,
-            [](const sk_sp<CompositeRRect>& node, SkScalar radius) {
+            [](const sk_sp<CompositeRRect>& node, const SkScalar& radius) {
                 node->setRadius(SkSize::Make(radius, radius));
             });
 
@@ -216,17 +216,23 @@
     AttachProperty<VectorValue, SkPoint>(jstar["p"], ctx, composite,
         [](const sk_sp<CompositePolyStar>& node, const SkPoint& p) { node->setPosition(p); });
     AttachProperty<ScalarValue, SkScalar>(jstar["pt"], ctx, composite,
-        [](const sk_sp<CompositePolyStar>& node, SkScalar pt) { node->setPointCount(pt); });
+        [](const sk_sp<CompositePolyStar>& node, const SkScalar& pt) { node->setPointCount(pt); });
     AttachProperty<ScalarValue, SkScalar>(jstar["ir"], ctx, composite,
-        [](const sk_sp<CompositePolyStar>& node, SkScalar ir) { node->setInnerRadius(ir); });
+        [](const sk_sp<CompositePolyStar>& node, const SkScalar& ir) { node->setInnerRadius(ir); });
     AttachProperty<ScalarValue, SkScalar>(jstar["or"], ctx, composite,
-        [](const sk_sp<CompositePolyStar>& node, SkScalar otr) { node->setOuterRadius(otr); });
+        [](const sk_sp<CompositePolyStar>& node, const SkScalar& otr) {
+            node->setOuterRadius(otr);
+        });
     AttachProperty<ScalarValue, SkScalar>(jstar["is"], ctx, composite,
-        [](const sk_sp<CompositePolyStar>& node, SkScalar is) { node->setInnerRoundness(is); });
+        [](const sk_sp<CompositePolyStar>& node, const SkScalar& is) {
+            node->setInnerRoundness(is);
+        });
     AttachProperty<ScalarValue, SkScalar>(jstar["os"], ctx, composite,
-        [](const sk_sp<CompositePolyStar>& node, SkScalar os) { node->setOuterRoundness(os); });
+        [](const sk_sp<CompositePolyStar>& node, const SkScalar& os) {
+            node->setOuterRoundness(os);
+        });
     AttachProperty<ScalarValue, SkScalar>(jstar["r"], ctx, composite,
-        [](const sk_sp<CompositePolyStar>& node, SkScalar r) { node->setRotation(r); });
+        [](const sk_sp<CompositePolyStar>& node, const SkScalar& r) { node->setRotation(r); });
 
     return path_node;
 }
@@ -238,7 +244,7 @@
     color_node->setAntiAlias(true);
 
     auto color_attached = AttachProperty<VectorValue, SkColor>(obj["c"], ctx, color_node,
-        [](const sk_sp<sksg::Color>& node, SkColor c) { node->setColor(c); });
+        [](const sk_sp<sksg::Color>& node, const SkColor& c) { node->setColor(c); });
 
     return color_attached ? color_node : nullptr;
 }
@@ -265,7 +271,7 @@
     stroke_node->setStyle(SkPaint::kStroke_Style);
 
     auto width_attached = AttachProperty<ScalarValue, SkScalar>(jstroke["w"], ctx, stroke_node,
-        [](const sk_sp<sksg::Color>& node, SkScalar width) { node->setStrokeWidth(width); });
+        [](const sk_sp<sksg::Color>& node, const SkScalar& width) { node->setStrokeWidth(width); });
     if (!width_attached)
         return nullptr;