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

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

Issue 1873923002: Begin switch to SkFontStyle for legacy calls. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Dont update bzl file now. Created 4 years, 8 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
« no previous file with comments | « include/ports/SkFontConfigInterface.h ('k') | include/ports/SkFontMgr_indirect.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 SkFontMgr_DEFINED 8 #ifndef SkFontMgr_DEFINED
9 #define SkFontMgr_DEFINED 9 #define SkFontMgr_DEFINED
10 10
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 SkTypeface* createFromFontData(SkFontData*) const; 157 SkTypeface* createFromFontData(SkFontData*) const;
158 158
159 /** 159 /**
160 * Create a typeface for the specified fileName and TTC index 160 * Create a typeface for the specified fileName and TTC index
161 * (pass 0 for none) or NULL if the file is not found, or its contents are 161 * (pass 0 for none) or NULL if the file is not found, or its contents are
162 * not recognized. The caller must call unref() on the returned object 162 * not recognized. The caller must call unref() on the returned object
163 * if it is not null. 163 * if it is not null.
164 */ 164 */
165 SkTypeface* createFromFile(const char path[], int ttcIndex = 0) const; 165 SkTypeface* createFromFile(const char path[], int ttcIndex = 0) const;
166 166
167 SkTypeface* legacyCreateTypeface(const char familyName[], 167 #ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
168 unsigned typefaceStyleBits) const; 168 SkTypeface* legacyCreateTypeface(const char familyName[], unsigned typefaceS tyleBits) const;
169 #else
170 SkTypeface* legacyCreateTypeface(const char familyName[], SkFontStyle style) const;
171 #endif
169 172
170 /** 173 /**
171 * Return a ref to the default fontmgr. The caller must call unref() on 174 * Return a ref to the default fontmgr. The caller must call unref() on
172 * the returned object. 175 * the returned object.
173 */ 176 */
174 static SkFontMgr* RefDefault(); 177 static SkFontMgr* RefDefault();
175 178
176 protected: 179 protected:
177 virtual int onCountFamilies() const = 0; 180 virtual int onCountFamilies() const = 0;
178 virtual void onGetFamilyName(int index, SkString* familyName) const = 0; 181 virtual void onGetFamilyName(int index, SkString* familyName) const = 0;
(...skipping 10 matching lines...) Expand all
189 virtual SkTypeface* onMatchFaceStyle(const SkTypeface*, 192 virtual SkTypeface* onMatchFaceStyle(const SkTypeface*,
190 const SkFontStyle&) const = 0; 193 const SkFontStyle&) const = 0;
191 194
192 virtual SkTypeface* onCreateFromData(SkData*, int ttcIndex) const = 0; 195 virtual SkTypeface* onCreateFromData(SkData*, int ttcIndex) const = 0;
193 virtual SkTypeface* onCreateFromStream(SkStreamAsset*, int ttcIndex) const = 0; 196 virtual SkTypeface* onCreateFromStream(SkStreamAsset*, int ttcIndex) const = 0;
194 // TODO: make pure virtual. 197 // TODO: make pure virtual.
195 virtual SkTypeface* onCreateFromStream(SkStreamAsset*, const FontParameters& ) const; 198 virtual SkTypeface* onCreateFromStream(SkStreamAsset*, const FontParameters& ) const;
196 virtual SkTypeface* onCreateFromFontData(SkFontData*) const; 199 virtual SkTypeface* onCreateFromFontData(SkFontData*) const;
197 virtual SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const = 0; 200 virtual SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const = 0;
198 201
202 #ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
199 virtual SkTypeface* onLegacyCreateTypeface(const char familyName[], 203 virtual SkTypeface* onLegacyCreateTypeface(const char familyName[],
200 unsigned styleBits) const = 0; 204 unsigned styleBits) const = 0;
205 #else
206 virtual SkTypeface* onLegacyCreateTypeface(const char familyName[], SkFontSt yle) const = 0;
207 #endif
208
201 private: 209 private:
202 static SkFontMgr* Factory(); // implemented by porting layer 210 static SkFontMgr* Factory(); // implemented by porting layer
203 friend SkFontMgr* sk_fontmgr_create_default(); 211 friend SkFontMgr* sk_fontmgr_create_default();
204 212
205 typedef SkRefCnt INHERITED; 213 typedef SkRefCnt INHERITED;
206 }; 214 };
207 215
208 #endif 216 #endif
OLDNEW
« no previous file with comments | « include/ports/SkFontConfigInterface.h ('k') | include/ports/SkFontMgr_indirect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698