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

Side by Side Diff: include/ports/SkFontConfigInterface.h

Issue 1933393002: Move SkTypeface to sk_sp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments. Created 4 years, 7 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
OLDNEW
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
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) {
reed1 2016/05/01 18:53:52 Future plan to upgrade this API?
tomhudson 2016/05/02 12:26:08 D'oh, yes, sloppy of me to miss this.
bungeman-skia 2016/05/02 20:24:54 Done.
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698