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

Unified Diff: ui/aura/root_window.cc

Issue 11081007: Remove implicit flooring Scale() method from Point and Size. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 | « content/renderer/render_widget_fullscreen_pepper.cc ('k') | ui/base/resource/resource_bundle.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 b82ab03a2c4e702c5129f4a3b0ac3582119c94d9..c9cdbbd034261aa5deeb72f9de8cbaa76b4fe06c 100644
--- a/ui/aura/root_window.cc
+++ b/ui/aura/root_window.cc
@@ -38,6 +38,7 @@
#include "ui/compositor/layer_animator.h"
#include "ui/gfx/display.h"
#include "ui/gfx/point3.h"
+#include "ui/gfx/point_conversions.h"
#include "ui/gfx/screen.h"
using std::vector;
@@ -387,7 +388,7 @@ void RootWindow::PostNativeEvent(const base::NativeEvent& native_event) {
void RootWindow::ConvertPointToNativeScreen(gfx::Point* point) const {
// TODO(oshima): Take the root window's transform into account.
- *point = point->Scale(ui::GetDeviceScaleFactor(layer()));
+ *point = gfx::ToFlooredPoint(point->Scale(ui::GetDeviceScaleFactor(layer())));
gfx::Point location = host_->GetLocationOnNativeScreen();
point->Offset(location.x(), location.y());
}
@@ -395,7 +396,8 @@ void RootWindow::ConvertPointToNativeScreen(gfx::Point* point) const {
void RootWindow::ConvertPointFromNativeScreen(gfx::Point* point) const {
gfx::Point location = host_->GetLocationOnNativeScreen();
point->Offset(-location.x(), -location.y());
- *point = point->Scale(1 / ui::GetDeviceScaleFactor(layer()));
+ *point = gfx::ToFlooredPoint(
+ point->Scale(1 / ui::GetDeviceScaleFactor(layer())));
}
void RootWindow::AdvanceQueuedTouchEvent(Window* window, bool processed) {
« no previous file with comments | « content/renderer/render_widget_fullscreen_pepper.cc ('k') | ui/base/resource/resource_bundle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698