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