| 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.h" | 5 #include "ui/ozone/platform/drm/gpu/drm_thread.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 const gfx::Size& size, | 99 const gfx::Size& size, |
| 100 gfx::BufferFormat format, | 100 gfx::BufferFormat format, |
| 101 gfx::BufferUsage usage, | 101 gfx::BufferUsage usage, |
| 102 scoped_refptr<GbmBuffer>* buffer) { | 102 scoped_refptr<GbmBuffer>* buffer) { |
| 103 scoped_refptr<GbmDevice> gbm = | 103 scoped_refptr<GbmDevice> gbm = |
| 104 static_cast<GbmDevice*>(device_manager_->GetDrmDevice(widget).get()); | 104 static_cast<GbmDevice*>(device_manager_->GetDrmDevice(widget).get()); |
| 105 DCHECK(gbm); | 105 DCHECK(gbm); |
| 106 *buffer = GbmBuffer::CreateBuffer(gbm, format, size, usage); | 106 *buffer = GbmBuffer::CreateBuffer(gbm, format, size, usage); |
| 107 } | 107 } |
| 108 | 108 |
| 109 void DrmThread::GetSupportedFormats(std::vector<uint32_t>* support_formats) { |
| 110 *support_formats = display_manager_->GetSupportedFormats(); |
| 111 } |
| 112 |
| 109 void DrmThread::SchedulePageFlip(gfx::AcceleratedWidget widget, | 113 void DrmThread::SchedulePageFlip(gfx::AcceleratedWidget widget, |
| 110 const std::vector<OverlayPlane>& planes, | 114 const std::vector<OverlayPlane>& planes, |
| 111 const SwapCompletionCallback& callback) { | 115 const SwapCompletionCallback& callback) { |
| 112 DrmWindow* window = screen_manager_->GetWindow(widget); | 116 DrmWindow* window = screen_manager_->GetWindow(widget); |
| 113 if (window) | 117 if (window) |
| 114 window->SchedulePageFlip(planes, callback); | 118 window->SchedulePageFlip(planes, callback); |
| 115 else | 119 else |
| 116 callback.Run(gfx::SwapResult::SWAP_ACK); | 120 callback.Run(gfx::SwapResult::SWAP_ACK); |
| 117 } | 121 } |
| 118 | 122 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 const base::Callback<void(int64_t, bool)>& callback) { | 224 const base::Callback<void(int64_t, bool)>& callback) { |
| 221 callback.Run(display_id, display_manager_->SetHDCPState(display_id, state)); | 225 callback.Run(display_id, display_manager_->SetHDCPState(display_id, state)); |
| 222 } | 226 } |
| 223 | 227 |
| 224 void DrmThread::SetGammaRamp(int64_t id, | 228 void DrmThread::SetGammaRamp(int64_t id, |
| 225 const std::vector<GammaRampRGBEntry>& lut) { | 229 const std::vector<GammaRampRGBEntry>& lut) { |
| 226 display_manager_->SetGammaRamp(id, lut); | 230 display_manager_->SetGammaRamp(id, lut); |
| 227 } | 231 } |
| 228 | 232 |
| 229 } // namespace ui | 233 } // namespace ui |
| OLD | NEW |