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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 const gfx::Size& size, | 103 const gfx::Size& size, |
104 gfx::BufferFormat format, | 104 gfx::BufferFormat format, |
105 gfx::BufferUsage usage, | 105 gfx::BufferUsage usage, |
106 scoped_refptr<GbmBuffer>* buffer) { | 106 scoped_refptr<GbmBuffer>* buffer) { |
107 scoped_refptr<GbmDevice> gbm = | 107 scoped_refptr<GbmDevice> gbm = |
108 static_cast<GbmDevice*>(device_manager_->GetDrmDevice(widget).get()); | 108 static_cast<GbmDevice*>(device_manager_->GetDrmDevice(widget).get()); |
109 DCHECK(gbm); | 109 DCHECK(gbm); |
110 *buffer = GbmBuffer::CreateBuffer(gbm, format, size, usage); | 110 *buffer = GbmBuffer::CreateBuffer(gbm, format, size, usage); |
111 } | 111 } |
112 | 112 |
113 void DrmThread::CreateBufferFromFds(const gfx::Size& size, | 113 void DrmThread::CreateBufferFromFds( |
114 gfx::BufferFormat format, | 114 const gfx::Size& size, |
115 std::vector<base::ScopedFD>&& fds, | 115 gfx::BufferFormat format, |
116 std::vector<int> strides, | 116 std::vector<base::ScopedFD>&& fds, |
117 std::vector<int> offsets, | 117 const std::vector<gfx::NativePixmapPlane>& planes, |
118 scoped_refptr<GbmBuffer>* buffer) { | 118 scoped_refptr<GbmBuffer>* buffer) { |
119 scoped_refptr<GbmDevice> gbm = | 119 scoped_refptr<GbmDevice> gbm = |
120 static_cast<GbmDevice*>(device_manager_->GetPrimaryDrmDevice().get()); | 120 static_cast<GbmDevice*>(device_manager_->GetPrimaryDrmDevice().get()); |
121 DCHECK(gbm); | 121 DCHECK(gbm); |
122 *buffer = GbmBuffer::CreateBufferFromFds(gbm, format, size, std::move(fds), | 122 *buffer = |
123 strides, offsets); | 123 GbmBuffer::CreateBufferFromFds(gbm, format, size, std::move(fds), planes); |
124 } | 124 } |
125 | 125 |
126 void DrmThread::GetScanoutFormats( | 126 void DrmThread::GetScanoutFormats( |
127 gfx::AcceleratedWidget widget, | 127 gfx::AcceleratedWidget widget, |
128 std::vector<gfx::BufferFormat>* scanout_formats) { | 128 std::vector<gfx::BufferFormat>* scanout_formats) { |
129 display_manager_->GetScanoutFormats(widget, scanout_formats); | 129 display_manager_->GetScanoutFormats(widget, scanout_formats); |
130 } | 130 } |
131 | 131 |
132 void DrmThread::SchedulePageFlip(gfx::AcceleratedWidget widget, | 132 void DrmThread::SchedulePageFlip(gfx::AcceleratedWidget widget, |
133 const std::vector<OverlayPlane>& planes, | 133 const std::vector<OverlayPlane>& planes, |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 void DrmThread::SetColorCorrection( | 247 void DrmThread::SetColorCorrection( |
248 int64_t display_id, | 248 int64_t display_id, |
249 const std::vector<GammaRampRGBEntry>& degamma_lut, | 249 const std::vector<GammaRampRGBEntry>& degamma_lut, |
250 const std::vector<GammaRampRGBEntry>& gamma_lut, | 250 const std::vector<GammaRampRGBEntry>& gamma_lut, |
251 const std::vector<float>& correction_matrix) { | 251 const std::vector<float>& correction_matrix) { |
252 display_manager_->SetColorCorrection(display_id, degamma_lut, gamma_lut, | 252 display_manager_->SetColorCorrection(display_id, degamma_lut, gamma_lut, |
253 correction_matrix); | 253 correction_matrix); |
254 } | 254 } |
255 | 255 |
256 } // namespace ui | 256 } // namespace ui |
OLD | NEW |