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

Side by Side Diff: src/fonts/SkFontMgr_fontconfig.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/core/SkTypeface.cpp ('k') | src/fonts/SkFontMgr_indirect.cpp » ('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 #include "SkFontConfigInterface.h" 8 #include "SkFontConfigInterface.h"
9 #include "SkFontConfigTypeface.h" 9 #include "SkFontConfigTypeface.h"
10 #include "SkFontMgr.h" 10 #include "SkFontMgr.h"
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 311
312 SkTypeface* face = FontConfigTypeface::Create(style, isFixedWidth, strea m.release()); 312 SkTypeface* face = FontConfigTypeface::Create(style, isFixedWidth, strea m.release());
313 return face; 313 return face;
314 } 314 }
315 315
316 SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const override { 316 SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const override {
317 SkAutoTDelete<SkStreamAsset> stream(SkStream::NewFromFile(path)); 317 SkAutoTDelete<SkStreamAsset> stream(SkStream::NewFromFile(path));
318 return stream.get() ? this->createFromStream(stream.release(), ttcIndex) : nullptr; 318 return stream.get() ? this->createFromStream(stream.release(), ttcIndex) : nullptr;
319 } 319 }
320 320
321 #ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
322 SkTypeface* onLegacyCreateTypeface(const char familyName[], unsigned styleBi ts) const override {
323 SkTypeface::Style style = static_cast<SkTypeface::Style>(styleBits);
324 #else
325 SkTypeface* onLegacyCreateTypeface(const char familyName[], SkFontStyle styl e) const override { 321 SkTypeface* onLegacyCreateTypeface(const char familyName[], SkFontStyle styl e) const override {
326 #endif
327 FCLocker lock; 322 FCLocker lock;
328 return FontConfigTypeface::LegacyCreateTypeface(familyName, style); 323 return FontConfigTypeface::LegacyCreateTypeface(familyName, style);
329 } 324 }
330 }; 325 };
331 326
332 SkFontMgr* SkFontMgr::Factory() { 327 SkFontMgr* SkFontMgr::Factory() {
333 SkFontConfigInterface* fci = RefFCI(); 328 SkFontConfigInterface* fci = RefFCI();
334 return fci ? new SkFontMgr_fontconfig(fci) : nullptr; 329 return fci ? new SkFontMgr_fontconfig(fci) : nullptr;
335 } 330 }
OLDNEW
« no previous file with comments | « src/core/SkTypeface.cpp ('k') | src/fonts/SkFontMgr_indirect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698