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

Side by Side Diff: ui/ozone/platform/drm/host/drm_native_display_delegate.cc

Issue 1028563003: Load and apply a vcgt table from an ICC file to the internal display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use a vectore of tuples of RGB components for IPC Created 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_native_display_delegate.h" 5 #include "ui/ozone/platform/drm/host/drm_native_display_delegate.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
11 #include "base/threading/thread_restrictions.h" 11 #include "base/threading/thread_restrictions.h"
12 #include "base/threading/worker_pool.h" 12 #include "base/threading/worker_pool.h"
13 #include "base/tuple.h"
13 #include "ui/display/types/display_snapshot.h" 14 #include "ui/display/types/display_snapshot.h"
14 #include "ui/display/types/native_display_observer.h" 15 #include "ui/display/types/native_display_observer.h"
15 #include "ui/events/ozone/device/device_event.h" 16 #include "ui/events/ozone/device/device_event.h"
16 #include "ui/events/ozone/device/device_manager.h" 17 #include "ui/events/ozone/device/device_manager.h"
17 #include "ui/ozone/common/display_snapshot_proxy.h" 18 #include "ui/ozone/common/display_snapshot_proxy.h"
18 #include "ui/ozone/common/display_util.h" 19 #include "ui/ozone/common/display_util.h"
19 #include "ui/ozone/common/gpu/ozone_gpu_messages.h" 20 #include "ui/ozone/common/gpu/ozone_gpu_messages.h"
20 #include "ui/ozone/platform/drm/host/display_manager.h" 21 #include "ui/ozone/platform/drm/host/display_manager.h"
21 #include "ui/ozone/platform/drm/host/drm_gpu_platform_support_host.h" 22 #include "ui/ozone/platform/drm/host/drm_gpu_platform_support_host.h"
22 23
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 return std::vector<ColorCalibrationProfile>(); 204 return std::vector<ColorCalibrationProfile>();
204 } 205 }
205 206
206 bool DrmNativeDisplayDelegate::SetColorCalibrationProfile( 207 bool DrmNativeDisplayDelegate::SetColorCalibrationProfile(
207 const DisplaySnapshot& output, 208 const DisplaySnapshot& output,
208 ColorCalibrationProfile new_profile) { 209 ColorCalibrationProfile new_profile) {
209 NOTIMPLEMENTED(); 210 NOTIMPLEMENTED();
210 return false; 211 return false;
211 } 212 }
212 213
214 bool DrmNativeDisplayDelegate::SetGammaRamp(const ui::DisplaySnapshot& output,
215 const std::vector<uint16_t>& r,
216 const std::vector<uint16_t>& g,
217 const std::vector<uint16_t>& b) {
218 if (r.size() != g.size() || g.size() != b.size())
219 return false;
220
221 GammaRampRGBData lut;
222 for (unsigned int i = 0; i < r.size(); ++i) {
223 lut.push_back(MakeTuple(r[i], g[i], b[i]));
224 }
225 proxy_->Send(new OzoneGpuMsg_SetGammaRamp(output.display_id(), lut));
226 return true;
227 }
228
213 void DrmNativeDisplayDelegate::AddObserver(NativeDisplayObserver* observer) { 229 void DrmNativeDisplayDelegate::AddObserver(NativeDisplayObserver* observer) {
214 observers_.AddObserver(observer); 230 observers_.AddObserver(observer);
215 } 231 }
216 232
217 void DrmNativeDisplayDelegate::RemoveObserver(NativeDisplayObserver* observer) { 233 void DrmNativeDisplayDelegate::RemoveObserver(NativeDisplayObserver* observer) {
218 observers_.RemoveObserver(observer); 234 observers_.RemoveObserver(observer);
219 } 235 }
220 236
221 void DrmNativeDisplayDelegate::OnDeviceEvent(const DeviceEvent& event) { 237 void DrmNativeDisplayDelegate::OnDeviceEvent(const DeviceEvent& event) {
222 if (event.device_type() != DeviceEvent::DISPLAY) 238 if (event.device_type() != DeviceEvent::DISPLAY)
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 configure_callback_map_.erase(it); 350 configure_callback_map_.erase(it);
335 } 351 }
336 } 352 }
337 353
338 void DrmNativeDisplayDelegate::RunUpdateDisplaysCallback( 354 void DrmNativeDisplayDelegate::RunUpdateDisplaysCallback(
339 const GetDisplaysCallback& callback) const { 355 const GetDisplaysCallback& callback) const {
340 callback.Run(displays_.get()); 356 callback.Run(displays_.get());
341 } 357 }
342 358
343 } // namespace ui 359 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698