| 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" |
| 11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
| 12 #include "base/threading/thread_task_runner_handle.h" | 12 #include "base/threading/thread_task_runner_handle.h" |
| 13 #include "services/shell/public/cpp/connection.h" |
| 13 #include "ui/ozone/platform/drm/gpu/drm_buffer.h" | 14 #include "ui/ozone/platform/drm/gpu/drm_buffer.h" |
| 14 #include "ui/ozone/platform/drm/gpu/drm_device_generator.h" | 15 #include "ui/ozone/platform/drm/gpu/drm_device_generator.h" |
| 15 #include "ui/ozone/platform/drm/gpu/drm_device_manager.h" | 16 #include "ui/ozone/platform/drm/gpu/drm_device_manager.h" |
| 16 #include "ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h" | 17 #include "ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h" |
| 17 #include "ui/ozone/platform/drm/gpu/drm_window.h" | 18 #include "ui/ozone/platform/drm/gpu/drm_window.h" |
| 18 #include "ui/ozone/platform/drm/gpu/drm_window_proxy.h" | 19 #include "ui/ozone/platform/drm/gpu/drm_window_proxy.h" |
| 19 #include "ui/ozone/platform/drm/gpu/gbm_buffer.h" | 20 #include "ui/ozone/platform/drm/gpu/gbm_buffer.h" |
| 20 #include "ui/ozone/platform/drm/gpu/gbm_device.h" | 21 #include "ui/ozone/platform/drm/gpu/gbm_device.h" |
| 21 #include "ui/ozone/platform/drm/gpu/gbm_surface_factory.h" | 22 #include "ui/ozone/platform/drm/gpu/gbm_surface_factory.h" |
| 22 #include "ui/ozone/platform/drm/gpu/proxy_helpers.h" | 23 #include "ui/ozone/platform/drm/gpu/proxy_helpers.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 void DrmThread::DestroyWindow(gfx::AcceleratedWidget widget) { | 162 void DrmThread::DestroyWindow(gfx::AcceleratedWidget widget) { |
| 162 std::unique_ptr<DrmWindow> window = screen_manager_->RemoveWindow(widget); | 163 std::unique_ptr<DrmWindow> window = screen_manager_->RemoveWindow(widget); |
| 163 window->Shutdown(); | 164 window->Shutdown(); |
| 164 } | 165 } |
| 165 | 166 |
| 166 void DrmThread::SetWindowBounds(gfx::AcceleratedWidget widget, | 167 void DrmThread::SetWindowBounds(gfx::AcceleratedWidget widget, |
| 167 const gfx::Rect& bounds) { | 168 const gfx::Rect& bounds) { |
| 168 screen_manager_->GetWindow(widget)->SetBounds(bounds); | 169 screen_manager_->GetWindow(widget)->SetBounds(bounds); |
| 169 } | 170 } |
| 170 | 171 |
| 171 void DrmThread::SetCursor(gfx::AcceleratedWidget widget, | 172 void DrmThread::SetCursor(const gfx::AcceleratedWidget& widget, |
| 172 const std::vector<SkBitmap>& bitmaps, | 173 const std::vector<SkBitmap>& bitmaps, |
| 173 const gfx::Point& location, | 174 const gfx::Point& location, |
| 174 int frame_delay_ms) { | 175 uint32_t frame_delay_ms) { |
| 175 screen_manager_->GetWindow(widget) | 176 screen_manager_->GetWindow(widget) |
| 176 ->SetCursor(bitmaps, location, frame_delay_ms); | 177 ->SetCursor(bitmaps, location, frame_delay_ms); |
| 177 } | 178 } |
| 178 | 179 |
| 179 void DrmThread::MoveCursor(const gfx::AcceleratedWidget& widget, | 180 void DrmThread::MoveCursor(const gfx::AcceleratedWidget& widget, |
| 180 const gfx::Point& location) { | 181 const gfx::Point& location) { |
| 181 screen_manager_->GetWindow(widget)->MoveCursor(location); | 182 screen_manager_->GetWindow(widget)->MoveCursor(location); |
| 182 } | 183 } |
| 183 | 184 |
| 184 void DrmThread::CheckOverlayCapabilities( | 185 void DrmThread::CheckOverlayCapabilities( |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 248 |
| 248 void DrmThread::SetColorCorrection( | 249 void DrmThread::SetColorCorrection( |
| 249 int64_t display_id, | 250 int64_t display_id, |
| 250 const std::vector<GammaRampRGBEntry>& degamma_lut, | 251 const std::vector<GammaRampRGBEntry>& degamma_lut, |
| 251 const std::vector<GammaRampRGBEntry>& gamma_lut, | 252 const std::vector<GammaRampRGBEntry>& gamma_lut, |
| 252 const std::vector<float>& correction_matrix) { | 253 const std::vector<float>& correction_matrix) { |
| 253 display_manager_->SetColorCorrection(display_id, degamma_lut, gamma_lut, | 254 display_manager_->SetColorCorrection(display_id, degamma_lut, gamma_lut, |
| 254 correction_matrix); | 255 correction_matrix); |
| 255 } | 256 } |
| 256 | 257 |
| 258 // DrmThread requires a BindingSet instead of a simple Binding because it will |
| 259 // be used from multiple threads in multiple processes. |
| 260 void DrmThread::AddBinding(ozone::mojom::DeviceCursorRequest request) { |
| 261 bindings_.AddBinding(this, std::move(request)); |
| 262 } |
| 263 |
| 257 } // namespace ui | 264 } // namespace ui |
| OLD | NEW |