| Index: ui/gfx/font_render_params_linux.cc
|
| diff --git a/ui/gfx/font_render_params_linux.cc b/ui/gfx/font_render_params_linux.cc
|
| index 5e30f4dd947acf73a05e435d2dfe8420bdfd0aeb..0c157d578f2e6c74fc9a48b1a9feb3268ebe95c5 100644
|
| --- a/ui/gfx/font_render_params_linux.cc
|
| +++ b/ui/gfx/font_render_params_linux.cc
|
| @@ -6,6 +6,7 @@
|
|
|
| #include "base/command_line.h"
|
| #include "base/logging.h"
|
| +#include "ui/gfx/display.h"
|
| #include "ui/gfx/switches.h"
|
|
|
| #if defined(TOOLKIT_GTK)
|
| @@ -23,10 +24,16 @@ namespace gfx {
|
| namespace {
|
|
|
| bool SubpixelPositioningRequested(bool renderer) {
|
| - return CommandLine::ForCurrentProcess()->HasSwitch(
|
| - renderer ?
|
| - switches::kEnableWebkitTextSubpixelPositioning :
|
| - switches::kEnableBrowserTextSubpixelPositioning);
|
| + const CommandLine* cl = CommandLine::ForCurrentProcess();
|
| + if (renderer) {
|
| + // Text rendered by Blink in high-DPI mode is poorly-hinted unless subpixel
|
| + // positioning is used (as opposed to each glyph being individually snapped
|
| + // to the pixel grid).
|
| + return cl->HasSwitch(switches::kEnableWebkitTextSubpixelPositioning) ||
|
| + (Display::HasForceDeviceScaleFactor() &&
|
| + Display::GetForcedDeviceScaleFactor() != 1.0);
|
| + }
|
| + return cl->HasSwitch(switches::kEnableBrowserTextSubpixelPositioning);
|
| }
|
|
|
| // Initializes |params| with the system's default settings. |renderer| is true
|
|
|