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

Unified Diff: src/core/SkTypeface.cpp

Issue 574873002: Add onGetFamilyName to SkTypeface. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add .get() for DirectWrite. Created 6 years, 3 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 | « include/core/SkTypeface.h ('k') | src/fonts/SkGScalerContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkTypeface.cpp
diff --git a/src/core/SkTypeface.cpp b/src/core/SkTypeface.cpp
index fcb2b8e2b13ae7d7430cb9863ff47a9f4a0bf650..74dd5d96b91cb67ff7b92f0417baca0a8e179bea 100644
--- a/src/core/SkTypeface.cpp
+++ b/src/core/SkTypeface.cpp
@@ -67,6 +67,9 @@ protected:
public:
virtual bool next(SkTypeface::LocalizedString*) SK_OVERRIDE { return false; }
};
+ virtual void onGetFamilyName(SkString* familyName) const SK_OVERRIDE {
+ familyName->reset();
+ }
virtual SkTypeface::LocalizedStrings* onCreateFamilyNameIterator() const SK_OVERRIDE {
return SkNEW(EmptyLocalizedStrings);
};
@@ -273,10 +276,8 @@ SkTypeface::LocalizedStrings* SkTypeface::createFamilyNameIterator() const {
}
void SkTypeface::getFamilyName(SkString* name) const {
- bool isLocal = false;
- SkFontDescriptor desc(this->style());
- this->onGetFontDescriptor(&desc, &isLocal);
- name->set(desc.getFamilyName());
+ SkASSERT(name);
+ this->onGetFamilyName(name);
}
SkAdvancedTypefaceMetrics* SkTypeface::getAdvancedTypefaceMetrics(
« no previous file with comments | « include/core/SkTypeface.h ('k') | src/fonts/SkGScalerContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698