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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 display_manager_.get(), primary_graphics_card_path_)); | 147 display_manager_.get(), primary_graphics_card_path_)); |
148 } | 148 } |
149 void InitializeUI() override { | 149 void InitializeUI() override { |
150 primary_graphics_card_path_ = GetPrimaryDisplayCardPath(); | 150 primary_graphics_card_path_ = GetPrimaryDisplayCardPath(); |
151 display_manager_.reset(new DisplayManager()); | 151 display_manager_.reset(new DisplayManager()); |
152 // Needed since the browser process creates the accelerated widgets and that | 152 // Needed since the browser process creates the accelerated widgets and that |
153 // happens through SFO. | 153 // happens through SFO. |
154 if (!surface_factory_ozone_) | 154 if (!surface_factory_ozone_) |
155 surface_factory_ozone_.reset(new GbmSurfaceFactory(use_surfaceless_)); | 155 surface_factory_ozone_.reset(new GbmSurfaceFactory(use_surfaceless_)); |
156 device_manager_ = CreateDeviceManager(); | 156 device_manager_ = CreateDeviceManager(); |
| 157 window_manager_.reset(new DrmWindowHostManager()); |
157 cursor_.reset(new DrmCursor(window_manager_.get())); | 158 cursor_.reset(new DrmCursor(window_manager_.get())); |
158 gpu_platform_support_host_.reset( | 159 gpu_platform_support_host_.reset( |
159 new DrmGpuPlatformSupportHost(cursor_.get())); | 160 new DrmGpuPlatformSupportHost(cursor_.get())); |
160 window_manager_.reset(new DrmWindowHostManager()); | |
161 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); | 161 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); |
162 #if defined(USE_XKBCOMMON) | 162 #if defined(USE_XKBCOMMON) |
163 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(make_scoped_ptr( | 163 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(make_scoped_ptr( |
164 new XkbKeyboardLayoutEngine(xkb_evdev_code_converter_))); | 164 new XkbKeyboardLayoutEngine(xkb_evdev_code_converter_))); |
165 #else | 165 #else |
166 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( | 166 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( |
167 make_scoped_ptr(new StubKeyboardLayoutEngine())); | 167 make_scoped_ptr(new StubKeyboardLayoutEngine())); |
168 #endif | 168 #endif |
169 event_factory_ozone_.reset(new EventFactoryEvdev( | 169 event_factory_ozone_.reset(new EventFactoryEvdev( |
170 cursor_.get(), device_manager_.get(), | 170 cursor_.get(), device_manager_.get(), |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 scoped_ptr<DrmDeviceManager> drm_device_manager_; | 214 scoped_ptr<DrmDeviceManager> drm_device_manager_; |
215 scoped_ptr<GbmBufferGenerator> buffer_generator_; | 215 scoped_ptr<GbmBufferGenerator> buffer_generator_; |
216 scoped_ptr<ScreenManager> screen_manager_; | 216 scoped_ptr<ScreenManager> screen_manager_; |
217 scoped_ptr<DrmGpuPlatformSupport> gpu_platform_support_; | 217 scoped_ptr<DrmGpuPlatformSupport> gpu_platform_support_; |
218 scoped_ptr<DrmWindowManager> window_delegate_manager_; | 218 scoped_ptr<DrmWindowManager> window_delegate_manager_; |
219 | 219 |
220 // Objects in the Browser process. | 220 // Objects in the Browser process. |
221 base::FilePath primary_graphics_card_path_; | 221 base::FilePath primary_graphics_card_path_; |
222 scoped_ptr<DeviceManager> device_manager_; | 222 scoped_ptr<DeviceManager> device_manager_; |
223 scoped_ptr<BitmapCursorFactoryOzone> cursor_factory_ozone_; | 223 scoped_ptr<BitmapCursorFactoryOzone> cursor_factory_ozone_; |
| 224 scoped_ptr<DrmWindowHostManager> window_manager_; |
224 scoped_ptr<DrmCursor> cursor_; | 225 scoped_ptr<DrmCursor> cursor_; |
225 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; | 226 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; |
226 scoped_ptr<DrmGpuPlatformSupportHost> gpu_platform_support_host_; | 227 scoped_ptr<DrmGpuPlatformSupportHost> gpu_platform_support_host_; |
227 scoped_ptr<DrmWindowHostManager> window_manager_; | |
228 scoped_ptr<DisplayManager> display_manager_; | 228 scoped_ptr<DisplayManager> display_manager_; |
229 | 229 |
230 #if defined(USE_XKBCOMMON) | 230 #if defined(USE_XKBCOMMON) |
231 XkbEvdevCodes xkb_evdev_code_converter_; | 231 XkbEvdevCodes xkb_evdev_code_converter_; |
232 #endif | 232 #endif |
233 | 233 |
234 DISALLOW_COPY_AND_ASSIGN(OzonePlatformGbm); | 234 DISALLOW_COPY_AND_ASSIGN(OzonePlatformGbm); |
235 }; | 235 }; |
236 | 236 |
237 } // namespace | 237 } // namespace |
238 | 238 |
239 OzonePlatform* CreateOzonePlatformGbm() { | 239 OzonePlatform* CreateOzonePlatformGbm() { |
240 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); | 240 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); |
241 #if defined(USE_MESA_PLATFORM_NULL) | 241 #if defined(USE_MESA_PLATFORM_NULL) |
242 // Only works with surfaceless. | 242 // Only works with surfaceless. |
243 cmd->AppendSwitch(switches::kOzoneUseSurfaceless); | 243 cmd->AppendSwitch(switches::kOzoneUseSurfaceless); |
244 #endif | 244 #endif |
245 return new OzonePlatformGbm(cmd->HasSwitch(switches::kOzoneUseSurfaceless)); | 245 return new OzonePlatformGbm(cmd->HasSwitch(switches::kOzoneUseSurfaceless)); |
246 } | 246 } |
247 | 247 |
248 } // namespace ui | 248 } // namespace ui |
OLD | NEW |