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/thread_task_runner_handle.h" | 7 #include "base/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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 IPC_MESSAGE_HANDLER(OzoneGpuMsg_DisableNativeDisplay, | 44 IPC_MESSAGE_HANDLER(OzoneGpuMsg_DisableNativeDisplay, |
45 OnDisableNativeDisplay) | 45 OnDisableNativeDisplay) |
46 IPC_MESSAGE_HANDLER(OzoneGpuMsg_TakeDisplayControl, OnTakeDisplayControl) | 46 IPC_MESSAGE_HANDLER(OzoneGpuMsg_TakeDisplayControl, OnTakeDisplayControl) |
47 IPC_MESSAGE_HANDLER(OzoneGpuMsg_RelinquishDisplayControl, | 47 IPC_MESSAGE_HANDLER(OzoneGpuMsg_RelinquishDisplayControl, |
48 OnRelinquishDisplayControl) | 48 OnRelinquishDisplayControl) |
49 IPC_MESSAGE_HANDLER(OzoneGpuMsg_AddGraphicsDevice, OnAddGraphicsDevice) | 49 IPC_MESSAGE_HANDLER(OzoneGpuMsg_AddGraphicsDevice, OnAddGraphicsDevice) |
50 IPC_MESSAGE_HANDLER(OzoneGpuMsg_RemoveGraphicsDevice, | 50 IPC_MESSAGE_HANDLER(OzoneGpuMsg_RemoveGraphicsDevice, |
51 OnRemoveGraphicsDevice) | 51 OnRemoveGraphicsDevice) |
52 IPC_MESSAGE_HANDLER(OzoneGpuMsg_GetHDCPState, OnGetHDCPState) | 52 IPC_MESSAGE_HANDLER(OzoneGpuMsg_GetHDCPState, OnGetHDCPState) |
53 IPC_MESSAGE_HANDLER(OzoneGpuMsg_SetHDCPState, OnSetHDCPState) | 53 IPC_MESSAGE_HANDLER(OzoneGpuMsg_SetHDCPState, OnSetHDCPState) |
54 IPC_MESSAGE_HANDLER(OzoneGpuMsg_SetGammaRamp, OnSetGammaRamp) | 54 IPC_MESSAGE_HANDLER(OzoneGpuMsg_SetColorCorrection, OnSetColorCorrection) |
55 IPC_MESSAGE_HANDLER(OzoneGpuMsg_CheckOverlayCapabilities, | 55 IPC_MESSAGE_HANDLER(OzoneGpuMsg_CheckOverlayCapabilities, |
56 OnCheckOverlayCapabilities) | 56 OnCheckOverlayCapabilities) |
57 IPC_MESSAGE_UNHANDLED(handled = false) | 57 IPC_MESSAGE_UNHANDLED(handled = false) |
58 IPC_END_MESSAGE_MAP() | 58 IPC_END_MESSAGE_MAP() |
59 | 59 |
60 return handled; | 60 return handled; |
61 } | 61 } |
62 | 62 |
63 void DrmThreadMessageProxy::OnCreateWindow(gfx::AcceleratedWidget widget) { | 63 void DrmThreadMessageProxy::OnCreateWindow(gfx::AcceleratedWidget widget) { |
64 DCHECK(drm_thread_->IsRunning()); | 64 DCHECK(drm_thread_->IsRunning()); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 HDCPState state) { | 202 HDCPState state) { |
203 DCHECK(drm_thread_->IsRunning()); | 203 DCHECK(drm_thread_->IsRunning()); |
204 auto callback = base::Bind(&DrmThreadMessageProxy::OnSetHDCPStateCallback, | 204 auto callback = base::Bind(&DrmThreadMessageProxy::OnSetHDCPStateCallback, |
205 weak_ptr_factory_.GetWeakPtr()); | 205 weak_ptr_factory_.GetWeakPtr()); |
206 drm_thread_->task_runner()->PostTask( | 206 drm_thread_->task_runner()->PostTask( |
207 FROM_HERE, | 207 FROM_HERE, |
208 base::Bind(&DrmThread::SetHDCPState, base::Unretained(drm_thread_), | 208 base::Bind(&DrmThread::SetHDCPState, base::Unretained(drm_thread_), |
209 display_id, state, CreateSafeCallback(callback))); | 209 display_id, state, CreateSafeCallback(callback))); |
210 } | 210 } |
211 | 211 |
212 void DrmThreadMessageProxy::OnSetGammaRamp( | 212 void DrmThreadMessageProxy::OnSetColorCorrection( |
213 int64_t id, | 213 int64_t id, |
214 const std::vector<GammaRampRGBEntry>& lut) { | 214 const std::vector<GammaRampRGBEntry>& degamma_lut, |
| 215 const std::vector<GammaRampRGBEntry>& gamma_lut, |
| 216 const std::vector<float>& correction_matrix) { |
215 DCHECK(drm_thread_->IsRunning()); | 217 DCHECK(drm_thread_->IsRunning()); |
216 drm_thread_->task_runner()->PostTask( | 218 drm_thread_->task_runner()->PostTask( |
217 FROM_HERE, base::Bind(&DrmThread::SetGammaRamp, | 219 FROM_HERE, |
218 base::Unretained(drm_thread_), id, lut)); | 220 base::Bind(&DrmThread::SetColorCorrection, base::Unretained(drm_thread_), |
| 221 id, degamma_lut, gamma_lut, correction_matrix)); |
219 } | 222 } |
220 | 223 |
221 void DrmThreadMessageProxy::OnCheckOverlayCapabilitiesCallback( | 224 void DrmThreadMessageProxy::OnCheckOverlayCapabilitiesCallback( |
222 gfx::AcceleratedWidget widget, | 225 gfx::AcceleratedWidget widget, |
223 const std::vector<OverlayCheck_Params>& overlays) const { | 226 const std::vector<OverlayCheck_Params>& overlays) const { |
224 sender_->Send(new OzoneHostMsg_OverlayCapabilitiesReceived(widget, overlays)); | 227 sender_->Send(new OzoneHostMsg_OverlayCapabilitiesReceived(widget, overlays)); |
225 } | 228 } |
226 | 229 |
227 void DrmThreadMessageProxy::OnRefreshNativeDisplaysCallback( | 230 void DrmThreadMessageProxy::OnRefreshNativeDisplaysCallback( |
228 const std::vector<DisplaySnapshot_Params>& displays) const { | 231 const std::vector<DisplaySnapshot_Params>& displays) const { |
(...skipping 25 matching lines...) Expand all Loading... |
254 HDCPState state) const { | 257 HDCPState state) const { |
255 sender_->Send(new OzoneHostMsg_HDCPStateReceived(display_id, success, state)); | 258 sender_->Send(new OzoneHostMsg_HDCPStateReceived(display_id, success, state)); |
256 } | 259 } |
257 | 260 |
258 void DrmThreadMessageProxy::OnSetHDCPStateCallback(int64_t display_id, | 261 void DrmThreadMessageProxy::OnSetHDCPStateCallback(int64_t display_id, |
259 bool success) const { | 262 bool success) const { |
260 sender_->Send(new OzoneHostMsg_HDCPStateUpdated(display_id, success)); | 263 sender_->Send(new OzoneHostMsg_HDCPStateUpdated(display_id, success)); |
261 } | 264 } |
262 | 265 |
263 } // namespace ui | 266 } // namespace ui |
OLD | NEW |