Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(492)

Unified Diff: ui/gfx/font_render_params_linux.cc

Issue 231583002: linux: Use subpixel positioning for forced scale factor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more review comments Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698