From fc043dcd552d293fc4d0da61562e3a7b755a640a Mon Sep 17 00:00:00 2001 From: Florin Malita Date: Sun, 31 Dec 2017 11:08:42 -0500 Subject: [skotty] Add Json DM source Generates a filmstrip with evenly distributed frames for a Skotty animation. TBR= Change-Id: Ia89e0d65d59fd5ab4ef221a231e9b3e0c033828a Reviewed-on: https://skia-review.googlesource.com/90025 Reviewed-by: Florin Malita Commit-Queue: Florin Malita --- dm/DMSrcSink.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'dm/DMSrcSink.h') diff --git a/dm/DMSrcSink.h b/dm/DMSrcSink.h index 3f3c8b2892..67128ead06 100644 --- a/dm/DMSrcSink.h +++ b/dm/DMSrcSink.h @@ -21,6 +21,8 @@ //#define TEST_VIA_SVG +namespace skotty { class Animation; } + namespace DM { // This is just convenience. It lets you use either return "foo" or return SkStringPrintf(...). @@ -260,6 +262,24 @@ private: Path fPath; }; +class SkottySrc final : public Src { +public: + explicit SkottySrc(Path path); + + Error draw(SkCanvas*) const override; + SkISize size() const override; + Name name() const override; + bool veto(SinkFlags) const override; + +private: + // Generates a kTileCount x kTileCount filmstrip with evenly distributed frames. + static constexpr int kTileCount = 5; + + Name fName; + SkISize fTileSize = SkISize::MakeEmpty(); + std::unique_ptr fAnimation; +}; + #if defined(SK_XML) } // namespace DM -- cgit v1.2.3