| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/exo/pointer.h" | 5 #include "components/exo/pointer.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/public/cpp/shell_window_ids.h" | 9 #include "ash/public/cpp/shell_window_ids.h" |
| 10 #include "cc/output/copy_output_request.h" | 10 #include "cc/output/copy_output_request.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 ->GetPrimaryDisplayContainer(ash::kShellWindowId_MouseCursorContainer) | 126 ->GetPrimaryDisplayContainer(ash::kShellWindowId_MouseCursorContainer) |
| 127 ->AddChild(surface_->window()); | 127 ->AddChild(surface_->window()); |
| 128 } | 128 } |
| 129 cursor_changed = true; | 129 cursor_changed = true; |
| 130 } | 130 } |
| 131 | 131 |
| 132 if (hotspot != hotspot_) | 132 if (hotspot != hotspot_) |
| 133 cursor_changed = true; | 133 cursor_changed = true; |
| 134 | 134 |
| 135 // Early out if cursor did not change. | 135 // Early out if cursor did not change. |
| 136 if (!cursor_changed) | 136 if (!cursor_changed) { |
| 137 // Cursor scale or rotation may have changed. |
| 138 UpdateCursor(); |
| 137 return; | 139 return; |
| 140 } |
| 138 | 141 |
| 139 // If |surface_| is set then asynchronously capture a snapshot of cursor, | 142 // If |surface_| is set then asynchronously capture a snapshot of cursor, |
| 140 // otherwise cancel pending capture and immediately set the cursor to "none". | 143 // otherwise cancel pending capture and immediately set the cursor to "none". |
| 141 if (surface_) { | 144 if (surface_) { |
| 142 CaptureCursor(hotspot); | 145 CaptureCursor(hotspot); |
| 143 } else { | 146 } else { |
| 144 cursor_bitmap_.reset(); | 147 cursor_bitmap_.reset(); |
| 145 cursor_capture_weak_ptr_factory_.InvalidateWeakPtrs(); | 148 cursor_capture_weak_ptr_factory_.InvalidateWeakPtrs(); |
| 146 UpdateCursor(); | 149 UpdateCursor(); |
| 147 } | 150 } |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 if (!root_window) | 404 if (!root_window) |
| 402 return; | 405 return; |
| 403 | 406 |
| 404 aura::client::CursorClient* cursor_client = | 407 aura::client::CursorClient* cursor_client = |
| 405 aura::client::GetCursorClient(root_window); | 408 aura::client::GetCursorClient(root_window); |
| 406 if (cursor_client) | 409 if (cursor_client) |
| 407 cursor_client->SetCursor(cursor_); | 410 cursor_client->SetCursor(cursor_); |
| 408 } | 411 } |
| 409 | 412 |
| 410 } // namespace exo | 413 } // namespace exo |
| OLD | NEW |