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

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: git try -b win_rel,mac_rel,linux_rel,linux_aura 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
Index: ui/aura/root_window.cc
diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc
index 10d22977ae122c381216966f8bfc8bfe8e3a2c83..4aeec10072e1fb437b04bc81bcf686ff2cdeac6a 100644
--- a/ui/aura/root_window.cc
+++ b/ui/aura/root_window.cc
@@ -37,6 +37,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;
@@ -379,7 +380,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());
}
@@ -387,7 +388,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) {

Powered by Google App Engine
This is Rietveld 408576698