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

Unified Diff: src/ports/SkFontHost_win.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/ports/SkFontHost_linux.cpp ('k') | src/ports/SkFontMgr_android.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontHost_win.cpp
diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp
index 1ec2bb5cf85922fcc09730cce40bf513a87a9282..70f3ddfdf8a38f2e55c243e703c1e913b31d3a9b 100755
--- a/src/ports/SkFontHost_win.cpp
+++ b/src/ports/SkFontHost_win.cpp
@@ -1924,6 +1924,7 @@ static HANDLE activate_font(SkData* fontData) {
return fontHandle;
}
+// Does not affect ownership of stream.
static SkTypeface* create_from_stream(SkStream* stream) {
// Create a unique and unpredictable font name.
// Avoids collisions and access from CSS.
@@ -2481,19 +2482,18 @@ protected:
}
SkTypeface* onCreateFromStream(SkStream* stream, int ttcIndex) const SK_OVERRIDE {
+ SkAutoTDelete<SkStream> streamDeleter(stream);
return create_from_stream(stream);
}
SkTypeface* onCreateFromData(SkData* data, int ttcIndex) const SK_OVERRIDE {
// could be in base impl
- SkAutoTUnref<SkStream> stream(SkNEW_ARGS(SkMemoryStream, (data)));
- return this->createFromStream(stream);
+ return this->createFromStream(SkNEW_ARGS(SkMemoryStream, (data)));
}
SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const SK_OVERRIDE {
// could be in base impl
- SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(path));
- return this->createFromStream(stream);
+ return this->createFromStream(SkStream::NewFromFile(path));
}
virtual SkTypeface* onLegacyCreateTypeface(const char familyName[],
« no previous file with comments | « src/ports/SkFontHost_linux.cpp ('k') | src/ports/SkFontMgr_android.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698