Skip to content

Commit

Permalink
Remove [gfx] switches::kEnableHarfBuzzRenderText.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Alexei Svitkine <[email protected]>
Cr-Commit-Position: refs/heads/master@{#594732}
  • Loading branch information
tapted authored and Commit Bot committed Sep 27, 2018
1 parent 61152b7 commit 5a5abaa
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 38 deletions.
5 changes: 0 additions & 5 deletions chrome/browser/about_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)},
Expand Down
5 changes: 0 additions & 5 deletions chrome/browser/flag_descriptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down
9 changes: 0 additions & 9 deletions ui/gfx/render_text.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -354,14 +353,6 @@ std::unique_ptr<RenderText> RenderText::CreateFor(Typesetter typesetter) {
if (typesetter == Typesetter::NATIVE)
return std::make_unique<RenderTextMac>();

if (typesetter == Typesetter::HARFBUZZ)
return CreateHarfBuzzInstance();

static const bool use_native =
!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableHarfBuzzRenderText);
if (use_native)
return std::make_unique<RenderTextMac>();
#endif // defined(OS_MACOSX)
return CreateHarfBuzzInstance();
}
Expand Down
6 changes: 0 additions & 6 deletions ui/gfx/switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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[] =
Expand Down
4 changes: 0 additions & 4 deletions ui/gfx/switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand Down
9 changes: 0 additions & 9 deletions ui/views/controls/label_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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<ui::test::EventGenerator>(widget()->GetNativeWindow());
Expand Down

0 comments on commit 5a5abaa

Please sign in to comment.