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

Side by Side Diff: src/ports/SkFontMgr_android.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 unified diff | Download patch
« no previous file with comments | « src/ports/SkFontHost_win.cpp ('k') | src/ports/SkFontMgr_fontconfig.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkFontConfigParser_android.h" 8 #include "SkFontConfigParser_android.h"
9 #include "SkFontDescriptor.h" 9 #include "SkFontDescriptor.h"
10 #include "SkFontHost_FreeType_common.h" 10 #include "SkFontHost_FreeType_common.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 class SkTypeface_Android : public SkTypeface_FreeType { 42 class SkTypeface_Android : public SkTypeface_FreeType {
43 public: 43 public:
44 SkTypeface_Android(int index, 44 SkTypeface_Android(int index,
45 Style style, 45 Style style,
46 bool isFixedPitch, 46 bool isFixedPitch,
47 const SkString familyName) 47 const SkString familyName)
48 : INHERITED(style, SkTypefaceCache::NewFontID(), isFixedPitch) 48 : INHERITED(style, SkTypefaceCache::NewFontID(), isFixedPitch)
49 , fIndex(index) 49 , fIndex(index)
50 , fFamilyName(familyName) { } 50 , fFamilyName(familyName) { }
51 51
52 const SkString& name() const { return fFamilyName; } 52 protected:
53 virtual void onGetFamilyName(SkString* familyName) const SK_OVERRIDE {
54 *familyName = fFamilyName;
55 }
53 56
54 protected:
55 int fIndex; 57 int fIndex;
56 SkString fFamilyName; 58 SkString fFamilyName;
57 59
58 private: 60 private:
59 typedef SkTypeface_FreeType INHERITED; 61 typedef SkTypeface_FreeType INHERITED;
60 }; 62 };
61 63
62 class SkTypeface_AndroidSystem : public SkTypeface_Android { 64 class SkTypeface_AndroidSystem : public SkTypeface_Android {
63 public: 65 public:
64 SkTypeface_AndroidSystem(const SkString pathName, 66 SkTypeface_AndroidSystem(const SkString pathName,
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 SkDEBUGF(("Use Test Config File Main %s, Fallback %s, Font Dir %s", 529 SkDEBUGF(("Use Test Config File Main %s, Fallback %s, Font Dir %s",
528 gTestMainConfigFile, gTestFallbackConfigFile, gTestFontFilePrefix) ); 530 gTestMainConfigFile, gTestFallbackConfigFile, gTestFontFilePrefix) );
529 } 531 }
530 532
531 void SkGetTestFontConfiguration(const char** mainconf, const char** fallbackconf , 533 void SkGetTestFontConfiguration(const char** mainconf, const char** fallbackconf ,
532 const char** fontsdir) { 534 const char** fontsdir) {
533 *mainconf = gTestMainConfigFile; 535 *mainconf = gTestMainConfigFile;
534 *fallbackconf = gTestFallbackConfigFile; 536 *fallbackconf = gTestFallbackConfigFile;
535 *fontsdir = gTestFontFilePrefix; 537 *fontsdir = gTestFontFilePrefix;
536 } 538 }
OLDNEW
« no previous file with comments | « src/ports/SkFontHost_win.cpp ('k') | src/ports/SkFontMgr_fontconfig.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698