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> |
| 8 |
7 #include "base/command_line.h" | 9 #include "base/command_line.h" |
8 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
9 #include "ui/ozone/platform/drm/gpu/drm_buffer.h" | 11 #include "ui/ozone/platform/drm/gpu/drm_buffer.h" |
10 #include "ui/ozone/platform/drm/gpu/drm_device_generator.h" | 12 #include "ui/ozone/platform/drm/gpu/drm_device_generator.h" |
11 #include "ui/ozone/platform/drm/gpu/drm_device_manager.h" | 13 #include "ui/ozone/platform/drm/gpu/drm_device_manager.h" |
12 #include "ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h" | 14 #include "ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h" |
13 #include "ui/ozone/platform/drm/gpu/drm_window.h" | 15 #include "ui/ozone/platform/drm/gpu/drm_window.h" |
14 #include "ui/ozone/platform/drm/gpu/drm_window_proxy.h" | 16 #include "ui/ozone/platform/drm/gpu/drm_window_proxy.h" |
15 #include "ui/ozone/platform/drm/gpu/gbm_buffer.h" | 17 #include "ui/ozone/platform/drm/gpu/gbm_buffer.h" |
16 #include "ui/ozone/platform/drm/gpu/gbm_device.h" | 18 #include "ui/ozone/platform/drm/gpu/gbm_device.h" |
(...skipping 27 matching lines...) Expand all Loading... |
44 class GbmDeviceGenerator : public DrmDeviceGenerator { | 46 class GbmDeviceGenerator : public DrmDeviceGenerator { |
45 public: | 47 public: |
46 GbmDeviceGenerator(bool use_atomic) : use_atomic_(use_atomic) {} | 48 GbmDeviceGenerator(bool use_atomic) : use_atomic_(use_atomic) {} |
47 ~GbmDeviceGenerator() override {} | 49 ~GbmDeviceGenerator() override {} |
48 | 50 |
49 // DrmDeviceGenerator: | 51 // DrmDeviceGenerator: |
50 scoped_refptr<DrmDevice> CreateDevice(const base::FilePath& path, | 52 scoped_refptr<DrmDevice> CreateDevice(const base::FilePath& path, |
51 base::File file, | 53 base::File file, |
52 bool is_primary_device) override { | 54 bool is_primary_device) override { |
53 scoped_refptr<DrmDevice> drm = | 55 scoped_refptr<DrmDevice> drm = |
54 new GbmDevice(path, file.Pass(), is_primary_device); | 56 new GbmDevice(path, std::move(file), is_primary_device); |
55 if (drm->Initialize(use_atomic_)) | 57 if (drm->Initialize(use_atomic_)) |
56 return drm; | 58 return drm; |
57 | 59 |
58 return nullptr; | 60 return nullptr; |
59 } | 61 } |
60 | 62 |
61 private: | 63 private: |
62 bool use_atomic_; | 64 bool use_atomic_; |
63 | 65 |
64 DISALLOW_COPY_AND_ASSIGN(GbmDeviceGenerator); | 66 DISALLOW_COPY_AND_ASSIGN(GbmDeviceGenerator); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 // provider doesn't require the callback to be called if there isn't a vsync | 123 // provider doesn't require the callback to be called if there isn't a vsync |
122 // data source. | 124 // data source. |
123 if (window) | 125 if (window) |
124 window->GetVSyncParameters(callback); | 126 window->GetVSyncParameters(callback); |
125 } | 127 } |
126 | 128 |
127 void DrmThread::CreateWindow(gfx::AcceleratedWidget widget) { | 129 void DrmThread::CreateWindow(gfx::AcceleratedWidget widget) { |
128 scoped_ptr<DrmWindow> window( | 130 scoped_ptr<DrmWindow> window( |
129 new DrmWindow(widget, device_manager_.get(), screen_manager_.get())); | 131 new DrmWindow(widget, device_manager_.get(), screen_manager_.get())); |
130 window->Initialize(); | 132 window->Initialize(); |
131 screen_manager_->AddWindow(widget, window.Pass()); | 133 screen_manager_->AddWindow(widget, std::move(window)); |
132 } | 134 } |
133 | 135 |
134 void DrmThread::DestroyWindow(gfx::AcceleratedWidget widget) { | 136 void DrmThread::DestroyWindow(gfx::AcceleratedWidget widget) { |
135 scoped_ptr<DrmWindow> window = screen_manager_->RemoveWindow(widget); | 137 scoped_ptr<DrmWindow> window = screen_manager_->RemoveWindow(widget); |
136 window->Shutdown(); | 138 window->Shutdown(); |
137 } | 139 } |
138 | 140 |
139 void DrmThread::SetWindowBounds(gfx::AcceleratedWidget widget, | 141 void DrmThread::SetWindowBounds(gfx::AcceleratedWidget widget, |
140 const gfx::Rect& bounds) { | 142 const gfx::Rect& bounds) { |
141 screen_manager_->GetWindow(widget)->SetBounds(bounds); | 143 screen_manager_->GetWindow(widget)->SetBounds(bounds); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 const base::Callback<void(int64_t, bool)>& callback) { | 219 const base::Callback<void(int64_t, bool)>& callback) { |
218 callback.Run(display_id, display_manager_->SetHDCPState(display_id, state)); | 220 callback.Run(display_id, display_manager_->SetHDCPState(display_id, state)); |
219 } | 221 } |
220 | 222 |
221 void DrmThread::SetGammaRamp(int64_t id, | 223 void DrmThread::SetGammaRamp(int64_t id, |
222 const std::vector<GammaRampRGBEntry>& lut) { | 224 const std::vector<GammaRampRGBEntry>& lut) { |
223 display_manager_->SetGammaRamp(id, lut); | 225 display_manager_->SetGammaRamp(id, lut); |
224 } | 226 } |
225 | 227 |
226 } // namespace ui | 228 } // namespace ui |
OLD | NEW |