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

Unified Diff: ui/aura/root_window.cc

Issue 11359172: ui: Remove implicit flooring in skia rect conversion methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make root window transform in tests produce an integer result 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 | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | ui/aura/window_unittest.cc » ('j') | 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 38ea96d3c23d24ce13de4b102542fb2b51ccf25d..a98aac43c32728f2c26dae26ae6c46f1bcbc7b91 100644
--- a/ui/aura/root_window.cc
+++ b/ui/aura/root_window.cc
@@ -39,6 +39,7 @@
#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"
using std::vector;
@@ -927,14 +928,15 @@ void RootWindow::OnHostResized(const gfx::Size& size) {
DispatchHeldMouseMove();
// The compositor should have the same size as the native root window host.
// Get the latest scale from display because it might have been changed.
- compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(this),
- size);
- gfx::Size old(bounds().size());
+ compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(this), size);
+
// The layer, and all the observers should be notified of the
// transformed size of the root window.
- gfx::Rect bounds(ui::ConvertSizeToDIP(layer(), size));
+ gfx::Size old(bounds().size());
+ gfx::RectF bounds(ui::ConvertSizeToDIP(layer(), size));
layer()->transform().TransformRect(&bounds);
- SetBounds(bounds);
+ // The transform is expected to produce an integer rect as its output.
+ SetBounds(gfx::ToNearestRect(bounds));
FOR_EACH_OBSERVER(RootWindowObserver, observers_,
OnRootWindowResized(this, old));
}
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | ui/aura/window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698