diff options
author | 2018-01-08 12:51:12 -0500 | |
---|---|---|
committer | 2018-01-08 18:11:31 +0000 | |
commit | 493280782430b76251145cfb7d78d6d33b65c1d1 (patch) | |
tree | 14973ee0898f4b193664a34e16c551a846509bbd /tools | |
parent | 7b7d9b374d62c4be5d439a3a1dd761b9ef4b3052 (diff) |
[skotty,sksg] Initial image support
TBR=
Change-Id: Ib3c918b1d746e4f190ae05708681f2d5519afdb2
Reviewed-on: https://skia-review.googlesource.com/91980
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/viewer/SkottySlide.cpp | 4 | ||||
-rw-r--r-- | tools/viewer/SkottySlide2.cpp | 6 |
2 files changed, 3 insertions, 7 deletions
diff --git a/tools/viewer/SkottySlide.cpp b/tools/viewer/SkottySlide.cpp index 6e3608c904..a26acf6172 100644 --- a/tools/viewer/SkottySlide.cpp +++ b/tools/viewer/SkottySlide.cpp @@ -10,7 +10,6 @@ #include "SkAnimTimer.h" #include "SkCanvas.h" #include "Skotty.h" -#include "SkStream.h" SkottySlide::SkottySlide(const SkString& name, const SkString& path) : fPath(path) { @@ -18,8 +17,7 @@ SkottySlide::SkottySlide(const SkString& name, const SkString& path) } void SkottySlide::load(SkScalar, SkScalar) { - auto stream = SkStream::MakeFromFile(fPath.c_str()); - fAnimation = skotty::Animation::Make(stream.get()); + fAnimation = skotty::Animation::MakeFromFile(fPath.c_str()); fTimeBase = 0; // force a time reset if (fAnimation) { diff --git a/tools/viewer/SkottySlide2.cpp b/tools/viewer/SkottySlide2.cpp index 7e76693a9a..180c7ad411 100644 --- a/tools/viewer/SkottySlide2.cpp +++ b/tools/viewer/SkottySlide2.cpp @@ -42,10 +42,8 @@ void SkottySlide2::load(SkScalar, SkScalar) { SkOSFile::Iter iter(fPath.c_str(), "json"); while (iter.next(&name)) { SkString path = SkOSPath::Join(fPath.c_str(), name.c_str()); - if (auto stream = SkStream::MakeFromFile(path.c_str())) { - if (auto anim = skotty::Animation::Make(stream.get())) { - fAnims.push_back(Rec(std::move(anim))).fName = name; - } + if (auto anim = skotty::Animation::MakeFromFile(path.c_str())) { + fAnims.push_back(Rec(std::move(anim))).fName = name; } } } |