diff options
author | Florin Malita <fmalita@chromium.org> | 2017-12-31 11:08:42 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-31 18:44:29 +0000 |
commit | fc043dcd552d293fc4d0da61562e3a7b755a640a (patch) | |
tree | 145a7df4e1549acbb3974f08de238714bb2564fb /dm/DMSrcSink.h | |
parent | a99d982e0d1f90e6aa26843773b445dcfa243b42 (diff) |
[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 <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'dm/DMSrcSink.h')
-rw-r--r-- | dm/DMSrcSink.h | 20 |
1 files changed, 20 insertions, 0 deletions
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<skotty::Animation> fAnimation; +}; + #if defined(SK_XML) } // namespace DM |