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

Side by Side Diff: ui/ozone/platform/drm/gpu/drm_thread_message_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 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 "ui/ozone/platform/drm/gpu/drm_thread_message_proxy.h" 5 #include "ui/ozone/platform/drm/gpu/drm_thread_message_proxy.h"
6 6
7 #include "base/task_runner_util.h"
7 #include "base/threading/thread_task_runner_handle.h" 8 #include "base/threading/thread_task_runner_handle.h"
8 #include "ipc/ipc_message.h" 9 #include "ipc/ipc_message.h"
9 #include "ipc/ipc_sender.h" 10 #include "ipc/ipc_sender.h"
11 #include "ui/display/types/display_snapshot_mojo.h"
dnicoara 2017/05/23 18:48:20 Is this required?
rjkroege 2017/05/23 22:08:18 nope. part of the other CL that's not done yet. Re
10 #include "ui/ozone/common/gpu/ozone_gpu_messages.h" 12 #include "ui/ozone/common/gpu/ozone_gpu_messages.h"
13 #include "ui/ozone/platform/drm/common/drm_util.h"
11 #include "ui/ozone/platform/drm/gpu/drm_thread_proxy.h" 14 #include "ui/ozone/platform/drm/gpu/drm_thread_proxy.h"
12 #include "ui/ozone/platform/drm/gpu/proxy_helpers.h" 15 #include "ui/ozone/platform/drm/gpu/proxy_helpers.h"
13 16
14 namespace ui { 17 namespace ui {
15 18
16 DrmThreadMessageProxy::DrmThreadMessageProxy() : weak_ptr_factory_(this) {} 19 DrmThreadMessageProxy::DrmThreadMessageProxy() : weak_ptr_factory_(this) {}
17 20
18 DrmThreadMessageProxy::~DrmThreadMessageProxy() {} 21 DrmThreadMessageProxy::~DrmThreadMessageProxy() {}
19 22
20 void DrmThreadMessageProxy::SetDrmThread(DrmThread* thread) { 23 void DrmThreadMessageProxy::SetDrmThread(DrmThread* thread) {
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 FROM_HERE, 132 FROM_HERE,
130 base::BindOnce(&DrmThread::RefreshNativeDisplays, 133 base::BindOnce(&DrmThread::RefreshNativeDisplays,
131 base::Unretained(drm_thread_), std::move(safe_callback))); 134 base::Unretained(drm_thread_), std::move(safe_callback)));
132 } 135 }
133 136
134 void DrmThreadMessageProxy::OnConfigureNativeDisplay( 137 void DrmThreadMessageProxy::OnConfigureNativeDisplay(
135 int64_t id, 138 int64_t id,
136 const DisplayMode_Params& mode, 139 const DisplayMode_Params& mode,
137 const gfx::Point& origin) { 140 const gfx::Point& origin) {
138 DCHECK(drm_thread_->IsRunning()); 141 DCHECK(drm_thread_->IsRunning());
142 auto dmode = CreateDisplayModeFromParams(mode);
139 auto callback = 143 auto callback =
140 base::BindOnce(&DrmThreadMessageProxy::OnConfigureNativeDisplayCallback, 144 base::BindOnce(&DrmThreadMessageProxy::OnConfigureNativeDisplayCallback,
141 weak_ptr_factory_.GetWeakPtr()); 145 weak_ptr_factory_.GetWeakPtr());
142 auto safe_callback = CreateSafeOnceCallback(std::move(callback)); 146 auto safe_callback = CreateSafeOnceCallback(std::move(callback));
143 drm_thread_->task_runner()->PostTask( 147 drm_thread_->task_runner()->PostTask(
144 FROM_HERE, base::BindOnce(&DrmThread::ConfigureNativeDisplay, 148 FROM_HERE,
145 base::Unretained(drm_thread_), id, mode, origin, 149 base::BindOnce(&DrmThread::ConfigureNativeDisplay,
146 std::move(safe_callback))); 150 base::Unretained(drm_thread_), id, std::move(dmode),
151 origin, std::move(safe_callback)));
147 } 152 }
148 153
149 void DrmThreadMessageProxy::OnDisableNativeDisplay(int64_t id) { 154 void DrmThreadMessageProxy::OnDisableNativeDisplay(int64_t id) {
150 DCHECK(drm_thread_->IsRunning()); 155 DCHECK(drm_thread_->IsRunning());
151 auto callback = 156 auto callback =
152 base::BindOnce(&DrmThreadMessageProxy::OnDisableNativeDisplayCallback, 157 base::BindOnce(&DrmThreadMessageProxy::OnDisableNativeDisplayCallback,
153 weak_ptr_factory_.GetWeakPtr()); 158 weak_ptr_factory_.GetWeakPtr());
154 auto safe_callback = CreateSafeOnceCallback(std::move(callback)); 159 auto safe_callback = CreateSafeOnceCallback(std::move(callback));
155 drm_thread_->task_runner()->PostTask( 160 drm_thread_->task_runner()->PostTask(
156 FROM_HERE, base::BindOnce(&DrmThread::DisableNativeDisplay, 161 FROM_HERE, base::BindOnce(&DrmThread::DisableNativeDisplay,
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 display::HDCPState state) const { 275 display::HDCPState state) const {
271 sender_->Send(new OzoneHostMsg_HDCPStateReceived(display_id, success, state)); 276 sender_->Send(new OzoneHostMsg_HDCPStateReceived(display_id, success, state));
272 } 277 }
273 278
274 void DrmThreadMessageProxy::OnSetHDCPStateCallback(int64_t display_id, 279 void DrmThreadMessageProxy::OnSetHDCPStateCallback(int64_t display_id,
275 bool success) const { 280 bool success) const {
276 sender_->Send(new OzoneHostMsg_HDCPStateUpdated(display_id, success)); 281 sender_->Send(new OzoneHostMsg_HDCPStateUpdated(display_id, success));
277 } 282 }
278 283
279 } // namespace ui 284 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698