| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 gfx::AcceleratedWidget widget, | 117 gfx::AcceleratedWidget widget, |
| 118 const gfx::VSyncProvider::UpdateVSyncCallback& callback) { | 118 const gfx::VSyncProvider::UpdateVSyncCallback& callback) { |
| 119 DrmWindow* window = screen_manager_->GetWindow(widget); | 119 DrmWindow* window = screen_manager_->GetWindow(widget); |
| 120 // No need to call the callback if there isn't a window since the vsync | 120 // No need to call the callback if there isn't a window since the vsync |
| 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::GetOverlayBufferConfigurations( |
| 128 gfx::AcceleratedWidget widget, |
| 129 const OverlayParamCallback& callback) { |
| 130 DrmWindow* window = screen_manager_->GetWindow(widget); |
| 131 if (window) |
| 132 window->GetOverlayBufferConfigurations(callback); |
| 133 } |
| 134 |
| 127 void DrmThread::CreateWindow(gfx::AcceleratedWidget widget) { | 135 void DrmThread::CreateWindow(gfx::AcceleratedWidget widget) { |
| 128 scoped_ptr<DrmWindow> window( | 136 scoped_ptr<DrmWindow> window( |
| 129 new DrmWindow(widget, device_manager_.get(), screen_manager_.get())); | 137 new DrmWindow(widget, device_manager_.get(), screen_manager_.get())); |
| 130 window->Initialize(); | 138 window->Initialize(); |
| 131 screen_manager_->AddWindow(widget, window.Pass()); | 139 screen_manager_->AddWindow(widget, window.Pass()); |
| 132 } | 140 } |
| 133 | 141 |
| 134 void DrmThread::DestroyWindow(gfx::AcceleratedWidget widget) { | 142 void DrmThread::DestroyWindow(gfx::AcceleratedWidget widget) { |
| 135 scoped_ptr<DrmWindow> window = screen_manager_->RemoveWindow(widget); | 143 scoped_ptr<DrmWindow> window = screen_manager_->RemoveWindow(widget); |
| 136 window->Shutdown(); | 144 window->Shutdown(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 149 ->SetCursor(bitmaps, location, frame_delay_ms); | 157 ->SetCursor(bitmaps, location, frame_delay_ms); |
| 150 } | 158 } |
| 151 | 159 |
| 152 void DrmThread::MoveCursor(gfx::AcceleratedWidget widget, | 160 void DrmThread::MoveCursor(gfx::AcceleratedWidget widget, |
| 153 const gfx::Point& location) { | 161 const gfx::Point& location) { |
| 154 screen_manager_->GetWindow(widget)->MoveCursor(location); | 162 screen_manager_->GetWindow(widget)->MoveCursor(location); |
| 155 } | 163 } |
| 156 | 164 |
| 157 void DrmThread::CheckOverlayCapabilities( | 165 void DrmThread::CheckOverlayCapabilities( |
| 158 gfx::AcceleratedWidget widget, | 166 gfx::AcceleratedWidget widget, |
| 159 const std::vector<OverlayCheck_Params>& overlays, | 167 const std::vector<OverlayCheck_Params>& current_combination, |
| 168 const std::vector<OverlayCheck_Params>& new_combination, |
| 160 const base::Callback<void(gfx::AcceleratedWidget, | 169 const base::Callback<void(gfx::AcceleratedWidget, |
| 161 const std::vector<OverlayCheck_Params>&)>& | 170 const std::vector<OverlayCheck_Params>&)>& |
| 162 callback) { | 171 callback) { |
| 163 callback.Run(widget, screen_manager_->GetWindow(widget) | 172 callback.Run(widget, screen_manager_->GetWindow(widget) |
| 164 ->TestPageFlip(overlays, buffer_generator_.get())); | 173 ->TestPageFlip(current_combination, new_combination, |
| 174 buffer_generator_.get())); |
| 165 } | 175 } |
| 166 | 176 |
| 167 void DrmThread::RefreshNativeDisplays( | 177 void DrmThread::RefreshNativeDisplays( |
| 168 const base::Callback<void(const std::vector<DisplaySnapshot_Params>&)>& | 178 const base::Callback<void(const std::vector<DisplaySnapshot_Params>&)>& |
| 169 callback) { | 179 callback) { |
| 170 callback.Run(display_manager_->GetDisplays()); | 180 callback.Run(display_manager_->GetDisplays()); |
| 171 } | 181 } |
| 172 | 182 |
| 173 void DrmThread::ConfigureNativeDisplay( | 183 void DrmThread::ConfigureNativeDisplay( |
| 174 int64_t id, | 184 int64_t id, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 const base::Callback<void(int64_t, bool)>& callback) { | 227 const base::Callback<void(int64_t, bool)>& callback) { |
| 218 callback.Run(display_id, display_manager_->SetHDCPState(display_id, state)); | 228 callback.Run(display_id, display_manager_->SetHDCPState(display_id, state)); |
| 219 } | 229 } |
| 220 | 230 |
| 221 void DrmThread::SetGammaRamp(int64_t id, | 231 void DrmThread::SetGammaRamp(int64_t id, |
| 222 const std::vector<GammaRampRGBEntry>& lut) { | 232 const std::vector<GammaRampRGBEntry>& lut) { |
| 223 display_manager_->SetGammaRamp(id, lut); | 233 display_manager_->SetGammaRamp(id, lut); |
| 224 } | 234 } |
| 225 | 235 |
| 226 } // namespace ui | 236 } // namespace ui |
| OLD | NEW |