| 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 <gbm.h> | 7 #include <gbm.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 } | 159 } |
| 160 | 160 |
| 161 void DrmThread::GetScanoutFormats( | 161 void DrmThread::GetScanoutFormats( |
| 162 gfx::AcceleratedWidget widget, | 162 gfx::AcceleratedWidget widget, |
| 163 std::vector<gfx::BufferFormat>* scanout_formats) { | 163 std::vector<gfx::BufferFormat>* scanout_formats) { |
| 164 display_manager_->GetScanoutFormats(widget, scanout_formats); | 164 display_manager_->GetScanoutFormats(widget, scanout_formats); |
| 165 } | 165 } |
| 166 | 166 |
| 167 void DrmThread::SchedulePageFlip(gfx::AcceleratedWidget widget, | 167 void DrmThread::SchedulePageFlip(gfx::AcceleratedWidget widget, |
| 168 const std::vector<OverlayPlane>& planes, | 168 const std::vector<OverlayPlane>& planes, |
| 169 const SwapCompletionCallback& callback) { | 169 SwapCompletionOnceCallback callback) { |
| 170 DrmWindow* window = screen_manager_->GetWindow(widget); | 170 DrmWindow* window = screen_manager_->GetWindow(widget); |
| 171 if (window) | 171 if (window) |
| 172 window->SchedulePageFlip(planes, callback); | 172 window->SchedulePageFlip(planes, std::move(callback)); |
| 173 else | 173 else |
| 174 callback.Run(gfx::SwapResult::SWAP_ACK); | 174 std::move(callback).Run(gfx::SwapResult::SWAP_ACK); |
| 175 } | 175 } |
| 176 | 176 |
| 177 void DrmThread::GetVSyncParameters( | 177 void DrmThread::GetVSyncParameters( |
| 178 gfx::AcceleratedWidget widget, | 178 gfx::AcceleratedWidget widget, |
| 179 const gfx::VSyncProvider::UpdateVSyncCallback& callback) { | 179 const gfx::VSyncProvider::UpdateVSyncCallback& callback) { |
| 180 DrmWindow* window = screen_manager_->GetWindow(widget); | 180 DrmWindow* window = screen_manager_->GetWindow(widget); |
| 181 // No need to call the callback if there isn't a window since the vsync | 181 // No need to call the callback if there isn't a window since the vsync |
| 182 // provider doesn't require the callback to be called if there isn't a vsync | 182 // provider doesn't require the callback to be called if there isn't a vsync |
| 183 // data source. | 183 // data source. |
| 184 if (window) | 184 if (window) |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 correction_matrix); | 289 correction_matrix); |
| 290 } | 290 } |
| 291 | 291 |
| 292 // DrmThread requires a BindingSet instead of a simple Binding because it will | 292 // DrmThread requires a BindingSet instead of a simple Binding because it will |
| 293 // be used from multiple threads in multiple processes. | 293 // be used from multiple threads in multiple processes. |
| 294 void DrmThread::AddBinding(ozone::mojom::DeviceCursorRequest request) { | 294 void DrmThread::AddBinding(ozone::mojom::DeviceCursorRequest request) { |
| 295 bindings_.AddBinding(this, std::move(request)); | 295 bindings_.AddBinding(this, std::move(request)); |
| 296 } | 296 } |
| 297 | 297 |
| 298 } // namespace ui | 298 } // namespace ui |
| OLD | NEW |