| 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" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 14 #include "base/threading/thread_task_runner_handle.h" | 14 #include "base/threading/thread_task_runner_handle.h" |
| 15 #include "ui/display/types/display_mode.h" | 15 #include "ui/display/types/display_mode.h" |
| 16 #include "ui/display/types/display_snapshot_mojo.h" |
| 17 #include "ui/ozone/common/display_snapshot_proxy.h" |
| 16 #include "ui/ozone/platform/drm/common/drm_util.h" | 18 #include "ui/ozone/platform/drm/common/drm_util.h" |
| 17 #include "ui/ozone/platform/drm/gpu/drm_buffer.h" | 19 #include "ui/ozone/platform/drm/gpu/drm_buffer.h" |
| 18 #include "ui/ozone/platform/drm/gpu/drm_device_generator.h" | 20 #include "ui/ozone/platform/drm/gpu/drm_device_generator.h" |
| 19 #include "ui/ozone/platform/drm/gpu/drm_device_manager.h" | 21 #include "ui/ozone/platform/drm/gpu/drm_device_manager.h" |
| 20 #include "ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h" | 22 #include "ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h" |
| 21 #include "ui/ozone/platform/drm/gpu/drm_window.h" | 23 #include "ui/ozone/platform/drm/gpu/drm_window.h" |
| 22 #include "ui/ozone/platform/drm/gpu/drm_window_proxy.h" | 24 #include "ui/ozone/platform/drm/gpu/drm_window_proxy.h" |
| 23 #include "ui/ozone/platform/drm/gpu/gbm_buffer.h" | 25 #include "ui/ozone/platform/drm/gpu/gbm_buffer.h" |
| 24 #include "ui/ozone/platform/drm/gpu/gbm_device.h" | 26 #include "ui/ozone/platform/drm/gpu/gbm_device.h" |
| 25 #include "ui/ozone/platform/drm/gpu/gbm_surface_factory.h" | 27 #include "ui/ozone/platform/drm/gpu/gbm_surface_factory.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 base::OnceCallback<void(gfx::AcceleratedWidget, | 224 base::OnceCallback<void(gfx::AcceleratedWidget, |
| 223 const std::vector<OverlayCheck_Params>&, | 225 const std::vector<OverlayCheck_Params>&, |
| 224 const std::vector<OverlayCheckReturn_Params>&)> | 226 const std::vector<OverlayCheckReturn_Params>&)> |
| 225 callback) { | 227 callback) { |
| 226 std::move(callback).Run( | 228 std::move(callback).Run( |
| 227 widget, overlays, | 229 widget, overlays, |
| 228 screen_manager_->GetWindow(widget)->TestPageFlip(overlays)); | 230 screen_manager_->GetWindow(widget)->TestPageFlip(overlays)); |
| 229 } | 231 } |
| 230 | 232 |
| 231 void DrmThread::RefreshNativeDisplays( | 233 void DrmThread::RefreshNativeDisplays( |
| 232 base::OnceCallback<void(const std::vector<DisplaySnapshot_Params>&)> | 234 base::OnceCallback<void(MovableDisplaySnapshots)> callback) { |
| 233 callback) { | 235 auto snapshots = |
| 234 std::move(callback).Run(display_manager_->GetDisplays()); | 236 CreateMovableDisplaySnapshotsFromParams(display_manager_->GetDisplays()); |
| 237 std::move(callback).Run(std::move(snapshots)); |
| 235 } | 238 } |
| 236 | 239 |
| 237 void DrmThread::ConfigureNativeDisplay( | 240 void DrmThread::ConfigureNativeDisplay( |
| 238 int64_t id, | 241 int64_t id, |
| 239 std::unique_ptr<const display::DisplayMode> mode, | 242 std::unique_ptr<const display::DisplayMode> mode, |
| 240 const gfx::Point& origin, | 243 const gfx::Point& origin, |
| 241 base::OnceCallback<void(int64_t, bool)> callback) { | 244 base::OnceCallback<void(int64_t, bool)> callback) { |
| 242 std::move(callback).Run( | 245 std::move(callback).Run( |
| 243 id, display_manager_->ConfigureDisplay(id, *mode, origin)); | 246 id, display_manager_->ConfigureDisplay(id, *mode, origin)); |
| 244 } | 247 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 correction_matrix); | 295 correction_matrix); |
| 293 } | 296 } |
| 294 | 297 |
| 295 // DrmThread requires a BindingSet instead of a simple Binding because it will | 298 // DrmThread requires a BindingSet instead of a simple Binding because it will |
| 296 // be used from multiple threads in multiple processes. | 299 // be used from multiple threads in multiple processes. |
| 297 void DrmThread::AddBinding(ozone::mojom::DeviceCursorRequest request) { | 300 void DrmThread::AddBinding(ozone::mojom::DeviceCursorRequest request) { |
| 298 bindings_.AddBinding(this, std::move(request)); | 301 bindings_.AddBinding(this, std::move(request)); |
| 299 } | 302 } |
| 300 | 303 |
| 301 } // namespace ui | 304 } // namespace ui |
| OLD | NEW |