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

Unified Diff: src/core/SkFontDescriptor.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/animator/SkDrawBitmap.cpp ('k') | src/core/SkFontMgr.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkFontDescriptor.h
diff --git a/src/core/SkFontDescriptor.h b/src/core/SkFontDescriptor.h
index 5a6ddd5e414ae6bc2d05ee1553530ce478b25ee5..aafbe84decc9415363f0cfc400b39e0fbdcdb810 100644
--- a/src/core/SkFontDescriptor.h
+++ b/src/core/SkFontDescriptor.h
@@ -12,11 +12,10 @@
#include "SkString.h"
#include "SkTypeface.h"
-class SkWStream;
-
class SkFontDescriptor {
public:
SkFontDescriptor(SkTypeface::Style = SkTypeface::kNormal);
+ // Does not affect ownership of SkStream.
SkFontDescriptor(SkStream*);
void serialize(SkWStream*);
@@ -28,7 +27,9 @@ public:
const char* getFullName() const { return fFullName.c_str(); }
const char* getPostscriptName() const { return fPostscriptName.c_str(); }
const char* getFontFileName() const { return fFontFileName.c_str(); }
- SkStream* getFontData() const { return fFontData; }
+ bool hasFontData() const { return fFontData.get() != NULL; }
+ // Transfers ownership to the caller.
+ SkStream* transferFontData() { return fFontData.detach(); }
int getFontIndex() const { return fFontIndex; }
void setFamilyName(const char* name) { fFamilyName.set(name); }
@@ -46,7 +47,7 @@ private:
SkString fFullName;
SkString fPostscriptName;
SkString fFontFileName;
- SkAutoTUnref<SkStream> fFontData;
+ SkAutoTDelete<SkStream> fFontData;
int fFontIndex;
SkTypeface::Style fStyle;
« no previous file with comments | « src/animator/SkDrawBitmap.cpp ('k') | src/core/SkFontMgr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698