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

Unified Diff: tools/sk_tool_utils_font.cpp

Issue 1818043002: SkTypeface::MakeFromName to take SkFontStyle. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Android fix + nit fix Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/sk_tool_utils.cpp ('k') | tools/test_font_index.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/sk_tool_utils_font.cpp
diff --git a/tools/sk_tool_utils_font.cpp b/tools/sk_tool_utils_font.cpp
index f73576dbf6eb079ad1c34cc8ccadbff60245fd3b..8f701c2f21dcd27b7d4f32cacd08a745b3ad378f 100644
--- a/tools/sk_tool_utils_font.cpp
+++ b/tools/sk_tool_utils_font.cpp
@@ -29,7 +29,7 @@ void release_portable_typefaces() {
SK_DECLARE_STATIC_MUTEX(gTestFontMutex);
-sk_sp<SkTypeface> create_font(const char* name, SkTypeface::Style style) {
+sk_sp<SkTypeface> create_font(const char* name, SkFontStyle style) {
SkTestFontData* fontData = nullptr;
const SubFont* sub;
if (name) {
@@ -47,8 +47,7 @@ sk_sp<SkTypeface> create_font(const char* name, SkTypeface::Style style) {
// If we called SkTypeface::CreateFromName() here we'd recurse infinitely,
// so we reimplement its core logic here inline without the recursive aspect.
SkAutoTUnref<SkFontMgr> fm(SkFontMgr::RefDefault());
- return sk_sp<SkTypeface>(fm->legacyCreateTypeface(name,
- SkFontStyle::FromOldStyle(style)));
+ return sk_sp<SkTypeface>(fm->legacyCreateTypeface(name, style));
}
} else {
sub = &gSubFonts[gDefaultFontIndex];
@@ -66,7 +65,7 @@ sk_sp<SkTypeface> create_font(const char* name, SkTypeface::Style style) {
fontData->fFontCache = SkSafeRef(font);
}
}
- return sk_make_sp<SkTestTypeface>(font, SkFontStyle::FromOldStyle(style));
+ return sk_make_sp<SkTestTypeface>(font, style);
}
}
« no previous file with comments | « tools/sk_tool_utils.cpp ('k') | tools/test_font_index.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698