diff options
author | 2018-01-02 15:33:18 -0500 | |
---|---|---|
committer | 2018-01-02 22:24:31 +0000 | |
commit | 9e73f885c7937c8ce8ba51b240cbfa4c13dbe4cf (patch) | |
tree | d7c694f9473ea7a1c2747b436a81f4218d98cc28 /experimental/skotty/SkottyProperties.h | |
parent | f7ae6e4dbbe2ae4536dbac13fa26b168268d7730 (diff) |
[skotty] Native SkPath interpolation
SkPath supports interpolation, no reason to handle that explicitly in
Skotty.
Change skotty::ShapeValue to convert to SkPaths upfront, when parsing,
and then rely in native interpolation.
TBR=
Change-Id: I32d424ea359e0736909d4e51602ffeb14403feed
Reviewed-on: https://skia-review.googlesource.com/90362
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'experimental/skotty/SkottyProperties.h')
-rw-r--r-- | experimental/skotty/SkottyProperties.h | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/experimental/skotty/SkottyProperties.h b/experimental/skotty/SkottyProperties.h index e1504747b4..990862f195 100644 --- a/experimental/skotty/SkottyProperties.h +++ b/experimental/skotty/SkottyProperties.h @@ -8,6 +8,7 @@ #ifndef SkottyProperties_DEFINED #define SkottyProperties_DEFINED +#include "SkPath.h" #include "SkPoint.h" #include "SkSize.h" #include "SkottyPriv.h" @@ -27,12 +28,6 @@ class Transform; namespace skotty { -struct BezierVertex { - SkPoint fInPoint, // "in" control point, relative to the vertex - fOutPoint, // "out" control point, relative to the vertex - fVertex; -}; - struct ScalarValue { float fVal; @@ -73,8 +68,7 @@ struct VectorValue { }; struct ShapeValue { - SkTArray<BezierVertex, true> fVertices; - bool fClose = false; + SkPath fPath; ShapeValue() = default; ShapeValue(const ShapeValue&) = delete; @@ -83,7 +77,7 @@ struct ShapeValue { static bool Parse(const Json::Value&, ShapeValue*); - size_t cardinality() const { return SkTo<size_t>(fVertices.count()); } + size_t cardinality() const { return SkTo<size_t>(fPath.countVerbs()); } template <typename T> T as() const; |