From 5a5abaaad7eb9693282982a3aadd5bd63357d032 Mon Sep 17 00:00:00 2001 From: Trent Apted Date: Thu, 27 Sep 2018 15:34:46 +0000 Subject: [PATCH] Remove [gfx] switches::kEnableHarfBuzzRenderText. It's effectively the default. Only a few places using gfx::Typesetter::NATIVE explicitly should be using RenderTextMac now. Bug: 798944, 889152 Change-Id: I3318676b14b938607de9413130627dc1581b2289 Reviewed-on: https://chromium-review.googlesource.com/1248263 Commit-Queue: Alexei Svitkine Reviewed-by: Alexei Svitkine Cr-Commit-Position: refs/heads/master@{#594732} --- chrome/browser/about_flags.cc | 5 ----- chrome/browser/flag_descriptions.cc | 5 ----- ui/gfx/render_text.cc | 9 --------- ui/gfx/switches.cc | 6 ------ ui/gfx/switches.h | 4 ---- ui/views/controls/label_unittest.cc | 9 --------- 6 files changed, 38 deletions(-) diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 9dea6d222e1644..da2e0dcef0d590 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -2242,11 +2242,6 @@ const FeatureEntry kFeatureEntries[] = { {"enable-use-zoom-for-dsf", flag_descriptions::kEnableUseZoomForDsfName, flag_descriptions::kEnableUseZoomForDsfDescription, kOsAll, MULTI_VALUE_TYPE(kEnableUseZoomForDSFChoices)}, -#if defined(OS_MACOSX) - {"enable-harfbuzz-rendertext", flag_descriptions::kHarfbuzzRendertextName, - flag_descriptions::kHarfbuzzRendertextDescription, kOsMac, - SINGLE_VALUE_TYPE(switches::kEnableHarfBuzzRenderText)}, -#endif // OS_MACOSX {"allow-previews", flag_descriptions::kPreviewsAllowedName, flag_descriptions::kPreviewsAllowedDescription, kOsAll, FEATURE_VALUE_TYPE(previews::features::kPreviews)}, diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index ebdcb84ef85ec2..b7a31038c9e938 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc @@ -979,11 +979,6 @@ const char kGoogleProfileInfoDescription[] = "Enables using Google information to populate the profile name and icon in " "the avatar menu."; -const char kHarfbuzzRendertextName[] = "HarfBuzz for UI text"; -const char kHarfbuzzRendertextDescription[] = - "Enable cross-platform HarfBuzz layout engine for UI text. Doesn't affect " - "web content."; - const char kViewsCastDialogName[] = "Views Cast dialog"; const char kViewsCastDialogDescription[] = "Replace the WebUI Cast dialog with a Views toolkit dialog. This requires " diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc index 1ce0d700c70315..deada9af341b87 100644 --- a/ui/gfx/render_text.cc +++ b/ui/gfx/render_text.cc @@ -36,7 +36,6 @@ #include "ui/gfx/scoped_canvas.h" #include "ui/gfx/skia_paint_util.h" #include "ui/gfx/skia_util.h" -#include "ui/gfx/switches.h" #include "ui/gfx/text_elider.h" #include "ui/gfx/text_utils.h" #include "ui/gfx/utf16_indexing.h" @@ -354,14 +353,6 @@ std::unique_ptr RenderText::CreateFor(Typesetter typesetter) { if (typesetter == Typesetter::NATIVE) return std::make_unique(); - if (typesetter == Typesetter::HARFBUZZ) - return CreateHarfBuzzInstance(); - - static const bool use_native = - !base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableHarfBuzzRenderText); - if (use_native) - return std::make_unique(); #endif // defined(OS_MACOSX) return CreateHarfBuzzInstance(); } diff --git a/ui/gfx/switches.cc b/ui/gfx/switches.cc index e1943d5970ac37..84733cbf5fdeb9 100644 --- a/ui/gfx/switches.cc +++ b/ui/gfx/switches.cc @@ -12,12 +12,6 @@ namespace switches { const char kDisableDirectWriteForUI[] = "disable-directwrite-for-ui"; #endif -#if defined(OS_MACOSX) -// Enables the HarfBuzz port of RenderText on Mac (it's already used only for -// text editing; this enables it for everything else). -const char kEnableHarfBuzzRenderText[] = "enable-harfbuzz-rendertext"; -#endif - // Force disables font subpixel positioning. This affects the character glyph // sharpness, kerning, hinting and layout. const char kDisableFontSubpixelPositioning[] = diff --git a/ui/gfx/switches.h b/ui/gfx/switches.h index dc4921dbf0cc4a..99e341272ba64a 100644 --- a/ui/gfx/switches.h +++ b/ui/gfx/switches.h @@ -15,10 +15,6 @@ namespace switches { GFX_SWITCHES_EXPORT extern const char kDisableDirectWriteForUI[]; #endif -#if defined(OS_MACOSX) -GFX_SWITCHES_EXPORT extern const char kEnableHarfBuzzRenderText[]; -#endif - GFX_SWITCHES_EXPORT extern const char kDisableFontSubpixelPositioning[]; GFX_SWITCHES_EXPORT extern const char kHeadless[]; diff --git a/ui/views/controls/label_unittest.cc b/ui/views/controls/label_unittest.cc index d87acf7c42d075..1ee2b444c4222c 100644 --- a/ui/views/controls/label_unittest.cc +++ b/ui/views/controls/label_unittest.cc @@ -20,7 +20,6 @@ #include "ui/events/test/event_generator.h" #include "ui/gfx/canvas.h" #include "ui/gfx/render_text.h" -#include "ui/gfx/switches.h" #include "ui/gfx/text_elider.h" #include "ui/strings/grit/ui_strings.h" #include "ui/views/border.h" @@ -163,14 +162,6 @@ class LabelSelectionTest : public LabelTest { // LabelTest overrides: void SetUp() override { -#if defined(OS_MACOSX) - // On Mac, by default RenderTextMac is used for labels which does not - // support text selection. Instead use RenderTextHarfBuzz for selection - // related tests. TODO(crbug.com/661394): Remove this once Mac also uses - // RenderTextHarfBuzz for Labels. - base::CommandLine::ForCurrentProcess()->AppendSwitch( - switches::kEnableHarfBuzzRenderText); -#endif LabelTest::SetUp(); event_generator_ = std::make_unique(widget()->GetNativeWindow());