remove platform_font_manager()

We don't need this name munging since the
native/non-native font bots split.

Change-Id: I0e64feb08441ece8e0e4be0a70b812220aa8385a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199300
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This commit is contained in:
Mike Klein 2019-03-08 11:11:55 -06:00 committed by Skia Commit-Bot
parent e588d35929
commit bea1f94f34
15 changed files with 16 additions and 84 deletions

View File

@ -67,9 +67,7 @@ protected:
}
SkString onShortName() override {
SkString name("coloremoji");
name.append(sk_tool_utils::platform_font_manager());
return name;
return SkString("coloremoji");
}
SkISize onISize() override { return SkISize::Make(650, 1200); }

View File

@ -62,9 +62,7 @@ protected:
}
virtual SkString onShortName() override {
SkString name("coloremoji_blendmodes");
name.append(sk_tool_utils::platform_font_manager());
return name;
return SkString("coloremoji_blendmodes");
}
virtual SkISize onISize() override {

View File

@ -29,9 +29,7 @@ protected:
}
SkString onShortName() override {
SkString name("dftext");
name.append(sk_tool_utils::platform_font_manager());
return name;
return SkString("dftext");
}
SkISize onISize() override {

View File

@ -24,9 +24,7 @@ public:
protected:
SkString onShortName() override {
SkString name("dftext_blob_persp");
name.append(sk_tool_utils::platform_font_manager());
return name;
return SkString("dftext_blob_persp");
}
SkISize onISize() override { return SkISize::Make(900, 350); }

View File

@ -61,7 +61,6 @@ public:
fName.set("fontmgr_iter");
fFM = SkFontMgr::RefDefault();
fName.append(sk_tool_utils::platform_font_manager());
}
protected:
@ -127,9 +126,7 @@ public:
protected:
SkString onShortName() override {
SkString name("fontmgr_match");
name.append(sk_tool_utils::platform_font_manager());
return name;
return SkString("fontmgr_match");
}
SkISize onISize() override {
@ -215,7 +212,6 @@ public:
if (scale != 1 || skew != 0) {
fName.appendf("_%g_%g", scale, skew);
}
fName.append(sk_tool_utils::platform_font_manager());
fFM = SkFontMgr::RefDefault();
}

View File

@ -20,9 +20,7 @@ public:
protected:
SkString onShortName() override {
SkString name("fontscaler");
name.append(sk_tool_utils::platform_font_manager());
return name;
return SkString("fontscaler");
}
SkISize onISize() override {

View File

@ -31,9 +31,7 @@ static sk_sp<SkShader> make_heatGradient(const SkPoint pts[2]) {
class GammaTextGM : public skiagm::GM {
protected:
SkString onShortName() override {
SkString name("gammatext");
name.append(sk_tool_utils::platform_font_manager());
return name;
return SkString("gammatext");
}
SkISize onISize() override {

View File

@ -28,9 +28,7 @@ public:
protected:
SkString onShortName() {
SkString name("lcdtext");
name.append(sk_tool_utils::platform_font_manager());
return name;
return SkString("lcdtext");
}
SkISize onISize() { return SkISize::Make(640, 480); }

View File

@ -96,8 +96,7 @@ protected:
}
SkString onShortName() override {
return SkStringPrintf("mixedtextblobs%s",
sk_tool_utils::platform_font_manager());
return SkString("mixedtextblobs");
}
SkISize onISize() override {

View File

@ -45,9 +45,7 @@ protected:
}
SkString onShortName() override {
SkString name("scaledemoji");
name.append(sk_tool_utils::platform_font_manager());
return name;
return SkString("scaledemoji");
}
SkISize onISize() override { return SkISize::Make(1200, 1200); }
@ -97,9 +95,7 @@ protected:
}
SkString onShortName() override {
SkString name("scaledemojipos");
name.append(sk_tool_utils::platform_font_manager());
return name;
return SkString("scaledemojipos");
}
SkISize onISize() override { return SkISize::Make(1200, 1200); }

View File

@ -31,9 +31,7 @@ protected:
}
SkString onShortName() override {
SkString name("scaledemoji_rendering");
name.append(sk_tool_utils::platform_font_manager());
return name;
return SkString("scaledemoji_rendering");
}
SkISize onISize() override { return SkISize::Make(1200, 1200); }

View File

@ -80,8 +80,7 @@ protected:
}
SkString onShortName() override {
return SkStringPrintf("textblobmixedsizes%s%s",
sk_tool_utils::platform_font_manager(),
return SkStringPrintf("textblobmixedsizes%s",
fUseDFT ? "_df" : "");
}

View File

@ -101,7 +101,6 @@ protected:
if (fApplyKerning) {
name.append("_kerning");
}
name.append(sk_tool_utils::platform_font_manager());
return name;
}
@ -350,9 +349,7 @@ static void draw_typeface_rendering_gm(SkCanvas* canvas, sk_sp<SkTypeface> face,
}
}
DEF_SIMPLE_GM_BG_NAME(typefacerendering, canvas, 640, 840, SK_ColorWHITE,
SkStringPrintf("typefacerendering%s",
sk_tool_utils::platform_font_manager())) {
DEF_SIMPLE_GM(typefacerendering, canvas, 640, 840) {
if (sk_sp<SkTypeface> face = MakeResourceAsTypeface("fonts/hintgasp.ttf")) {
draw_typeface_rendering_gm(canvas, std::move(face));
}
@ -361,18 +358,14 @@ DEF_SIMPLE_GM_BG_NAME(typefacerendering, canvas, 640, 840, SK_ColorWHITE,
// Type1 fonts don't currently work in Skia on Windows.
#ifndef SK_BUILD_FOR_WIN
DEF_SIMPLE_GM_BG_NAME(typefacerendering_pfa, canvas, 640, 840, SK_ColorWHITE,
SkStringPrintf("typefacerendering_pfa%s",
sk_tool_utils::platform_font_manager())) {
DEF_SIMPLE_GM(typefacerendering_pfa, canvas, 640, 840) {
if (sk_sp<SkTypeface> face = MakeResourceAsTypeface("fonts/Roboto2-Regular.pfa")) {
// This subsetted typeface doesn't have the character 'A'.
draw_typeface_rendering_gm(canvas, std::move(face), 'O');
}
}
DEF_SIMPLE_GM_BG_NAME(typefacerendering_pfb, canvas, 640, 840, SK_ColorWHITE,
SkStringPrintf("typefacerendering_pfb%s",
sk_tool_utils::platform_font_manager())) {
DEF_SIMPLE_GM(typefacerendering_pfb, canvas, 640, 840) {
if (sk_sp<SkTypeface> face = MakeResourceAsTypeface("fonts/Roboto2-Regular.pfb")) {
draw_typeface_rendering_gm(canvas, std::move(face), 'O');
}

View File

@ -38,36 +38,6 @@ sk_sp<SkTypeface> emoji_typeface() {
const char* emoji_sample_text() {
return "\xF0\x9F\x98\x80" " " "\xE2\x99\xA2"; // 😀 ♢
}
static const char* platform_os_name() {
for (int index = 0; index < FLAGS_key.count(); index += 2) {
if (!strcmp("os", FLAGS_key[index])) {
return FLAGS_key[index + 1];
}
}
return "";
}
static bool extra_config_contains(const char* substring) {
for (int index = 0; index < FLAGS_key.count(); index += 2) {
if (0 == strcmp("extra_config", FLAGS_key[index])
&& strstr(FLAGS_key[index + 1], substring)) {
return true;
}
}
return false;
}
const char* platform_font_manager() {
if (extra_config_contains("GDI")) {
return "GDI";
}
if (extra_config_contains("NativeFonts")){
return platform_os_name();
}
return "";
}
static sk_sp<SkTypeface> create_font(const char* name, SkFontStyle style) {
static sk_sp<SkFontMgr> portableFontMgr = MakePortableFontMgr();
return portableFontMgr->legacyMakeTypeface(name, style);

View File

@ -59,11 +59,6 @@ namespace sk_tool_utils {
*/
const char* emoji_sample_text();
/**
* Returns a string describing the platform font manager, if we're using one, otherwise "".
*/
const char* platform_font_manager();
/**
* Returns a platform-independent text renderer.
*/