| 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" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 // No need to call the callback if there isn't a window since the vsync | 123 // No need to call the callback if there isn't a window since the vsync |
| 124 // provider doesn't require the callback to be called if there isn't a vsync | 124 // provider doesn't require the callback to be called if there isn't a vsync |
| 125 // data source. | 125 // data source. |
| 126 if (window) | 126 if (window) |
| 127 window->GetVSyncParameters(callback); | 127 window->GetVSyncParameters(callback); |
| 128 } | 128 } |
| 129 | 129 |
| 130 void DrmThread::CreateWindow(gfx::AcceleratedWidget widget) { | 130 void DrmThread::CreateWindow(gfx::AcceleratedWidget widget) { |
| 131 scoped_ptr<DrmWindow> window( | 131 scoped_ptr<DrmWindow> window( |
| 132 new DrmWindow(widget, device_manager_.get(), screen_manager_.get())); | 132 new DrmWindow(widget, device_manager_.get(), screen_manager_.get())); |
| 133 window->Initialize(); | 133 window->Initialize(buffer_generator_.get()); |
| 134 screen_manager_->AddWindow(widget, std::move(window)); | 134 screen_manager_->AddWindow(widget, std::move(window)); |
| 135 } | 135 } |
| 136 | 136 |
| 137 void DrmThread::DestroyWindow(gfx::AcceleratedWidget widget) { | 137 void DrmThread::DestroyWindow(gfx::AcceleratedWidget widget) { |
| 138 scoped_ptr<DrmWindow> window = screen_manager_->RemoveWindow(widget); | 138 scoped_ptr<DrmWindow> window = screen_manager_->RemoveWindow(widget); |
| 139 window->Shutdown(); | 139 window->Shutdown(); |
| 140 } | 140 } |
| 141 | 141 |
| 142 void DrmThread::SetWindowBounds(gfx::AcceleratedWidget widget, | 142 void DrmThread::SetWindowBounds(gfx::AcceleratedWidget widget, |
| 143 const gfx::Rect& bounds) { | 143 const gfx::Rect& bounds) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 156 const gfx::Point& location) { | 156 const gfx::Point& location) { |
| 157 screen_manager_->GetWindow(widget)->MoveCursor(location); | 157 screen_manager_->GetWindow(widget)->MoveCursor(location); |
| 158 } | 158 } |
| 159 | 159 |
| 160 void DrmThread::CheckOverlayCapabilities( | 160 void DrmThread::CheckOverlayCapabilities( |
| 161 gfx::AcceleratedWidget widget, | 161 gfx::AcceleratedWidget widget, |
| 162 const std::vector<OverlayCheck_Params>& overlays, | 162 const std::vector<OverlayCheck_Params>& overlays, |
| 163 const base::Callback<void(gfx::AcceleratedWidget, | 163 const base::Callback<void(gfx::AcceleratedWidget, |
| 164 const std::vector<OverlayCheck_Params>&)>& | 164 const std::vector<OverlayCheck_Params>&)>& |
| 165 callback) { | 165 callback) { |
| 166 callback.Run(widget, screen_manager_->GetWindow(widget) | 166 callback.Run(widget, |
| 167 ->TestPageFlip(overlays, buffer_generator_.get())); | 167 screen_manager_->GetWindow(widget)->TestPageFlip(overlays)); |
| 168 } | 168 } |
| 169 | 169 |
| 170 void DrmThread::RefreshNativeDisplays( | 170 void DrmThread::RefreshNativeDisplays( |
| 171 const base::Callback<void(const std::vector<DisplaySnapshot_Params>&)>& | 171 const base::Callback<void(const std::vector<DisplaySnapshot_Params>&)>& |
| 172 callback) { | 172 callback) { |
| 173 callback.Run(display_manager_->GetDisplays()); | 173 callback.Run(display_manager_->GetDisplays()); |
| 174 } | 174 } |
| 175 | 175 |
| 176 void DrmThread::ConfigureNativeDisplay( | 176 void DrmThread::ConfigureNativeDisplay( |
| 177 int64_t id, | 177 int64_t id, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 const base::Callback<void(int64_t, bool)>& callback) { | 220 const base::Callback<void(int64_t, bool)>& callback) { |
| 221 callback.Run(display_id, display_manager_->SetHDCPState(display_id, state)); | 221 callback.Run(display_id, display_manager_->SetHDCPState(display_id, state)); |
| 222 } | 222 } |
| 223 | 223 |
| 224 void DrmThread::SetGammaRamp(int64_t id, | 224 void DrmThread::SetGammaRamp(int64_t id, |
| 225 const std::vector<GammaRampRGBEntry>& lut) { | 225 const std::vector<GammaRampRGBEntry>& lut) { |
| 226 display_manager_->SetGammaRamp(id, lut); | 226 display_manager_->SetGammaRamp(id, lut); |
| 227 } | 227 } |
| 228 | 228 |
| 229 } // namespace ui | 229 } // namespace ui |
| OLD | NEW |