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

Unified Diff: ui/aura/root_window.cc

Issue 12848004: Add shortcut keys to ui scaling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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
« ash/display/display_manager.cc ('K') | « chrome/browser/about_flags.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/root_window.cc
diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc
index c2a63a58f329d3728c691ea74ac427aa3f4d9ba4..d5c041f2007bdc8a9c705671fc41c0f879bd9144 100644
--- a/ui/aura/root_window.cc
+++ b/ui/aura/root_window.cc
@@ -36,8 +36,8 @@
#include "ui/gfx/display.h"
#include "ui/gfx/point3_f.h"
#include "ui/gfx/point_conversions.h"
-#include "ui/gfx/rect_conversions.h"
#include "ui/gfx/screen.h"
+#include "ui/gfx/size_conversions.h"
using std::vector;
@@ -759,7 +759,6 @@ void RootWindow::UpdateWindowSize(const gfx::Size& host_size) {
bounds = ui::ConvertRectToDIP(layer(), bounds);
gfx::RectF new_bounds(bounds);
layer()->transform().TransformRect(&new_bounds);
-
// It makes little sense to scale beyond the original
// resolution.
DCHECK_LE(root_window_scale_, GetDeviceScaleFactor());
@@ -770,7 +769,10 @@ void RootWindow::UpdateWindowSize(const gfx::Size& host_size) {
new_bounds.Scale(root_window_scale_ * root_window_scale_);
// Ignore the origin because RootWindow's insets are handled by
// the transform.
- SetBounds(gfx::Rect(gfx::ToNearestRect(new_bounds).size()));
+ // Round the size because the bounds is no longer aligned to
+ // backing pixel when |root_window_scale_| is specified
+ // (850 height at 1.25 scale becomes 1062.5 for example.)
+ SetBounds(gfx::Rect(gfx::ToRoundedSize(new_bounds.size())));
}
void RootWindow::OnWindowAddedToRootWindow(Window* attached) {
« ash/display/display_manager.cc ('K') | « chrome/browser/about_flags.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698