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

Side by Side Diff: ui/aura/window_tree_host.cc

Issue 1421713002: Explicitly convert Point to PointF for event code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wip
Patch Set: pointfconvert-prod: . Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/aura/window_tree_host.h" 5 #include "ui/aura/window_tree_host.h"
6 6
7 #include "base/thread_task_runner_handle.h" 7 #include "base/thread_task_runner_handle.h"
8 #include "base/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 #include "ui/aura/client/capture_client.h" 9 #include "ui/aura/client/capture_client.h"
10 #include "ui/aura/client/cursor_client.h" 10 #include "ui/aura/client/cursor_client.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 point->Offset(location.x(), location.y()); 115 point->Offset(location.x(), location.y());
116 } 116 }
117 117
118 void WindowTreeHost::ConvertPointFromNativeScreen(gfx::Point* point) const { 118 void WindowTreeHost::ConvertPointFromNativeScreen(gfx::Point* point) const {
119 gfx::Point location = GetLocationOnNativeScreen(); 119 gfx::Point location = GetLocationOnNativeScreen();
120 point->Offset(-location.x(), -location.y()); 120 point->Offset(-location.x(), -location.y());
121 ConvertPointFromHost(point); 121 ConvertPointFromHost(point);
122 } 122 }
123 123
124 void WindowTreeHost::ConvertPointToHost(gfx::Point* point) const { 124 void WindowTreeHost::ConvertPointToHost(gfx::Point* point) const {
125 gfx::Point3F point_3f(*point); 125 auto point_3f = gfx::Point3F(gfx::PointF(*point));
126 GetRootTransform().TransformPoint(&point_3f); 126 GetRootTransform().TransformPoint(&point_3f);
127 *point = gfx::ToFlooredPoint(point_3f.AsPointF()); 127 *point = gfx::ToFlooredPoint(point_3f.AsPointF());
128 } 128 }
129 129
130 void WindowTreeHost::ConvertPointFromHost(gfx::Point* point) const { 130 void WindowTreeHost::ConvertPointFromHost(gfx::Point* point) const {
131 gfx::Point3F point_3f(*point); 131 auto point_3f = gfx::Point3F(gfx::PointF(*point));
132 GetInverseRootTransform().TransformPoint(&point_3f); 132 GetInverseRootTransform().TransformPoint(&point_3f);
133 *point = gfx::ToFlooredPoint(point_3f.AsPointF()); 133 *point = gfx::ToFlooredPoint(point_3f.AsPointF());
134 } 134 }
135 135
136 void WindowTreeHost::SetCursor(gfx::NativeCursor cursor) { 136 void WindowTreeHost::SetCursor(gfx::NativeCursor cursor) {
137 last_cursor_ = cursor; 137 last_cursor_ = cursor;
138 // A lot of code seems to depend on NULL cursors actually showing an arrow, 138 // A lot of code seems to depend on NULL cursors actually showing an arrow,
139 // so just pass everything along to the host. 139 // so just pass everything along to the host.
140 SetCursorNative(cursor); 140 SetCursorNative(cursor);
141 } 141 }
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 client::CursorClient* cursor_client = client::GetCursorClient(window()); 300 client::CursorClient* cursor_client = client::GetCursorClient(window());
301 if (cursor_client) { 301 if (cursor_client) {
302 const gfx::Display& display = 302 const gfx::Display& display =
303 gfx::Screen::GetScreenFor(window())->GetDisplayNearestWindow(window()); 303 gfx::Screen::GetScreenFor(window())->GetDisplayNearestWindow(window());
304 cursor_client->SetDisplay(display); 304 cursor_client->SetDisplay(display);
305 } 305 }
306 dispatcher()->OnCursorMovedToRootLocation(root_location); 306 dispatcher()->OnCursorMovedToRootLocation(root_location);
307 } 307 }
308 308
309 } // namespace aura 309 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698