OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 SkFontConfigInterface_DEFINED | 8 #ifndef SkFontConfigInterface_DEFINED |
9 #define SkFontConfigInterface_DEFINED | 9 #define SkFontConfigInterface_DEFINED |
10 | 10 |
11 #include "SkDataTable.h" | 11 #include "SkDataTable.h" |
12 #include "SkFontStyle.h" | 12 #include "SkFontStyle.h" |
13 #include "SkRefCnt.h" | 13 #include "SkRefCnt.h" |
14 #include "SkTArray.h" | 14 #include "SkTArray.h" |
15 #include "SkTypeface.h" | 15 #include "SkTypeface.h" |
16 | 16 |
17 struct SkBaseMutex; | 17 struct SkBaseMutex; |
18 | 18 |
19 /** | 19 /** |
20 * \class SkFontConfigInterface | 20 * \class SkFontConfigInterface |
21 * | 21 * |
22 * Provides SkFontHost clients with access to fontconfig services. They will | 22 * A simple interface for remotable font management. |
23 * access the global instance found in RefGlobal(). | 23 * The global instance can be found with RefGlobal(). |
24 */ | 24 */ |
25 class SK_API SkFontConfigInterface : public SkRefCnt { | 25 class SK_API SkFontConfigInterface : public SkRefCnt { |
26 public: | 26 public: |
27 SK_DECLARE_INST_COUNT(SkFontConfigInterface) | 27 SK_DECLARE_INST_COUNT(SkFontConfigInterface) |
28 | 28 |
29 /** | 29 /** |
30 * Returns the global SkFontConfigInterface instance, and if it is not | 30 * Returns the global SkFontConfigInterface instance, and if it is not |
31 * NULL, calls ref() on it. The caller must balance this with a call to | 31 * NULL, calls ref() on it. The caller must balance this with a call to |
32 * unref(). | 32 * unref(). |
33 */ | 33 */ |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 * if the FontRef's data is not available. The caller is responsible for | 92 * if the FontRef's data is not available. The caller is responsible for |
93 * deleting the stream when it is done accessing the data. | 93 * deleting the stream when it is done accessing the data. |
94 */ | 94 */ |
95 virtual SkStreamAsset* openStream(const FontIdentity&) = 0; | 95 virtual SkStreamAsset* openStream(const FontIdentity&) = 0; |
96 | 96 |
97 /** | 97 /** |
98 * Return a singleton instance of a direct subclass that calls into | 98 * Return a singleton instance of a direct subclass that calls into |
99 * libfontconfig. This does not affect the refcnt of the returned instance. | 99 * libfontconfig. This does not affect the refcnt of the returned instance. |
100 * The mutex may be used to guarantee the singleton is only constructed onc
e. | 100 * The mutex may be used to guarantee the singleton is only constructed onc
e. |
101 */ | 101 */ |
102 static SkFontConfigInterface* GetSingletonDirectInterface | 102 static SkFontConfigInterface* GetSingletonDirectInterface(SkBaseMutex* mutex
= NULL); |
103 (SkBaseMutex* mutex = NULL); | |
104 | 103 |
105 // New APIS, which have default impls for now (which do nothing) | 104 // New APIS, which have default impls for now (which do nothing) |
106 | 105 |
107 virtual SkDataTable* getFamilyNames() { return SkDataTable::NewEmpty(); } | 106 virtual SkDataTable* getFamilyNames() { return SkDataTable::NewEmpty(); } |
108 virtual bool matchFamilySet(const char[] /*inFamilyName*/, | 107 virtual bool matchFamilySet(const char[] /*inFamilyName*/, |
109 SkString* /*outFamilyName*/, | 108 SkString* /*outFamilyName*/, |
110 SkTArray<FontIdentity>*) { | 109 SkTArray<FontIdentity>*) { |
111 return false; | 110 return false; |
112 } | 111 } |
113 typedef SkRefCnt INHERITED; | 112 typedef SkRefCnt INHERITED; |
114 }; | 113 }; |
115 | 114 |
116 #endif | 115 #endif |
OLD | NEW |