aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2014-08-06 13:20:59 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-06 13:21:00 -0700
commit8560cd5396f8902322471b49ac33aa849659228e (patch)
tree095fa2ff1d96e968f2859fe3e9d068d70e69cf19
parentb5f7826c51af2862aebcabe61e1ba684f925e488 (diff)
Fix reference counting on SkStream in SkFontMgr_android.
R=tomhudson@google.com Author: bungeman@google.com Review URL: https://codereview.chromium.org/447003002
-rw-r--r--src/ports/SkFontMgr_android.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/ports/SkFontMgr_android.cpp b/src/ports/SkFontMgr_android.cpp
index 31b5346a10..1ab2f29642 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));
}