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

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

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 | « 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 SkTypeface* onLegacyCreateTypeface(const char familyName[], 321 #ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
322 unsigned styleBits) const override { 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 {
326 #endif
323 FCLocker lock; 327 FCLocker lock;
324 return FontConfigTypeface::LegacyCreateTypeface(familyName, (SkTypeface: :Style)styleBits); 328 return FontConfigTypeface::LegacyCreateTypeface(familyName, style);
325 } 329 }
326 }; 330 };
327 331
328 SkFontMgr* SkFontMgr::Factory() { 332 SkFontMgr* SkFontMgr::Factory() {
329 SkFontConfigInterface* fci = RefFCI(); 333 SkFontConfigInterface* fci = RefFCI();
330 return fci ? new SkFontMgr_fontconfig(fci) : nullptr; 334 return fci ? new SkFontMgr_fontconfig(fci) : nullptr;
331 } 335 }
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