Index: ui/ozone/platform/drm/gpu/drm_gpu_display_manager.cc |
diff --git a/ui/ozone/platform/drm/gpu/drm_gpu_display_manager.cc b/ui/ozone/platform/drm/gpu/drm_gpu_display_manager.cc |
index 60b335bfaa429bcc04c425c8af45ec900b8b6dce..9a76c190647b2d50c279f08d9030aa1753809a7c 100644 |
--- a/ui/ozone/platform/drm/gpu/drm_gpu_display_manager.cc |
+++ b/ui/ozone/platform/drm/gpu/drm_gpu_display_manager.cc |
@@ -236,6 +236,26 @@ void DrmGpuDisplayManager::RemoveGraphicsDevice(const base::FilePath& path) { |
devices_.erase(it); |
} |
+void DrmGpuDisplayManager::SetGammaRamp(int64_t id, |
+ const std::vector<uint16_t>& r, |
+ const std::vector<uint16_t>& g, |
+ const std::vector<uint16_t>& b) { |
+ DrmDisplaySnapshot* display = FindDisplaySnapshot(id); |
+ if (!display) { |
+ LOG(ERROR) << "There is no display with ID " << id; |
+ return; |
+ } |
+ |
+ if (r.size() != g.size() || g.size() != b.size()) { |
+ LOG(ERROR) << "Gamma ramp channels must all the same length."; |
spang
2015/04/17 19:07:42
I think you need a "return" here.
If r.size() > g
robert.bradford
2015/04/27 13:49:33
Done.
|
+ } |
+ |
+ if (!display->drm()->SetGammaRamp(display->crtc(), r, g, b)) { |
+ LOG(ERROR) << "Failed to set gamma ramp for display: crtc_id = " |
+ << display->crtc() << " size = " << r.size(); |
+ } |
+} |
+ |
DrmDisplaySnapshot* DrmGpuDisplayManager::FindDisplaySnapshot(int64_t id) { |
for (size_t i = 0; i < cached_displays_.size(); ++i) |
if (cached_displays_[i]->display_id() == id) |