diff options
author | 2016-05-31 11:42:36 -0700 | |
---|---|---|
committer | 2016-05-31 11:42:37 -0700 | |
commit | ee6a9919a362e16c1d84a870ce867d1ad7b8a141 (patch) | |
tree | 971189523fe82821c82a936cafaefd59b76338f7 /tools/sk_tool_utils_font.cpp | |
parent | bfa9275968d11d459b30a485cedcb55c7fecf9d7 (diff) |
SkTypeface::MakeFromName to take SkFontStyle.
SkTypeface::MakeFromName currently takes SkTypeface::Style,
which is quite limited. This starts the transition to this
function taking SkFontStyle instead.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1818043002
TBR=reed
He said it sounded like a good idea.
Review-Url: https://codereview.chromium.org/1818043002
Diffstat (limited to 'tools/sk_tool_utils_font.cpp')
-rw-r--r-- | tools/sk_tool_utils_font.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/sk_tool_utils_font.cpp b/tools/sk_tool_utils_font.cpp index f73576dbf6..8f701c2f21 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); } } |