aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/SkGlyphCacheBench.cpp
diff options
context:
space:
mode:
authorGravatar mboc <mboc@opera.com>2016-05-31 11:42:36 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-05-31 11:42:37 -0700
commitee6a9919a362e16c1d84a870ce867d1ad7b8a141 (patch)
tree971189523fe82821c82a936cafaefd59b76338f7 /bench/SkGlyphCacheBench.cpp
parentbfa9275968d11d459b30a485cedcb55c7fecf9d7 (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 'bench/SkGlyphCacheBench.cpp')
-rw-r--r--bench/SkGlyphCacheBench.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/bench/SkGlyphCacheBench.cpp b/bench/SkGlyphCacheBench.cpp
index c5e40af746..4d43a611d4 100644
--- a/bench/SkGlyphCacheBench.cpp
+++ b/bench/SkGlyphCacheBench.cpp
@@ -56,7 +56,8 @@ protected:
SkPaint paint;
paint.setAntiAlias(true);
paint.setSubpixelText(true);
- paint.setTypeface(sk_tool_utils::create_portable_typeface("serif", SkTypeface::kItalic));
+ paint.setTypeface(sk_tool_utils::create_portable_typeface(
+ "serif", SkFontStyle::FromOldStyle(SkTypeface::kItalic)));
for (int work = 0; work < loops; work++) {
do_font_stuff(&paint);
@@ -88,8 +89,10 @@ protected:
size_t oldCacheLimitSize = SkGraphics::GetFontCacheLimit();
SkGraphics::SetFontCacheLimit(fCacheSize);
sk_sp<SkTypeface> typefaces[] =
- {sk_tool_utils::create_portable_typeface("serif", SkTypeface::kItalic),
- sk_tool_utils::create_portable_typeface("sans-serif", SkTypeface::kItalic)};
+ {sk_tool_utils::create_portable_typeface("serif",
+ SkFontStyle::FromOldStyle(SkTypeface::kItalic)),
+ sk_tool_utils::create_portable_typeface("sans-serif",
+ SkFontStyle::FromOldStyle(SkTypeface::kItalic))};
for (int work = 0; work < loops; work++) {
SkTaskGroup().batch(16, [&](int threadIndex) {