OLD | NEW |
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 #ifndef SkFontMgr_indirect_DEFINED | 8 #ifndef SkFontMgr_indirect_DEFINED |
9 #define SkFontMgr_indirect_DEFINED | 9 #define SkFontMgr_indirect_DEFINED |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 class SK_API SkFontMgr_Indirect : public SkFontMgr { | 23 class SK_API SkFontMgr_Indirect : public SkFontMgr { |
24 public: | 24 public: |
25 // TODO: The SkFontMgr is only used for createFromStream/File/Data. | 25 // TODO: The SkFontMgr is only used for createFromStream/File/Data. |
26 // In the future these calls should be broken out into their own interface | 26 // In the future these calls should be broken out into their own interface |
27 // with a name like SkFontRenderer. | 27 // with a name like SkFontRenderer. |
28 SkFontMgr_Indirect(SkFontMgr* impl, SkRemotableFontMgr* proxy) | 28 SkFontMgr_Indirect(SkFontMgr* impl, SkRemotableFontMgr* proxy) |
29 : fImpl(SkRef(impl)), fProxy(SkRef(proxy)), fFamilyNamesInited(false) | 29 : fImpl(SkRef(impl)), fProxy(SkRef(proxy)), fFamilyNamesInited(false) |
30 { } | 30 { } |
31 | 31 |
32 protected: | 32 protected: |
33 int onCountFamilies() const SK_OVERRIDE; | 33 int onCountFamilies() const override; |
34 void onGetFamilyName(int index, SkString* familyName) const SK_OVERRIDE; | 34 void onGetFamilyName(int index, SkString* familyName) const override; |
35 SkFontStyleSet* onCreateStyleSet(int index) const SK_OVERRIDE; | 35 SkFontStyleSet* onCreateStyleSet(int index) const override; |
36 | 36 |
37 SkFontStyleSet* onMatchFamily(const char familyName[]) const SK_OVERRIDE; | 37 SkFontStyleSet* onMatchFamily(const char familyName[]) const override; |
38 | 38 |
39 virtual SkTypeface* onMatchFamilyStyle(const char familyName[], | 39 virtual SkTypeface* onMatchFamilyStyle(const char familyName[], |
40 const SkFontStyle& fontStyle) const S
K_OVERRIDE; | 40 const SkFontStyle& fontStyle) const o
verride; |
41 | 41 |
42 virtual SkTypeface* onMatchFamilyStyleCharacter(const char familyName[], | 42 virtual SkTypeface* onMatchFamilyStyleCharacter(const char familyName[], |
43 const SkFontStyle&, | 43 const SkFontStyle&, |
44 const char* bcp47[], | 44 const char* bcp47[], |
45 int bcp47Count, | 45 int bcp47Count, |
46 SkUnichar character) const S
K_OVERRIDE; | 46 SkUnichar character) const o
verride; |
47 | 47 |
48 virtual SkTypeface* onMatchFaceStyle(const SkTypeface* familyMember, | 48 virtual SkTypeface* onMatchFaceStyle(const SkTypeface* familyMember, |
49 const SkFontStyle& fontStyle) const SK_
OVERRIDE; | 49 const SkFontStyle& fontStyle) const ove
rride; |
50 | 50 |
51 SkTypeface* onCreateFromStream(SkStreamAsset* stream, int ttcIndex) const SK
_OVERRIDE; | 51 SkTypeface* onCreateFromStream(SkStreamAsset* stream, int ttcIndex) const ov
erride; |
52 SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const SK_OVERR
IDE; | 52 SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const override
; |
53 SkTypeface* onCreateFromData(SkData* data, int ttcIndex) const SK_OVERRIDE; | 53 SkTypeface* onCreateFromData(SkData* data, int ttcIndex) const override; |
54 | 54 |
55 virtual SkTypeface* onLegacyCreateTypeface(const char familyName[], | 55 virtual SkTypeface* onLegacyCreateTypeface(const char familyName[], |
56 unsigned styleBits) const SK_OVER
RIDE; | 56 unsigned styleBits) const overrid
e; |
57 | 57 |
58 private: | 58 private: |
59 SkTypeface* createTypefaceFromFontId(const SkFontIdentity& fontId) const; | 59 SkTypeface* createTypefaceFromFontId(const SkFontIdentity& fontId) const; |
60 | 60 |
61 SkAutoTUnref<SkFontMgr> fImpl; | 61 SkAutoTUnref<SkFontMgr> fImpl; |
62 SkAutoTUnref<SkRemotableFontMgr> fProxy; | 62 SkAutoTUnref<SkRemotableFontMgr> fProxy; |
63 | 63 |
64 struct DataEntry { | 64 struct DataEntry { |
65 uint32_t fDataId; // key1 | 65 uint32_t fDataId; // key1 |
66 uint32_t fTtcIndex; // key2 | 66 uint32_t fTtcIndex; // key2 |
(...skipping 29 matching lines...) Expand all Loading... |
96 | 96 |
97 mutable SkAutoTUnref<SkDataTable> fFamilyNames; | 97 mutable SkAutoTUnref<SkDataTable> fFamilyNames; |
98 mutable bool fFamilyNamesInited; | 98 mutable bool fFamilyNamesInited; |
99 mutable SkMutex fFamilyNamesMutex; | 99 mutable SkMutex fFamilyNamesMutex; |
100 static void set_up_family_names(const SkFontMgr_Indirect* self); | 100 static void set_up_family_names(const SkFontMgr_Indirect* self); |
101 | 101 |
102 friend class SkStyleSet_Indirect; | 102 friend class SkStyleSet_Indirect; |
103 }; | 103 }; |
104 | 104 |
105 #endif | 105 #endif |
OLD | NEW |