Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(891)

Unified Diff: samplecode/SampleAnimator.cpp

Issue 2339273002: SkFontData to use smart pointers. (Closed)
Patch Set: Add trivial bodies to the trivial implementations. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/utils/mac/SkCGUtils.h ('k') | src/animator/SkAnimateMaker.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleAnimator.cpp
diff --git a/samplecode/SampleAnimator.cpp b/samplecode/SampleAnimator.cpp
index d4a4cdd2887f150c405310f742b67f65c9ec494e..a3ec83afe673968e45d09a91824eb8552e8ce1de 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) {
« no previous file with comments | « include/utils/mac/SkCGUtils.h ('k') | src/animator/SkAnimateMaker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698