Chromium Code Reviews| 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 "SkThread.h" | |
| 15 #include "SkTypeface.h" | 16 #include "SkTypeface.h" |
| 16 | 17 |
| 17 /** | 18 /** |
| 18 * \class SkFontConfigInterface | 19 * \class SkFontConfigInterface |
| 19 * | 20 * |
| 20 * Provides SkFontHost clients with access to fontconfig services. They will | 21 * Provides SkFontHost clients with access to fontconfig services. They will |
| 21 * access the global instance found in RefGlobal(). | 22 * access the global instance found in RefGlobal(). |
| 22 */ | 23 */ |
| 23 class SK_API SkFontConfigInterface : public SkRefCnt { | 24 class SK_API SkFontConfigInterface : public SkRefCnt { |
| 24 public: | 25 public: |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 88 /** | 89 /** |
| 89 * Given a FontRef, open a stream to access its data, or return null | 90 * Given a FontRef, open a stream to access its data, or return null |
| 90 * if the FontRef's data is not available. The caller is responsible for | 91 * if the FontRef's data is not available. The caller is responsible for |
| 91 * calling stream->unref() when it is done accessing the data. | 92 * calling stream->unref() when it is done accessing the data. |
| 92 */ | 93 */ |
| 93 virtual SkStream* openStream(const FontIdentity&) = 0; | 94 virtual SkStream* openStream(const FontIdentity&) = 0; |
| 94 | 95 |
| 95 /** | 96 /** |
| 96 * Return a singleton instance of a direct subclass that calls into | 97 * Return a singleton instance of a direct subclass that calls into |
| 97 * libfontconfig. This does not affect the refcnt of the returned instance. | 98 * libfontconfig. This does not affect the refcnt of the returned instance. |
| 99 * The mutex may be used to guarantee the singleton is only constructed onc e. | |
| 98 */ | 100 */ |
| 99 static SkFontConfigInterface* GetSingletonDirectInterface(); | 101 static SkFontConfigInterface* GetSingletonDirectInterface(SkBaseMutex& mutex ); |
|
mtklein
2014/06/26 18:59:07
Would mildly prefer passing this as a pointer.
tomhudson
2014/06/26 21:01:52
I wish for pointers just to avoid the #include. I'
mtklein
2014/06/26 21:05:31
Just FYI, you can forward declare types used as re
| |
| 100 | 102 |
| 101 // New APIS, which have default impls for now (which do nothing) | 103 // New APIS, which have default impls for now (which do nothing) |
| 102 | 104 |
| 103 virtual SkDataTable* getFamilyNames() { return SkDataTable::NewEmpty(); } | 105 virtual SkDataTable* getFamilyNames() { return SkDataTable::NewEmpty(); } |
| 104 virtual bool matchFamilySet(const char inFamilyName[], | 106 virtual bool matchFamilySet(const char inFamilyName[], |
| 105 SkString* outFamilyName, | 107 SkString* outFamilyName, |
| 106 SkTArray<FontIdentity>*) { | 108 SkTArray<FontIdentity>*) { |
| 107 return false; | 109 return false; |
| 108 } | 110 } |
| 109 typedef SkRefCnt INHERITED; | 111 typedef SkRefCnt INHERITED; |
| 110 }; | 112 }; |
| 111 | 113 |
| 112 #endif | 114 #endif |
| OLD | NEW |