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

Unified Diff: src/ports/SkFontConfigTypeface.h

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/pdf/SkPDFStream.cpp ('k') | src/ports/SkFontHost_FreeType.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontConfigTypeface.h
diff --git a/src/ports/SkFontConfigTypeface.h b/src/ports/SkFontConfigTypeface.h
index fcbc16f3c02cc7cc74452556a47d10fbc2ab6aed..821f4908d5997bf17abe1aa07f66afe9ba4c9484 100644
--- a/src/ports/SkFontConfigTypeface.h
+++ b/src/ports/SkFontConfigTypeface.h
@@ -15,7 +15,7 @@ class SkFontDescriptor;
class FontConfigTypeface : public SkTypeface_FreeType {
SkFontConfigInterface::FontIdentity fIdentity;
SkString fFamilyName;
- SkStream* fLocalStream;
+ SkAutoTDelete<SkStream> fLocalStream;
public:
static FontConfigTypeface* Create(const SkFontStyle& style,
@@ -29,16 +29,12 @@ public:
return SkNEW_ARGS(FontConfigTypeface, (style, fixedWidth, localStream));
}
- virtual ~FontConfigTypeface() {
- SkSafeUnref(fLocalStream);
- }
-
const SkFontConfigInterface::FontIdentity& getIdentity() const {
return fIdentity;
}
const char* getFamilyName() const { return fFamilyName.c_str(); }
- SkStream* getLocalStream() const { return fLocalStream; }
+ SkStream* getLocalStream() const { return fLocalStream.get(); }
bool isFamilyName(const char* name) const {
return fFamilyName.equals(name);
@@ -60,10 +56,9 @@ protected:
, fLocalStream(NULL) {}
FontConfigTypeface(const SkFontStyle& style, bool fixedWidth, SkStream* localStream)
- : INHERITED(style, SkTypefaceCache::NewFontID(), fixedWidth) {
+ : INHERITED(style, SkTypefaceCache::NewFontID(), fixedWidth)
+ , fLocalStream(localStream) {
// we default to empty fFamilyName and fIdentity
- fLocalStream = localStream;
- SkSafeRef(localStream);
}
void onGetFamilyName(SkString* familyName) const SK_OVERRIDE;
« no previous file with comments | « src/pdf/SkPDFStream.cpp ('k') | src/ports/SkFontHost_FreeType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698