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

Unified Diff: ash/display/display_manager.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: linux fix 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
« no previous file with comments | « ash/display/display_manager.h ('k') | ash/display/display_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_manager.cc
diff --git a/ash/display/display_manager.cc b/ash/display/display_manager.cc
index 5252679f1968eedc50ddcfdf42031744d37d9509..84051a191bb5bf02f50b2949d92d572dd0c982c1 100644
--- a/ash/display/display_manager.cc
+++ b/ash/display/display_manager.cc
@@ -237,14 +237,14 @@ void DisplayManager::InitDefaultDisplay() {
OnNativeDisplaysChanged(info_list);
}
-void DisplayManager::InitFontParams() {
+void DisplayManager::RefreshFontParams() {
#if defined(OS_CHROMEOS)
- if (!HasInternalDisplay())
- return;
- const DisplayInfo& display_info =
- GetDisplayInfo(gfx::Display::InternalDisplayId());
- gfx::SetFontRenderParamsDeviceScaleFactor(
- display_info.GetEffectiveDeviceScaleFactor());
+ float device_scale_factor = 1.0f;
+ if (HasInternalDisplay()) {
+ device_scale_factor = GetDisplayInfo(gfx::Display::InternalDisplayId())
+ .GetEffectiveDeviceScaleFactor();
+ }
+ gfx::SetFontRenderParamsDeviceScaleFactor(device_scale_factor);
#endif // OS_CHROMEOS
}
@@ -904,6 +904,7 @@ void DisplayManager::UpdateDisplays(
displays_ = new_displays;
+ RefreshFontParams();
base::AutoReset<bool> resetter(&change_display_upon_host_resize_, false);
// Temporarily add displays to be removed because display object
« no previous file with comments | « ash/display/display_manager.h ('k') | ash/display/display_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698