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

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

Issue 2894523007: Use display::DisplayMode in ozone/drm/gpu (Closed)
Patch Set: Created 3 years, 7 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/display/types/display_snapshot_mojo.h"
dnicoara 2017/05/23 18:48:20 Is this include required?
12 #include "ui/ozone/platform/drm/common/drm_util.h"
11 #include "ui/ozone/platform/drm/gpu/drm_thread.h" 13 #include "ui/ozone/platform/drm/gpu/drm_thread.h"
12 #include "ui/ozone/platform/drm/gpu/proxy_helpers.h" 14 #include "ui/ozone/platform/drm/gpu/proxy_helpers.h"
13 #include "ui/ozone/platform/drm/host/drm_display_host_manager.h" 15 #include "ui/ozone/platform/drm/host/drm_display_host_manager.h"
14 #include "ui/ozone/platform/drm/host/drm_overlay_manager.h" 16 #include "ui/ozone/platform/drm/host/drm_overlay_manager.h"
15 17
16 namespace ui { 18 namespace ui {
17 19
18 CursorProxyThread::CursorProxyThread(MusThreadProxy* mus_thread_proxy) 20 CursorProxyThread::CursorProxyThread(MusThreadProxy* mus_thread_proxy)
19 : mus_thread_proxy_(mus_thread_proxy) {} 21 : mus_thread_proxy_(mus_thread_proxy) {}
20 CursorProxyThread::~CursorProxyThread() {} 22 CursorProxyThread::~CursorProxyThread() {}
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 weak_ptr_factory_.GetWeakPtr()); 206 weak_ptr_factory_.GetWeakPtr());
205 auto safe_callback = CreateSafeOnceCallback(std::move(callback)); 207 auto safe_callback = CreateSafeOnceCallback(std::move(callback));
206 drm_thread_->task_runner()->PostTask( 208 drm_thread_->task_runner()->PostTask(
207 FROM_HERE, 209 FROM_HERE,
208 base::BindOnce(&DrmThread::RefreshNativeDisplays, 210 base::BindOnce(&DrmThread::RefreshNativeDisplays,
209 base::Unretained(drm_thread_), std::move(safe_callback))); 211 base::Unretained(drm_thread_), std::move(safe_callback)));
210 return true; 212 return true;
211 } 213 }
212 214
213 bool MusThreadProxy::GpuConfigureNativeDisplay(int64_t id, 215 bool MusThreadProxy::GpuConfigureNativeDisplay(int64_t id,
214 const DisplayMode_Params& mode, 216 const DisplayMode_Params& pmode,
215 const gfx::Point& origin) { 217 const gfx::Point& origin) {
216 DCHECK(drm_thread_->IsRunning()); 218 DCHECK(drm_thread_->IsRunning());
217 DCHECK(on_window_server_thread_.CalledOnValidThread()); 219 DCHECK(on_window_server_thread_.CalledOnValidThread());
218 220
221 auto mode = CreateDisplayModeFromParams(pmode);
219 auto callback = 222 auto callback =
220 base::BindOnce(&MusThreadProxy::GpuConfigureNativeDisplayCallback, 223 base::BindOnce(&MusThreadProxy::GpuConfigureNativeDisplayCallback,
221 weak_ptr_factory_.GetWeakPtr()); 224 weak_ptr_factory_.GetWeakPtr());
222 auto safe_callback = CreateSafeOnceCallback(std::move(callback)); 225 auto safe_callback = CreateSafeOnceCallback(std::move(callback));
223 drm_thread_->task_runner()->PostTask( 226 drm_thread_->task_runner()->PostTask(
224 FROM_HERE, base::BindOnce(&DrmThread::ConfigureNativeDisplay, 227 FROM_HERE,
225 base::Unretained(drm_thread_), id, mode, origin, 228 base::BindOnce(&DrmThread::ConfigureNativeDisplay,
226 std::move(safe_callback))); 229 base::Unretained(drm_thread_), id, std::move(mode), origin,
230 std::move(safe_callback)));
227 return true; 231 return true;
228 } 232 }
229 233
230 bool MusThreadProxy::GpuDisableNativeDisplay(int64_t id) { 234 bool MusThreadProxy::GpuDisableNativeDisplay(int64_t id) {
231 DCHECK(drm_thread_->IsRunning()); 235 DCHECK(drm_thread_->IsRunning());
232 DCHECK(on_window_server_thread_.CalledOnValidThread()); 236 DCHECK(on_window_server_thread_.CalledOnValidThread());
233 auto callback = 237 auto callback =
234 base::BindOnce(&MusThreadProxy::GpuDisableNativeDisplayCallback, 238 base::BindOnce(&MusThreadProxy::GpuDisableNativeDisplayCallback,
235 weak_ptr_factory_.GetWeakPtr()); 239 weak_ptr_factory_.GetWeakPtr());
236 auto safe_callback = CreateSafeOnceCallback(std::move(callback)); 240 auto safe_callback = CreateSafeOnceCallback(std::move(callback));
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 display_manager_->GpuReceivedHDCPState(display_id, success, state); 374 display_manager_->GpuReceivedHDCPState(display_id, success, state);
371 } 375 }
372 376
373 void MusThreadProxy::GpuSetHDCPStateCallback(int64_t display_id, 377 void MusThreadProxy::GpuSetHDCPStateCallback(int64_t display_id,
374 bool success) const { 378 bool success) const {
375 DCHECK(on_window_server_thread_.CalledOnValidThread()); 379 DCHECK(on_window_server_thread_.CalledOnValidThread());
376 display_manager_->GpuUpdatedHDCPState(display_id, success); 380 display_manager_->GpuUpdatedHDCPState(display_id, success);
377 } 381 }
378 382
379 } // namespace ui 383 } // namespace ui
OLDNEW
« ui/ozone/platform/drm/gpu/screen_manager.cc ('K') | « ui/ozone/platform/drm/host/drm_display_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698