| OLD | NEW |
| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 point->Offset(location.x(), location.y()); | 126 point->Offset(location.x(), location.y()); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void WindowTreeHost::ConvertPointFromNativeScreen(gfx::Point* point) const { | 129 void WindowTreeHost::ConvertPointFromNativeScreen(gfx::Point* point) const { |
| 130 gfx::Point location = GetLocationOnNativeScreen(); | 130 gfx::Point location = GetLocationOnNativeScreen(); |
| 131 point->Offset(-location.x(), -location.y()); | 131 point->Offset(-location.x(), -location.y()); |
| 132 ConvertPointFromHost(point); | 132 ConvertPointFromHost(point); |
| 133 } | 133 } |
| 134 | 134 |
| 135 void WindowTreeHost::ConvertPointToHost(gfx::Point* point) const { | 135 void WindowTreeHost::ConvertPointToHost(gfx::Point* point) const { |
| 136 gfx::Point3F point_3f(*point); | 136 auto point_3f = gfx::Point3F(gfx::PointF(*point)); |
| 137 GetRootTransform().TransformPoint(&point_3f); | 137 GetRootTransform().TransformPoint(&point_3f); |
| 138 *point = gfx::ToFlooredPoint(point_3f.AsPointF()); | 138 *point = gfx::ToFlooredPoint(point_3f.AsPointF()); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void WindowTreeHost::ConvertPointFromHost(gfx::Point* point) const { | 141 void WindowTreeHost::ConvertPointFromHost(gfx::Point* point) const { |
| 142 gfx::Point3F point_3f(*point); | 142 auto point_3f = gfx::Point3F(gfx::PointF(*point)); |
| 143 GetInverseRootTransform().TransformPoint(&point_3f); | 143 GetInverseRootTransform().TransformPoint(&point_3f); |
| 144 *point = gfx::ToFlooredPoint(point_3f.AsPointF()); | 144 *point = gfx::ToFlooredPoint(point_3f.AsPointF()); |
| 145 } | 145 } |
| 146 | 146 |
| 147 void WindowTreeHost::SetCursor(gfx::NativeCursor cursor) { | 147 void WindowTreeHost::SetCursor(gfx::NativeCursor cursor) { |
| 148 last_cursor_ = cursor; | 148 last_cursor_ = cursor; |
| 149 // A lot of code seems to depend on NULL cursors actually showing an arrow, | 149 // A lot of code seems to depend on NULL cursors actually showing an arrow, |
| 150 // so just pass everything along to the host. | 150 // so just pass everything along to the host. |
| 151 SetCursorNative(cursor); | 151 SetCursorNative(cursor); |
| 152 } | 152 } |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 client::CursorClient* cursor_client = client::GetCursorClient(window()); | 311 client::CursorClient* cursor_client = client::GetCursorClient(window()); |
| 312 if (cursor_client) { | 312 if (cursor_client) { |
| 313 const gfx::Display& display = | 313 const gfx::Display& display = |
| 314 gfx::Screen::GetScreenFor(window())->GetDisplayNearestWindow(window()); | 314 gfx::Screen::GetScreenFor(window())->GetDisplayNearestWindow(window()); |
| 315 cursor_client->SetDisplay(display); | 315 cursor_client->SetDisplay(display); |
| 316 } | 316 } |
| 317 dispatcher()->OnCursorMovedToRootLocation(root_location); | 317 dispatcher()->OnCursorMovedToRootLocation(root_location); |
| 318 } | 318 } |
| 319 | 319 |
| 320 } // namespace aura | 320 } // namespace aura |
| OLD | NEW |