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

Unified Diff: src/ports/SkFontMgr_android.cpp

Issue 447003002: Fix reference counting on SkStream in SkFontMgr_android. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontMgr_android.cpp
diff --git a/src/ports/SkFontMgr_android.cpp b/src/ports/SkFontMgr_android.cpp
index 31b5346a10686a1e0955cfdc1183e3f7ba2f15a8..1ab2f29642a1147be1bc0404e43faf951f3af113 100644
--- a/src/ports/SkFontMgr_android.cpp
+++ b/src/ports/SkFontMgr_android.cpp
@@ -95,7 +95,7 @@ public:
bool isFixedPitch,
const SkString familyName)
: INHERITED(index, style, isFixedPitch, familyName)
- , fStream(stream) { }
+ , fStream(SkRef(stream)) { }
virtual void onGetFontDescriptor(SkFontDescriptor* desc,
bool* serialize) const SK_OVERRIDE {
@@ -382,16 +382,14 @@ protected:
return stream.get() ? this->createFromStream(stream, ttcIndex) : NULL;
}
- virtual SkTypeface* onCreateFromStream(SkStream* s, int ttcIndex) const SK_OVERRIDE {
- SkAutoTUnref<SkStream> stream(s);
-
+ virtual SkTypeface* onCreateFromStream(SkStream* stream, int ttcIndex) const SK_OVERRIDE {
bool isFixedPitch;
SkTypeface::Style style;
SkString name;
if (!SkTypeface_FreeType::ScanFont(stream, ttcIndex, &name, &style, &isFixedPitch)) {
return NULL;
}
- return SkNEW_ARGS(SkTypeface_AndroidStream, (stream.detach(), ttcIndex,
+ return SkNEW_ARGS(SkTypeface_AndroidStream, (stream, ttcIndex,
style, isFixedPitch, name));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698