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

Side by Side Diff: src/fonts/SkFontMgr_indirect.cpp

Issue 1882803002: Remove SK_VERY_LEGACY_CREATE_TYPEFACE. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « src/fonts/SkFontMgr_fontconfig.cpp ('k') | src/ports/SkFontConfigInterface_direct.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 2014 Google Inc. 2 * Copyright 2014 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 #include "SkDataTable.h" 8 #include "SkDataTable.h"
9 #include "SkFontMgr.h" 9 #include "SkFontMgr.h"
10 #include "SkFontMgr_indirect.h" 10 #include "SkFontMgr_indirect.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 } 177 }
178 178
179 SkTypeface* SkFontMgr_Indirect::onCreateFromFile(const char path[], int ttcIndex ) const { 179 SkTypeface* SkFontMgr_Indirect::onCreateFromFile(const char path[], int ttcIndex ) const {
180 return fImpl->createFromFile(path, ttcIndex); 180 return fImpl->createFromFile(path, ttcIndex);
181 } 181 }
182 182
183 SkTypeface* SkFontMgr_Indirect::onCreateFromData(SkData* data, int ttcIndex) con st { 183 SkTypeface* SkFontMgr_Indirect::onCreateFromData(SkData* data, int ttcIndex) con st {
184 return fImpl->createFromData(data, ttcIndex); 184 return fImpl->createFromData(data, ttcIndex);
185 } 185 }
186 186
187 #ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
188 SkTypeface* SkFontMgr_Indirect::onLegacyCreateTypeface(const char familyName[],
189 unsigned styleBits) const {
190 SkFontStyle style = SkFontStyle::FromOldStyle(styleBits);
191 #else
192 SkTypeface* SkFontMgr_Indirect::onLegacyCreateTypeface(const char familyName[], 187 SkTypeface* SkFontMgr_Indirect::onLegacyCreateTypeface(const char familyName[],
193 SkFontStyle style) const { 188 SkFontStyle style) const {
194 #endif
195 SkAutoTUnref<SkTypeface> face(this->matchFamilyStyle(familyName, style)); 189 SkAutoTUnref<SkTypeface> face(this->matchFamilyStyle(familyName, style));
196 190
197 if (nullptr == face.get()) { 191 if (nullptr == face.get()) {
198 face.reset(this->matchFamilyStyle(nullptr, style)); 192 face.reset(this->matchFamilyStyle(nullptr, style));
199 } 193 }
200 194
201 if (nullptr == face.get()) { 195 if (nullptr == face.get()) {
202 SkFontIdentity fontId = this->fProxy->matchIndexStyle(0, style); 196 SkFontIdentity fontId = this->fProxy->matchIndexStyle(0, style);
203 face.reset(this->createTypefaceFromFontId(fontId)); 197 face.reset(this->createTypefaceFromFontId(fontId));
204 } 198 }
205 199
206 return face.release(); 200 return face.release();
207 } 201 }
OLDNEW
« no previous file with comments | « src/fonts/SkFontMgr_fontconfig.cpp ('k') | src/ports/SkFontConfigInterface_direct.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698