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

Unified Diff: ui/ozone/platform/drm/cursor_proxy_mojo.cc

Issue 2156093004: Use mojo for cursor control in ozone drm (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: corrected small code oversight Created 4 years, 5 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
« no previous file with comments | « ui/ozone/platform/drm/cursor_proxy_mojo.h ('k') | ui/ozone/platform/drm/gpu/drm_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/cursor_proxy_mojo.cc
diff --git a/ui/ozone/platform/drm/cursor_proxy_mojo.cc b/ui/ozone/platform/drm/cursor_proxy_mojo.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b56495da4ad0ebbcb747e2083db5cd7aa0b7e895
--- /dev/null
+++ b/ui/ozone/platform/drm/cursor_proxy_mojo.cc
@@ -0,0 +1,43 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/ozone/platform/drm/cursor_proxy_mojo.h"
+
+#include "services/shell/public/cpp/connector.h"
+
+namespace ui {
+
+CursorProxyMojo::CursorProxyMojo(shell::Connector* connector)
+ : connector_(connector->Clone()) {
+ connector->ConnectToInterface("mojo:ui", &main_cursor_ptr_);
+}
+
+void CursorProxyMojo::InitializeOnEvdev() {
+ evdev_ref_ = base::PlatformThread::CurrentRef();
+ connector_->ConnectToInterface("mojo:ui", &evdev_cursor_ptr_);
+}
+
+CursorProxyMojo::~CursorProxyMojo() {}
+
+void CursorProxyMojo::CursorSet(gfx::AcceleratedWidget widget,
+ const std::vector<SkBitmap>& bitmaps,
+ const gfx::Point& location,
+ int frame_delay_ms) {
+ if (evdev_ref_ == base::PlatformThread::CurrentRef()) {
+ evdev_cursor_ptr_->SetCursor(widget, bitmaps, location, frame_delay_ms);
+ } else {
+ main_cursor_ptr_->SetCursor(widget, bitmaps, location, frame_delay_ms);
+ }
+}
+
+void CursorProxyMojo::Move(gfx::AcceleratedWidget widget,
+ const gfx::Point& location) {
+ if (evdev_ref_ == base::PlatformThread::CurrentRef()) {
+ evdev_cursor_ptr_->MoveCursor(widget, location);
+ } else {
+ main_cursor_ptr_->MoveCursor(widget, location);
+ }
+}
+
+} // namespace ui
« no previous file with comments | « ui/ozone/platform/drm/cursor_proxy_mojo.h ('k') | ui/ozone/platform/drm/gpu/drm_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698