| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ozone/platform/dri/dri_cursor.h" | 5 #include "ui/ozone/platform/dri/dri_cursor.h" |
| 6 | 6 |
| 7 #include "base/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
| 8 #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h" | 8 #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h" |
| 9 #include "ui/gfx/geometry/point.h" | 9 #include "ui/gfx/geometry/point.h" |
| 10 #include "ui/gfx/geometry/point_conversions.h" | 10 #include "ui/gfx/geometry/point_conversions.h" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 } | 159 } |
| 160 | 160 |
| 161 void DriCursor::MoveCursorTo(const gfx::PointF& screen_location) { | 161 void DriCursor::MoveCursorTo(const gfx::PointF& screen_location) { |
| 162 base::AutoLock lock(state_.lock); | 162 base::AutoLock lock(state_.lock); |
| 163 | 163 |
| 164 // TODO(spang): Moving between windows doesn't work here, but | 164 // TODO(spang): Moving between windows doesn't work here, but |
| 165 // is not needed for current uses. | 165 // is not needed for current uses. |
| 166 | 166 |
| 167 SetCursorLocationLocked(screen_location - | 167 SetCursorLocationLocked(screen_location - |
| 168 state_.display_bounds_in_screen.OffsetFromOrigin()); | 168 state_.display_bounds_in_screen.OffsetFromOrigin()); |
| 169 |
| 170 SendCursorMoveLocked(); |
| 169 } | 171 } |
| 170 | 172 |
| 171 void DriCursor::MoveCursor(const gfx::Vector2dF& delta) { | 173 void DriCursor::MoveCursor(const gfx::Vector2dF& delta) { |
| 172 base::AutoLock lock(state_.lock); | 174 base::AutoLock lock(state_.lock); |
| 173 if (state_.window == gfx::kNullAcceleratedWidget) | 175 if (state_.window == gfx::kNullAcceleratedWidget) |
| 174 return; | 176 return; |
| 175 | 177 |
| 176 gfx::Point location; | 178 gfx::Point location; |
| 177 #if defined(OS_CHROMEOS) | 179 #if defined(OS_CHROMEOS) |
| 178 gfx::Vector2dF transformed_delta = delta; | 180 gfx::Vector2dF transformed_delta = delta; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 } | 294 } |
| 293 | 295 |
| 294 DriCursor::CursorState::CursorState() | 296 DriCursor::CursorState::CursorState() |
| 295 : window(gfx::kNullAcceleratedWidget), host_id(-1) { | 297 : window(gfx::kNullAcceleratedWidget), host_id(-1) { |
| 296 } | 298 } |
| 297 | 299 |
| 298 DriCursor::CursorState::~CursorState() { | 300 DriCursor::CursorState::~CursorState() { |
| 299 } | 301 } |
| 300 | 302 |
| 301 } // namespace ui | 303 } // namespace ui |
| OLD | NEW |