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

Unified Diff: ash/display/display_change_observer_chromeos.cc

Issue 1289043002: Hookup device dpi for ChromeOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 | ash/display/display_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_change_observer_chromeos.cc
diff --git a/ash/display/display_change_observer_chromeos.cc b/ash/display/display_change_observer_chromeos.cc
index fd2a66d1fa86e2aeb367725a758722e11a40b590..4ca4df453d6d4d595ff8036a8a5b35d8ed895096 100644
--- a/ash/display/display_change_observer_chromeos.cc
+++ b/ash/display/display_change_observer_chromeos.cc
@@ -187,12 +187,11 @@ void DisplayChangeObserver::OnDisplayModeChanged(
continue;
float device_scale_factor = 1.0f;
+ float dpi = kInchInMm * mode_info->size().width() /
+ state->physical_size().width();
oshima 2015/08/19 02:07:08 This is physical DPI, and it may not represent the
bshe 2015/08/19 13:37:09 right. So I called this one device_dpi instead of
oshima 2015/08/20 00:20:32 What about 1440x956?
bshe 2015/08/20 14:42:05 I see. 1440x956 will return the wrong dpi as scale
if (state->type() == ui::DISPLAY_CONNECTION_TYPE_INTERNAL) {
- if (!ui::IsDisplaySizeBlackListed(state->physical_size())) {
- device_scale_factor =
- FindDeviceScaleFactor((kInchInMm * mode_info->size().width() /
- state->physical_size().width()));
- }
+ if (!ui::IsDisplaySizeBlackListed(state->physical_size()))
+ device_scale_factor = FindDeviceScaleFactor(dpi);
} else {
DisplayMode mode;
if (Shell::GetInstance()->display_manager()->GetSelectedModeForDisplayId(
@@ -234,6 +233,7 @@ void DisplayChangeObserver::OnDisplayModeChanged(
new_info.set_native(true);
new_info.set_is_aspect_preserving_scaling(
state->is_aspect_preserving_scaling());
+ new_info.set_device_dpi(dpi);
std::vector<DisplayMode> display_modes =
(state->type() == ui::DISPLAY_CONNECTION_TYPE_INTERNAL)
« no previous file with comments | « no previous file | ash/display/display_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698