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

Unified Diff: ui/gfx/font_render_params_linux.cc

Issue 789583002: Updates subpixel positioning and hinting when DSF is changed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: GN Created 6 years 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
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 34afe6fb3ade7ee4527acfd37aabb8d19626d96d..41c8665687cb482c8bdc04b57689e24bb00da1eb 100644
--- a/ui/gfx/font_render_params_linux.cc
+++ b/ui/gfx/font_render_params_linux.cc
@@ -61,14 +61,6 @@ struct SynchronizedCache {
base::LazyInstance<SynchronizedCache>::Leaky g_synchronized_cache =
LAZY_INSTANCE_INITIALIZER;
-bool IsBrowserTextSubpixelPositioningEnabled() {
-#if defined(OS_CHROMEOS)
- return device_scale_factor_for_internal_display > 1.0f;
-#else
- return false;
-#endif
-}
-
// Converts Fontconfig FC_HINT_STYLE to FontRenderParams::Hinting.
FontRenderParams::Hinting ConvertFontconfigHintStyle(int hint_style) {
switch (hint_style) {
@@ -186,8 +178,8 @@ uint32 HashFontRenderParamsQuery(const FontRenderParamsQuery& query) {
} // namespace
-FontRenderParams GetFontRenderParams(const FontRenderParamsQuery& query,
- std::string* family_out) {
+FontRenderParams GetSystemFontRenderParams(const FontRenderParamsQuery& query,
+ std::string* family_out) {
const uint32 hash = HashFontRenderParamsQuery(query);
SynchronizedCache* synchronized_cache = g_synchronized_cache.Pointer();
@@ -220,20 +212,8 @@ FontRenderParams GetFontRenderParams(const FontRenderParamsQuery& query,
// rendering or positioning doesn't make sense either.
params.hinting = FontRenderParams::HINTING_FULL;
params.subpixel_rendering = FontRenderParams::SUBPIXEL_RENDERING_NONE;
- params.subpixel_positioning = false;
- } else {
- // Fontconfig doesn't support configuring subpixel positioning; check a
- // flag.
- params.subpixel_positioning =
- query.for_web_contents ?
- CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableWebkitTextSubpixelPositioning) :
- IsBrowserTextSubpixelPositioningEnabled();
-
- // To enable subpixel positioning, we need to disable hinting.
- if (params.subpixel_positioning)
- params.hinting = FontRenderParams::HINTING_NONE;
}
+ params.subpixel_positioning = false;
// Use the first family from the list if Fontconfig didn't suggest a family.
if (family_out && family_out->empty() && !query.families.empty())

Powered by Google App Engine
This is Rietveld 408576698