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

Unified Diff: samplecode/SampleAnimator.cpp

Issue 849103004: Make SkStream *not* ref counted. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase, just in case. Created 5 years, 11 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 50b61bad93fe2a5992a516deb7e3a4099280795d..a7cc8851ea462bcac0353846f89a0a31060ab44d 100644
--- a/samplecode/SampleAnimator.cpp
+++ b/samplecode/SampleAnimator.cpp
@@ -51,15 +51,13 @@ void SkAnimatorView::setURIBase(const char dir[]) {
}
bool SkAnimatorView::decodeFile(const char path[]) {
- SkFILEStream* is = new SkFILEStream(path);
- SkAutoUnref aur(is);
- return is->isValid() && this->decodeStream(is);
+ SkAutoTDelete<SkStream> is(SkStream::NewFromFile(path));
+ return is.get() != NULL && this->decodeStream(is);
}
bool SkAnimatorView::decodeMemory(const void* buffer, size_t size) {
- SkMemoryStream* is = new SkMemoryStream(buffer, size);
- SkAutoUnref aur(is);
- return this->decodeStream(is);
+ SkMemoryStream is(buffer, size);
+ return this->decodeStream(&is);
}
static const SkDOMNode* find_nodeID(const SkDOM& dom,
« 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