aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleAnimator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'samplecode/SampleAnimator.cpp')
-rw-r--r--samplecode/SampleAnimator.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/samplecode/SampleAnimator.cpp b/samplecode/SampleAnimator.cpp
index d4a4cdd288..a3ec83afe6 100644
--- a/samplecode/SampleAnimator.cpp
+++ b/samplecode/SampleAnimator.cpp
@@ -12,6 +12,8 @@
#include "SkStream.h"
#include "SkDOM.h"
+#include <memory>
+
///////////////////////////////////////////////////////////////////////////////
class SkAnimatorView : public SkView {
@@ -50,8 +52,8 @@ void SkAnimatorView::setURIBase(const char dir[]) {
}
bool SkAnimatorView::decodeFile(const char path[]) {
- SkAutoTDelete<SkStream> is(SkStream::NewFromFile(path));
- return is.get() != nullptr && this->decodeStream(is);
+ std::unique_ptr<SkStream> is = SkStream::MakeFromFile(path);
+ return is && this->decodeStream(is.get());
}
bool SkAnimatorView::decodeMemory(const void* buffer, size_t size) {