OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ozone_platform_gbm.h" | 5 #include "ui/ozone/platform/drm/ozone_platform_gbm.h" |
6 | 6 |
7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
8 #include <gbm.h> | 8 #include <gbm.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 | 10 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 // This makes sure that simple targets that do not handle display | 187 // This makes sure that simple targets that do not handle display |
188 // configuration can still use the primary display. | 188 // configuration can still use the primary display. |
189 ForceInitializationOfPrimaryDisplay(gbm_, screen_manager_.get()); | 189 ForceInitializationOfPrimaryDisplay(gbm_, screen_manager_.get()); |
190 | 190 |
191 window_delegate_manager_.reset(new DrmWindowManager()); | 191 window_delegate_manager_.reset(new DrmWindowManager()); |
192 if (!surface_factory_ozone_) | 192 if (!surface_factory_ozone_) |
193 surface_factory_ozone_.reset(new GbmSurfaceFactory(use_surfaceless_)); | 193 surface_factory_ozone_.reset(new GbmSurfaceFactory(use_surfaceless_)); |
194 | 194 |
195 surface_factory_ozone_->InitializeGpu(drm_device_manager_.get(), | 195 surface_factory_ozone_->InitializeGpu(drm_device_manager_.get(), |
196 window_delegate_manager_.get()); | 196 window_delegate_manager_.get()); |
| 197 } |
| 198 |
| 199 void InitializeGPUPostMainLoop() override { |
197 scoped_ptr<DrmGpuDisplayManager> ndd(new DrmGpuDisplayManager( | 200 scoped_ptr<DrmGpuDisplayManager> ndd(new DrmGpuDisplayManager( |
198 screen_manager_.get(), gbm_, | 201 screen_manager_.get(), gbm_, |
199 scoped_ptr<DrmDeviceGenerator>(new GbmDeviceGenerator()))); | 202 scoped_ptr<DrmDeviceGenerator>(new GbmDeviceGenerator()))); |
200 gpu_platform_support_.reset(new DrmGpuPlatformSupport( | 203 gpu_platform_support_.reset(new DrmGpuPlatformSupport( |
201 drm_device_manager_.get(), window_delegate_manager_.get(), | 204 drm_device_manager_.get(), window_delegate_manager_.get(), |
202 screen_manager_.get(), ndd.Pass())); | 205 screen_manager_.get(), ndd.Pass())); |
203 } | 206 } |
204 | 207 |
205 private: | 208 private: |
206 // Objects in both processes. | 209 // Objects in both processes. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 OzonePlatform* CreateOzonePlatformGbm() { | 242 OzonePlatform* CreateOzonePlatformGbm() { |
240 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); | 243 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); |
241 #if defined(USE_MESA_PLATFORM_NULL) | 244 #if defined(USE_MESA_PLATFORM_NULL) |
242 // Only works with surfaceless. | 245 // Only works with surfaceless. |
243 cmd->AppendSwitch(switches::kOzoneUseSurfaceless); | 246 cmd->AppendSwitch(switches::kOzoneUseSurfaceless); |
244 #endif | 247 #endif |
245 return new OzonePlatformGbm(cmd->HasSwitch(switches::kOzoneUseSurfaceless)); | 248 return new OzonePlatformGbm(cmd->HasSwitch(switches::kOzoneUseSurfaceless)); |
246 } | 249 } |
247 | 250 |
248 } // namespace ui | 251 } // namespace ui |
OLD | NEW |