| OLD | NEW |
| 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/threading/thread_task_runner_handle.h" | 7 #include "base/threading/thread_task_runner_handle.h" |
| 8 #include "ipc/ipc_message.h" | 8 #include "ipc/ipc_message.h" |
| 9 #include "ipc/ipc_sender.h" | 9 #include "ipc/ipc_sender.h" |
| 10 #include "ui/ozone/common/gpu/ozone_gpu_messages.h" | 10 #include "ui/ozone/common/gpu/ozone_gpu_messages.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 DCHECK(drm_thread_->IsRunning()); | 195 DCHECK(drm_thread_->IsRunning()); |
| 196 auto callback = base::Bind(&DrmThreadMessageProxy::OnGetHDCPStateCallback, | 196 auto callback = base::Bind(&DrmThreadMessageProxy::OnGetHDCPStateCallback, |
| 197 weak_ptr_factory_.GetWeakPtr()); | 197 weak_ptr_factory_.GetWeakPtr()); |
| 198 drm_thread_->task_runner()->PostTask( | 198 drm_thread_->task_runner()->PostTask( |
| 199 FROM_HERE, | 199 FROM_HERE, |
| 200 base::Bind(&DrmThread::GetHDCPState, base::Unretained(drm_thread_), | 200 base::Bind(&DrmThread::GetHDCPState, base::Unretained(drm_thread_), |
| 201 display_id, CreateSafeCallback(callback))); | 201 display_id, CreateSafeCallback(callback))); |
| 202 } | 202 } |
| 203 | 203 |
| 204 void DrmThreadMessageProxy::OnSetHDCPState(int64_t display_id, | 204 void DrmThreadMessageProxy::OnSetHDCPState(int64_t display_id, |
| 205 HDCPState state) { | 205 display::HDCPState state) { |
| 206 DCHECK(drm_thread_->IsRunning()); | 206 DCHECK(drm_thread_->IsRunning()); |
| 207 auto callback = base::Bind(&DrmThreadMessageProxy::OnSetHDCPStateCallback, | 207 auto callback = base::Bind(&DrmThreadMessageProxy::OnSetHDCPStateCallback, |
| 208 weak_ptr_factory_.GetWeakPtr()); | 208 weak_ptr_factory_.GetWeakPtr()); |
| 209 drm_thread_->task_runner()->PostTask( | 209 drm_thread_->task_runner()->PostTask( |
| 210 FROM_HERE, | 210 FROM_HERE, |
| 211 base::Bind(&DrmThread::SetHDCPState, base::Unretained(drm_thread_), | 211 base::Bind(&DrmThread::SetHDCPState, base::Unretained(drm_thread_), |
| 212 display_id, state, CreateSafeCallback(callback))); | 212 display_id, state, CreateSafeCallback(callback))); |
| 213 } | 213 } |
| 214 | 214 |
| 215 void DrmThreadMessageProxy::OnSetColorCorrection( | 215 void DrmThreadMessageProxy::OnSetColorCorrection( |
| 216 int64_t id, | 216 int64_t id, |
| 217 const std::vector<GammaRampRGBEntry>& degamma_lut, | 217 const std::vector<display::GammaRampRGBEntry>& degamma_lut, |
| 218 const std::vector<GammaRampRGBEntry>& gamma_lut, | 218 const std::vector<display::GammaRampRGBEntry>& gamma_lut, |
| 219 const std::vector<float>& correction_matrix) { | 219 const std::vector<float>& correction_matrix) { |
| 220 DCHECK(drm_thread_->IsRunning()); | 220 DCHECK(drm_thread_->IsRunning()); |
| 221 drm_thread_->task_runner()->PostTask( | 221 drm_thread_->task_runner()->PostTask( |
| 222 FROM_HERE, | 222 FROM_HERE, |
| 223 base::Bind(&DrmThread::SetColorCorrection, base::Unretained(drm_thread_), | 223 base::Bind(&DrmThread::SetColorCorrection, base::Unretained(drm_thread_), |
| 224 id, degamma_lut, gamma_lut, correction_matrix)); | 224 id, degamma_lut, gamma_lut, correction_matrix)); |
| 225 } | 225 } |
| 226 | 226 |
| 227 void DrmThreadMessageProxy::OnCheckOverlayCapabilitiesCallback( | 227 void DrmThreadMessageProxy::OnCheckOverlayCapabilitiesCallback( |
| 228 gfx::AcceleratedWidget widget, | 228 gfx::AcceleratedWidget widget, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 248 | 248 |
| 249 void DrmThreadMessageProxy::OnTakeDisplayControlCallback(bool success) const { | 249 void DrmThreadMessageProxy::OnTakeDisplayControlCallback(bool success) const { |
| 250 sender_->Send(new OzoneHostMsg_DisplayControlTaken(success)); | 250 sender_->Send(new OzoneHostMsg_DisplayControlTaken(success)); |
| 251 } | 251 } |
| 252 | 252 |
| 253 void DrmThreadMessageProxy::OnRelinquishDisplayControlCallback( | 253 void DrmThreadMessageProxy::OnRelinquishDisplayControlCallback( |
| 254 bool success) const { | 254 bool success) const { |
| 255 sender_->Send(new OzoneHostMsg_DisplayControlRelinquished(success)); | 255 sender_->Send(new OzoneHostMsg_DisplayControlRelinquished(success)); |
| 256 } | 256 } |
| 257 | 257 |
| 258 void DrmThreadMessageProxy::OnGetHDCPStateCallback(int64_t display_id, | 258 void DrmThreadMessageProxy::OnGetHDCPStateCallback( |
| 259 bool success, | 259 int64_t display_id, |
| 260 HDCPState state) const { | 260 bool success, |
| 261 display::HDCPState state) const { |
| 261 sender_->Send(new OzoneHostMsg_HDCPStateReceived(display_id, success, state)); | 262 sender_->Send(new OzoneHostMsg_HDCPStateReceived(display_id, success, state)); |
| 262 } | 263 } |
| 263 | 264 |
| 264 void DrmThreadMessageProxy::OnSetHDCPStateCallback(int64_t display_id, | 265 void DrmThreadMessageProxy::OnSetHDCPStateCallback(int64_t display_id, |
| 265 bool success) const { | 266 bool success) const { |
| 266 sender_->Send(new OzoneHostMsg_HDCPStateUpdated(display_id, success)); | 267 sender_->Send(new OzoneHostMsg_HDCPStateUpdated(display_id, success)); |
| 267 } | 268 } |
| 268 | 269 |
| 269 } // namespace ui | 270 } // namespace ui |
| OLD | NEW |