aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/skotty/Skotty.h
diff options
context:
space:
mode:
Diffstat (limited to 'experimental/skotty/Skotty.h')
-rw-r--r--experimental/skotty/Skotty.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/experimental/skotty/Skotty.h b/experimental/skotty/Skotty.h
index d02dc8d3ab..ebd103d60c 100644
--- a/experimental/skotty/Skotty.h
+++ b/experimental/skotty/Skotty.h
@@ -29,9 +29,18 @@ namespace skotty {
class AnimatorBase;
+class ResourceProvider : public SkNoncopyable {
+public:
+ virtual ~ResourceProvider() = default;
+
+ virtual std::unique_ptr<SkStream> openStream(const char resource[]) const = 0;
+};
+
class Animation : public SkNoncopyable {
public:
- static std::unique_ptr<Animation> Make(SkStream*);
+ static std::unique_ptr<Animation> Make(SkStream*, const ResourceProvider&);
+ static std::unique_ptr<Animation> MakeFromFile(const char path[],
+ const ResourceProvider* = nullptr);
~Animation();
@@ -48,7 +57,9 @@ public:
void setShowInval(bool show) { fShowInval = show; }
private:
- Animation(SkString ver, const SkSize& size, SkScalar fps, const Json::Value&);
+ Animation(const ResourceProvider&,
+ SkString ver, const SkSize& size, SkScalar fps,
+ const Json::Value&);
SkString fVersion;
SkSize fSize;