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

Side by Side Diff: ui/ozone/platform/drm/mus_thread_proxy.cc

Issue 2156093004: Use mojo for cursor control in ozone drm (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/drm/mus_thread_proxy.h" 5 #include "ui/ozone/platform/drm/mus_thread_proxy.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 #include "base/task_runner.h" 9 #include "base/task_runner.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
11 #include "ui/ozone/platform/drm/gpu/drm_thread.h" 11 #include "ui/ozone/platform/drm/gpu/drm_thread.h"
12 #include "ui/ozone/platform/drm/gpu/proxy_helpers.h" 12 #include "ui/ozone/platform/drm/gpu/proxy_helpers.h"
13 #include "ui/ozone/platform/drm/host/drm_display_host_manager.h" 13 #include "ui/ozone/platform/drm/host/drm_display_host_manager.h"
14 #include "ui/ozone/platform/drm/host/drm_overlay_manager.h" 14 #include "ui/ozone/platform/drm/host/drm_overlay_manager.h"
15 15
16 namespace ui { 16 namespace ui {
17 17
18 CursorProxyThread::CursorProxyThread(MusThreadProxy* mus_thread_proxy)
19 : mus_thread_proxy_(mus_thread_proxy) {}
20 CursorProxyThread::~CursorProxyThread() {}
21
22 void CursorProxyThread::CursorSet(gfx::AcceleratedWidget window,
23 const std::vector<SkBitmap>& bitmaps,
24 const gfx::Point& point,
25 int frame_delay_ms) {
26 mus_thread_proxy_->CursorSet(window, bitmaps, point, frame_delay_ms);
27 }
28 void CursorProxyThread::Move(gfx::AcceleratedWidget window,
29 const gfx::Point& point) {
30 mus_thread_proxy_->Move(window, point);
31 }
32 void CursorProxyThread::MoveEvdev(gfx::AcceleratedWidget window,
33 const gfx::Point& point) {
34 mus_thread_proxy_->MoveEvdev(window, point);
35 }
36 void CursorProxyThread::InitializeOnEvdev() {
37 mus_thread_proxy_->InitializeOnEvdev();
38 }
39
18 MusThreadProxy::MusThreadProxy() 40 MusThreadProxy::MusThreadProxy()
19 : ws_task_runner_(base::ThreadTaskRunnerHandle::Get()), 41 : ws_task_runner_(base::ThreadTaskRunnerHandle::Get()),
20 drm_thread_(nullptr), 42 drm_thread_(nullptr),
21 weak_ptr_factory_(this) {} 43 weak_ptr_factory_(this) {}
22 44
23 void MusThreadProxy::InitializeOnEvdev() {} 45 void MusThreadProxy::InitializeOnEvdev() {}
24 46
25 MusThreadProxy::~MusThreadProxy() { 47 MusThreadProxy::~MusThreadProxy() {
26 DCHECK(on_window_server_thread_.CalledOnValidThread()); 48 DCHECK(on_window_server_thread_.CalledOnValidThread());
27 FOR_EACH_OBSERVER(GpuThreadObserver, gpu_thread_observers_, 49 FOR_EACH_OBSERVER(GpuThreadObserver, gpu_thread_observers_,
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 157
136 void MusThreadProxy::Move(gfx::AcceleratedWidget widget, 158 void MusThreadProxy::Move(gfx::AcceleratedWidget widget,
137 const gfx::Point& location) { 159 const gfx::Point& location) {
138 // NOTE: Input events skip the main thread to avoid jank. 160 // NOTE: Input events skip the main thread to avoid jank.
139 DCHECK(drm_thread_->IsRunning()); 161 DCHECK(drm_thread_->IsRunning());
140 drm_thread_->task_runner()->PostTask( 162 drm_thread_->task_runner()->PostTask(
141 FROM_HERE, base::Bind(&DrmThread::MoveCursor, 163 FROM_HERE, base::Bind(&DrmThread::MoveCursor,
142 base::Unretained(drm_thread_), widget, location)); 164 base::Unretained(drm_thread_), widget, location));
143 } 165 }
144 166
167 void MusThreadProxy::MoveEvdev(gfx::AcceleratedWidget widget,
168 const gfx::Point& location) {
169 Move(widget, location);
170 }
171
145 // Services needed for DrmOverlayManager. 172 // Services needed for DrmOverlayManager.
146 void MusThreadProxy::RegisterHandlerForDrmOverlayManager( 173 void MusThreadProxy::RegisterHandlerForDrmOverlayManager(
147 DrmOverlayManager* handler) { 174 DrmOverlayManager* handler) {
148 DCHECK(on_window_server_thread_.CalledOnValidThread()); 175 DCHECK(on_window_server_thread_.CalledOnValidThread());
149 overlay_manager_ = handler; 176 overlay_manager_ = handler;
150 } 177 }
151 178
152 void MusThreadProxy::UnRegisterHandlerForDrmOverlayManager() { 179 void MusThreadProxy::UnRegisterHandlerForDrmOverlayManager() {
153 DCHECK(on_window_server_thread_.CalledOnValidThread()); 180 DCHECK(on_window_server_thread_.CalledOnValidThread());
154 overlay_manager_ = nullptr; 181 overlay_manager_ = nullptr;
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 display_manager_->GpuReceivedHDCPState(display_id, success, state); 359 display_manager_->GpuReceivedHDCPState(display_id, success, state);
333 } 360 }
334 361
335 void MusThreadProxy::GpuSetHDCPStateCallback(int64_t display_id, 362 void MusThreadProxy::GpuSetHDCPStateCallback(int64_t display_id,
336 bool success) const { 363 bool success) const {
337 DCHECK(on_window_server_thread_.CalledOnValidThread()); 364 DCHECK(on_window_server_thread_.CalledOnValidThread());
338 display_manager_->GpuUpdatedHDCPState(display_id, success); 365 display_manager_->GpuUpdatedHDCPState(display_id, success);
339 } 366 }
340 367
341 } // namespace ui 368 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698