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 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 virtual SkStreamAsset* openStream(const FontIdentity&) = 0; | 94 virtual SkStreamAsset* openStream(const FontIdentity&) = 0; |
| 95 | 95 |
| 96 /** | 96 /** |
| 97 * Return an SkTypeface for the given FontIdentity. | 97 * Return an SkTypeface for the given FontIdentity. |
| 98 * | 98 * |
| 99 * The default implementation simply returns a new typeface built using dat a obtained from | 99 * The default implementation simply returns a new typeface built using dat a obtained from |
| 100 * openStream(), but derived classes may implement more complex caching sch emes. | 100 * openStream(), but derived classes may implement more complex caching sch emes. |
| 101 * | 101 * |
| 102 * Callers are responsible for unref-ing the result. | 102 * Callers are responsible for unref-ing the result. |
| 103 */ | 103 */ |
| 104 virtual SkTypeface* createTypeface(const FontIdentity& identity) { | 104 virtual SkTypeface* createTypeface(const FontIdentity& identity) { |
|
tomhudson
2016/04/29 21:10:36
We can wait until a future patch to make this retu
bungeman-skia
2016/04/29 22:03:23
Acknowledged.
| |
| 105 return SkTypeface::CreateFromStream(this->openStream(identity), identity .fTTCIndex); | 105 return SkTypeface::MakeFromStream(this->openStream(identity), identity.f TTCIndex).release(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 /** | 108 /** |
| 109 * Return a singleton instance of a direct subclass that calls into | 109 * Return a singleton instance of a direct subclass that calls into |
| 110 * libfontconfig. This does not affect the refcnt of the returned instance. | 110 * libfontconfig. This does not affect the refcnt of the returned instance. |
| 111 * The mutex may be used to guarantee the singleton is only constructed onc e. | 111 * The mutex may be used to guarantee the singleton is only constructed onc e. |
| 112 */ | 112 */ |
| 113 static SkFontConfigInterface* GetSingletonDirectInterface(SkBaseMutex* mutex = NULL); | 113 static SkFontConfigInterface* GetSingletonDirectInterface(SkBaseMutex* mutex = NULL); |
| 114 | 114 |
| 115 // New APIS, which have default impls for now (which do nothing) | 115 // New APIS, which have default impls for now (which do nothing) |
| 116 | 116 |
| 117 virtual SkDataTable* getFamilyNames() { return SkDataTable::NewEmpty(); } | 117 virtual SkDataTable* getFamilyNames() { return SkDataTable::NewEmpty(); } |
| 118 typedef SkRefCnt INHERITED; | 118 typedef SkRefCnt INHERITED; |
| 119 }; | 119 }; |
| 120 | 120 |
| 121 #endif | 121 #endif |
| OLD | NEW |