[skottie] Parse animations on the fly in SkottieSrc::draw
This allows DM to use the same source in multiple threads.
Change-Id: Ia0d7c4c673a92ccddab263a67f01afaa2d68b606
Reviewed-on: https://skia-review.googlesource.com/144420
Auto-Submit: Florin Malita <fmalita@chromium.org>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
diff --git a/dm/DMSrcSink.h b/dm/DMSrcSink.h
index d42c186..257ca8b 100644
--- a/dm/DMSrcSink.h
+++ b/dm/DMSrcSink.h
@@ -21,8 +21,6 @@
//#define TEST_VIA_SVG
-namespace skottie { class Animation; }
-
namespace DM {
// This is just convenience. It lets you use either return "foo" or return SkStringPrintf(...).
@@ -265,9 +263,11 @@
// Generates a kTileCount x kTileCount filmstrip with evenly distributed frames.
static constexpr int kTileCount = 5;
- Name fName;
- SkISize fTileSize = SkISize::MakeEmpty();
- sk_sp<skottie::Animation> fAnimation;
+ // Fit kTileCount x kTileCount frames to a 1000x1000 film strip.
+ static constexpr SkScalar kTargetSize = 1000;
+ static constexpr SkScalar kTileSize = kTargetSize / kTileCount;
+
+ Path fPath;
};
#endif