| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 void DrmThread::DestroyWindow(gfx::AcceleratedWidget widget) { | 161 void DrmThread::DestroyWindow(gfx::AcceleratedWidget widget) { |
| 161 std::unique_ptr<DrmWindow> window = screen_manager_->RemoveWindow(widget); | 162 std::unique_ptr<DrmWindow> window = screen_manager_->RemoveWindow(widget); |
| 162 window->Shutdown(); | 163 window->Shutdown(); |
| 163 } | 164 } |
| 164 | 165 |
| 165 void DrmThread::SetWindowBounds(gfx::AcceleratedWidget widget, | 166 void DrmThread::SetWindowBounds(gfx::AcceleratedWidget widget, |
| 166 const gfx::Rect& bounds) { | 167 const gfx::Rect& bounds) { |
| 167 screen_manager_->GetWindow(widget)->SetBounds(bounds); | 168 screen_manager_->GetWindow(widget)->SetBounds(bounds); |
| 168 } | 169 } |
| 169 | 170 |
| 170 void DrmThread::SetCursor(gfx::AcceleratedWidget widget, | 171 void DrmThread::SetCursor(const gfx::AcceleratedWidget& widget, |
| 171 const std::vector<SkBitmap>& bitmaps, | 172 const std::vector<SkBitmap>& bitmaps, |
| 172 const gfx::Point& location, | 173 const gfx::Point& location, |
| 173 int frame_delay_ms) { | 174 uint32_t frame_delay_ms) { |
| 174 screen_manager_->GetWindow(widget) | 175 screen_manager_->GetWindow(widget) |
| 175 ->SetCursor(bitmaps, location, frame_delay_ms); | 176 ->SetCursor(bitmaps, location, frame_delay_ms); |
| 176 } | 177 } |
| 177 | 178 |
| 178 void DrmThread::MoveCursor(const gfx::AcceleratedWidget& widget, | 179 void DrmThread::MoveCursor(const gfx::AcceleratedWidget& widget, |
| 179 const gfx::Point& location) { | 180 const gfx::Point& location) { |
| 180 screen_manager_->GetWindow(widget)->MoveCursor(location); | 181 screen_manager_->GetWindow(widget)->MoveCursor(location); |
| 181 } | 182 } |
| 182 | 183 |
| 183 void DrmThread::CheckOverlayCapabilities( | 184 void DrmThread::CheckOverlayCapabilities( |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 247 |
| 247 void DrmThread::SetColorCorrection( | 248 void DrmThread::SetColorCorrection( |
| 248 int64_t display_id, | 249 int64_t display_id, |
| 249 const std::vector<GammaRampRGBEntry>& degamma_lut, | 250 const std::vector<GammaRampRGBEntry>& degamma_lut, |
| 250 const std::vector<GammaRampRGBEntry>& gamma_lut, | 251 const std::vector<GammaRampRGBEntry>& gamma_lut, |
| 251 const std::vector<float>& correction_matrix) { | 252 const std::vector<float>& correction_matrix) { |
| 252 display_manager_->SetColorCorrection(display_id, degamma_lut, gamma_lut, | 253 display_manager_->SetColorCorrection(display_id, degamma_lut, gamma_lut, |
| 253 correction_matrix); | 254 correction_matrix); |
| 254 } | 255 } |
| 255 | 256 |
| 257 // DrmThread requires a BindingSet instead of a simple Binding because it will |
| 258 // be used from multiple threads in multiple processes. |
| 259 void DrmThread::AddBinding(shell::Connection* connection, |
| 260 ozone::mojom::DeviceCursorRequest request) { |
| 261 bindings_.AddBinding(this, std::move(request)); |
| 262 } |
| 263 |
| 256 } // namespace ui | 264 } // namespace ui |
| OLD | NEW |