| 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 "ash/public/cpp/shell_window_ids.h" | 7 #include "ash/public/cpp/shell_window_ids.h" |
| 8 #include "cc/output/copy_output_request.h" | 8 #include "cc/output/copy_output_request.h" |
| 9 #include "cc/output/copy_output_result.h" | 9 #include "cc/output/copy_output_result.h" |
| 10 #include "components/exo/pointer_delegate.h" | 10 #include "components/exo/pointer_delegate.h" |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 cursor_ = ui::kCursorNone; | 351 cursor_ = ui::kCursorNone; |
| 352 if (!result->IsEmpty()) { | 352 if (!result->IsEmpty()) { |
| 353 DCHECK(result->HasBitmap()); | 353 DCHECK(result->HasBitmap()); |
| 354 std::unique_ptr<SkBitmap> bitmap = result->TakeBitmap(); | 354 std::unique_ptr<SkBitmap> bitmap = result->TakeBitmap(); |
| 355 | 355 |
| 356 ui::PlatformCursor platform_cursor; | 356 ui::PlatformCursor platform_cursor; |
| 357 #if defined(USE_OZONE) | 357 #if defined(USE_OZONE) |
| 358 // TODO(reveman): Add interface for creating cursors from GpuMemoryBuffers | 358 // TODO(reveman): Add interface for creating cursors from GpuMemoryBuffers |
| 359 // and use that here instead of the current bitmap API. crbug.com/686600 | 359 // and use that here instead of the current bitmap API. crbug.com/686600 |
| 360 platform_cursor = ui::CursorFactoryOzone::GetInstance()->CreateImageCursor( | 360 platform_cursor = ui::CursorFactoryOzone::GetInstance()->CreateImageCursor( |
| 361 *bitmap.get(), hotspot); | 361 *bitmap.get(), hotspot, cursor_scale_); |
| 362 #elif defined(USE_X11) | 362 #elif defined(USE_X11) |
| 363 XcursorImage* image = ui::SkBitmapToXcursorImage(bitmap.get(), hotspot); | 363 XcursorImage* image = ui::SkBitmapToXcursorImage(bitmap.get(), hotspot); |
| 364 platform_cursor = ui::CreateReffedCustomXCursor(image); | 364 platform_cursor = ui::CreateReffedCustomXCursor(image); |
| 365 #endif | 365 #endif |
| 366 cursor_ = ui::kCursorCustom; | 366 cursor_ = ui::kCursorCustom; |
| 367 cursor_.SetPlatformCursor(platform_cursor); | 367 cursor_.SetPlatformCursor(platform_cursor); |
| 368 #if defined(USE_OZONE) | 368 #if defined(USE_OZONE) |
| 369 ui::CursorFactoryOzone::GetInstance()->UnrefImageCursor(platform_cursor); | 369 ui::CursorFactoryOzone::GetInstance()->UnrefImageCursor(platform_cursor); |
| 370 #elif defined(USE_X11) | 370 #elif defined(USE_X11) |
| 371 ui::UnrefCustomXCursor(platform_cursor); | 371 ui::UnrefCustomXCursor(platform_cursor); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 382 if (!root_window) | 382 if (!root_window) |
| 383 return; | 383 return; |
| 384 | 384 |
| 385 aura::client::CursorClient* cursor_client = | 385 aura::client::CursorClient* cursor_client = |
| 386 aura::client::GetCursorClient(root_window); | 386 aura::client::GetCursorClient(root_window); |
| 387 if (cursor_client) | 387 if (cursor_client) |
| 388 cursor_client->SetCursor(cursor_); | 388 cursor_client->SetCursor(cursor_); |
| 389 } | 389 } |
| 390 | 390 |
| 391 } // namespace exo | 391 } // namespace exo |
| OLD | NEW |