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/host/drm_display_host.h" | 5 #include "ui/ozone/platform/drm/host/drm_display_host.h" |
6 | 6 |
7 #include "base/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
8 #include "ui/ozone/common/display_snapshot_proxy.h" | 8 #include "ui/ozone/common/display_snapshot_proxy.h" |
9 #include "ui/ozone/common/display_util.h" | 9 #include "ui/ozone/common/display_util.h" |
10 #include "ui/ozone/common/gpu/ozone_gpu_messages.h" | 10 #include "ui/ozone/common/gpu/ozone_gpu_messages.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 << snapshot_->display_id(); | 100 << snapshot_->display_id(); |
101 } | 101 } |
102 | 102 |
103 set_hdcp_callback_.Reset(); | 103 set_hdcp_callback_.Reset(); |
104 } | 104 } |
105 | 105 |
106 void DrmDisplayHost::SetGammaRamp(const std::vector<GammaRampRGBEntry>& lut) { | 106 void DrmDisplayHost::SetGammaRamp(const std::vector<GammaRampRGBEntry>& lut) { |
107 sender_->Send(new OzoneGpuMsg_SetGammaRamp(snapshot_->display_id(), lut)); | 107 sender_->Send(new OzoneGpuMsg_SetGammaRamp(snapshot_->display_id(), lut)); |
108 } | 108 } |
109 | 109 |
| 110 void DrmDisplayHost::SetColorCorrection( |
| 111 const std::vector<GammaRampRGBEntry>& degamma_lut, |
| 112 const std::vector<GammaRampRGBEntry>& gamma_lut, |
| 113 const float matrix[9]) { |
| 114 std::vector<float> correction_matrix; |
| 115 for (int i = 0; i < 9; ++i) { |
| 116 correction_matrix.push_back(matrix[i]); |
| 117 } |
| 118 |
| 119 sender_->Send(new OzoneGpuMsg_SetColorCorrection( |
| 120 snapshot_->display_id(), degamma_lut, gamma_lut, correction_matrix)); |
| 121 } |
| 122 |
110 void DrmDisplayHost::OnChannelEstablished() { | 123 void DrmDisplayHost::OnChannelEstablished() { |
111 is_dummy_ = false; | 124 is_dummy_ = false; |
112 | 125 |
113 // Note: These responses are done here since the OnChannelDestroyed() is | 126 // Note: These responses are done here since the OnChannelDestroyed() is |
114 // called after OnChannelEstablished(). | 127 // called after OnChannelEstablished(). |
115 ClearCallbacks(); | 128 ClearCallbacks(); |
116 } | 129 } |
117 | 130 |
118 void DrmDisplayHost::OnChannelDestroyed() { | 131 void DrmDisplayHost::OnChannelDestroyed() { |
119 } | 132 } |
120 | 133 |
121 void DrmDisplayHost::ClearCallbacks() { | 134 void DrmDisplayHost::ClearCallbacks() { |
122 if (!configure_callback_.is_null()) | 135 if (!configure_callback_.is_null()) |
123 OnDisplayConfigured(false); | 136 OnDisplayConfigured(false); |
124 if (!get_hdcp_callback_.is_null()) | 137 if (!get_hdcp_callback_.is_null()) |
125 OnHDCPStateReceived(false, HDCP_STATE_UNDESIRED); | 138 OnHDCPStateReceived(false, HDCP_STATE_UNDESIRED); |
126 if (!set_hdcp_callback_.is_null()) | 139 if (!set_hdcp_callback_.is_null()) |
127 OnHDCPStateUpdated(false); | 140 OnHDCPStateUpdated(false); |
128 } | 141 } |
129 | 142 |
130 } // namespace ui | 143 } // namespace ui |
OLD | NEW |