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

Unified Diff: ash/display/multi_display_manager.cc

Issue 11377068: ui: Make gfx::Size::Scale() mutate the class. Add gfx::ScaleSize() similar to Rect/Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebaseTOGO Created 8 years, 1 month 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 | cc/contents_scaling_layer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/multi_display_manager.cc
diff --git a/ash/display/multi_display_manager.cc b/ash/display/multi_display_manager.cc
index 3f1e93d5d7bebddd6e7fc1fd4fe50e70d52f0aa0..46f1abc45199688d766ade5caf40ac4713439436 100644
--- a/ash/display/multi_display_manager.cc
+++ b/ash/display/multi_display_manager.cc
@@ -449,9 +449,10 @@ void MultiDisplayManager::ScaleDisplayImpl() {
iter != displays_.end(); ++iter) {
gfx::Display display = *iter;
float factor = display.device_scale_factor() == 1.0f ? 2.0f : 1.0f;
- display.SetScaleAndBounds(
- factor, gfx::Rect(display.bounds_in_pixel().origin(),
- gfx::ToFlooredSize(display.size().Scale(factor))));
+ gfx::Point display_origin = display.bounds_in_pixel().origin();
+ gfx::Size display_size = gfx::ToFlooredSize(
+ gfx::ScaleSize(display.size(), factor));
+ display.SetScaleAndBounds(factor, gfx::Rect(display_origin, display_size));
new_displays.push_back(display);
}
OnNativeDisplaysChanged(new_displays);
« no previous file with comments | « no previous file | cc/contents_scaling_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698