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

Unified Diff: services/ui/ws/platform_display.cc

Issue 2268563003: Replaced CursorLoader in PlatformDisplay with a ImageCursor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add display::Display PlatformDisplayDelegate::GetDisplay() Created 4 years, 4 months 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 side-by-side diff with in-line comments
Download patch
Index: services/ui/ws/platform_display.cc
diff --git a/services/ui/ws/platform_display.cc b/services/ui/ws/platform_display.cc
index 88d843592fc61a5708d63105595cd509515746ee..1317c492b3416f477a825878610fd61abee1ec6a 100644
--- a/services/ui/ws/platform_display.cc
+++ b/services/ui/ws/platform_display.cc
@@ -13,12 +13,13 @@
#include "services/shell/public/cpp/connector.h"
#include "services/ui/surfaces/display_compositor.h"
#include "services/ui/surfaces/surfaces_state.h"
+#include "services/ui/ws/display.h"
#include "services/ui/ws/platform_display_factory.h"
#include "services/ui/ws/platform_display_init_params.h"
#include "services/ui/ws/server_window.h"
#include "services/ui/ws/window_coordinate_conversions.h"
#include "third_party/skia/include/core/SkXfermode.h"
-#include "ui/base/cursor/cursor_loader.h"
+#include "ui/base/cursor/image_cursors.h"
#include "ui/display/display.h"
#include "ui/events/event.h"
#include "ui/events/event_utils.h"
@@ -56,7 +57,7 @@ DefaultPlatformDisplay::DefaultPlatformDisplay(
: id_(init_params.display_id),
platform_screen_(init_params.platform_screen),
#if !defined(OS_ANDROID)
- cursor_loader_(ui::CursorLoader::Create()),
+ image_cursors_(new ImageCursors),
#endif
frame_generator_(new FrameGenerator(this, init_params.surfaces_state)) {
metrics_.bounds = init_params.display_bounds;
@@ -77,6 +78,12 @@ void DefaultPlatformDisplay::Init(PlatformDisplayDelegate* delegate) {
#else
NOTREACHED() << "Unsupported platform";
#endif
+
+#if !defined(OS_ANDROID)
+ image_cursors_->SetDisplay(
+ static_cast<ui::ws::Display*>(delegate_)->ToDisplay(),
sadrul 2016/08/22 15:18:14 Use the newly added delegate function.
Alex Z. 2016/08/22 15:26:02 Done.
+ GetDeviceScaleFactor());
+#endif
platform_window_->SetBounds(metrics_.bounds);
platform_window_->Show();
}
@@ -132,7 +139,7 @@ void DefaultPlatformDisplay::SetCursorById(int32_t cursor_id) {
//
// We probably also need to deal with different DPIs.
ui::Cursor cursor(cursor_id);
- cursor_loader_->SetPlatformCursor(&cursor);
+ image_cursors_->SetPlatformCursor(&cursor);
platform_window_->SetCursor(cursor.platform());
#endif
}

Powered by Google App Engine
This is Rietveld 408576698