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

Unified Diff: ui/aura/root_window.cc

Issue 11369144: ui: Make gfx::Point::Scale() mutate the class, similar to gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes for aura 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
Index: ui/aura/root_window.cc
diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc
index 6c08fe6593387b6e5da2d788ce20a966cd3e1d2c..38ea96d3c23d24ce13de4b102542fb2b51ccf25d 100644
--- a/ui/aura/root_window.cc
+++ b/ui/aura/root_window.cc
@@ -345,7 +345,8 @@ 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 = gfx::ToFlooredPoint(point->Scale(ui::GetDeviceScaleFactor(layer())));
+ *point = gfx::ToFlooredPoint(
+ gfx::ScalePoint(*point, ui::GetDeviceScaleFactor(layer())));
gfx::Point location = host_->GetLocationOnNativeScreen();
point->Offset(location.x(), location.y());
}
@@ -354,7 +355,7 @@ void RootWindow::ConvertPointFromNativeScreen(gfx::Point* point) const {
gfx::Point location = host_->GetLocationOnNativeScreen();
point->Offset(-location.x(), -location.y());
*point = gfx::ToFlooredPoint(
- point->Scale(1 / ui::GetDeviceScaleFactor(layer())));
+ gfx::ScalePoint(*point, 1 / ui::GetDeviceScaleFactor(layer())));
}
void RootWindow::ProcessedTouchEvent(ui::TouchEvent* event,

Powered by Google App Engine
This is Rietveld 408576698