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

Unified Diff: src/fonts/SkFontMgr_fontconfig.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 | « src/device/xps/SkXPSDevice.cpp ('k') | src/fonts/SkFontMgr_indirect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/fonts/SkFontMgr_fontconfig.cpp
diff --git a/src/fonts/SkFontMgr_fontconfig.cpp b/src/fonts/SkFontMgr_fontconfig.cpp
index a3989fca75cdfc39c260c75f4ddf5d981f10feb3..c1d531d3f5348cd7a621de9ec1919cdb41010945 100644
--- a/src/fonts/SkFontMgr_fontconfig.cpp
+++ b/src/fonts/SkFontMgr_fontconfig.cpp
@@ -296,6 +296,7 @@ protected:
SkTypeface* onCreateFromData(SkData*, int ttcIndex) const SK_OVERRIDE { return NULL; }
SkTypeface* onCreateFromStream(SkStream* stream, int ttcIndex) const SK_OVERRIDE {
+ SkAutoTDelete<SkStream> streamDeleter(stream);
const size_t length = stream->getLength();
if (!length) {
return NULL;
@@ -311,13 +312,13 @@ protected:
return NULL;
}
- SkTypeface* face = FontConfigTypeface::Create(style, isFixedWidth, stream);
+ SkTypeface* face = FontConfigTypeface::Create(style, isFixedWidth, streamDeleter.detach());
return face;
}
SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const SK_OVERRIDE {
- SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(path));
- return stream.get() ? this->createFromStream(stream, ttcIndex) : NULL;
+ SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(path));
+ return stream.get() ? this->createFromStream(stream.detach(), ttcIndex) : NULL;
}
virtual SkTypeface* onLegacyCreateTypeface(const char familyName[],
« no previous file with comments | « src/device/xps/SkXPSDevice.cpp ('k') | src/fonts/SkFontMgr_indirect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698