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