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

Side by Side Diff: src/ports/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/ports/SkFontMgr_custom.cpp ('k') | src/ports/SkFontMgr_win_dw.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 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 "SkFixed.h" 9 #include "SkFixed.h"
10 #include "SkFontDescriptor.h" 10 #include "SkFontDescriptor.h"
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 const int ttcIndex = fontData->getIndex(); 867 const int ttcIndex = fontData->getIndex();
868 SkFontStyle style; 868 SkFontStyle style;
869 bool isFixedWidth = false; 869 bool isFixedWidth = false;
870 if (!fScanner.scanFont(stream, ttcIndex, nullptr, &style, &isFixedWidth, nullptr)) { 870 if (!fScanner.scanFont(stream, ttcIndex, nullptr, &style, &isFixedWidth, nullptr)) {
871 return nullptr; 871 return nullptr;
872 } 872 }
873 873
874 return new SkTypeface_stream(fontData, style, isFixedWidth); 874 return new SkTypeface_stream(fontData, style, isFixedWidth);
875 } 875 }
876 876
877 #ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
878 SkTypeface* onLegacyCreateTypeface(const char familyName[], unsigned styleBi ts) const override {
879 SkFontStyle style = SkFontStyle::FromOldStyle(styleBits);
880 #else
881 SkTypeface* onLegacyCreateTypeface(const char familyName[], SkFontStyle styl e) const override { 877 SkTypeface* onLegacyCreateTypeface(const char familyName[], SkFontStyle styl e) const override {
882 #endif
883 SkAutoTUnref<SkTypeface> typeface(this->matchFamilyStyle(familyName, sty le)); 878 SkAutoTUnref<SkTypeface> typeface(this->matchFamilyStyle(familyName, sty le));
884 if (typeface.get()) { 879 if (typeface.get()) {
885 return typeface.release(); 880 return typeface.release();
886 } 881 }
887 882
888 return this->matchFamilyStyle(nullptr, style); 883 return this->matchFamilyStyle(nullptr, style);
889 } 884 }
890 }; 885 };
891 886
892 SK_API SkFontMgr* SkFontMgr_New_FontConfig(FcConfig* fc) { 887 SK_API SkFontMgr* SkFontMgr_New_FontConfig(FcConfig* fc) {
893 return new SkFontMgr_fontconfig(fc); 888 return new SkFontMgr_fontconfig(fc);
894 } 889 }
OLDNEW
« no previous file with comments | « src/ports/SkFontMgr_custom.cpp ('k') | src/ports/SkFontMgr_win_dw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698