OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_drm.h" | 5 #include "ui/ozone/platform/drm/ozone_platform_drm.h" |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/thread_task_runner_handle.h" | 8 #include "base/thread_task_runner_handle.h" |
9 #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h" | 9 #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h" |
10 #include "ui/events/ozone/device/device_manager.h" | 10 #include "ui/events/ozone/device/device_manager.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 gpu_lock_.reset(new GpuLock()); | 96 gpu_lock_.reset(new GpuLock()); |
97 #endif | 97 #endif |
98 if (!drm_->Initialize()) | 98 if (!drm_->Initialize()) |
99 LOG(FATAL) << "Failed to initialize primary DRM device"; | 99 LOG(FATAL) << "Failed to initialize primary DRM device"; |
100 | 100 |
101 // This makes sure that simple targets that do not handle display | 101 // This makes sure that simple targets that do not handle display |
102 // configuration can still use the primary display. | 102 // configuration can still use the primary display. |
103 ForceInitializationOfPrimaryDisplay(drm_, screen_manager_.get()); | 103 ForceInitializationOfPrimaryDisplay(drm_, screen_manager_.get()); |
104 drm_device_manager_.reset(new DrmDeviceManager(drm_)); | 104 drm_device_manager_.reset(new DrmDeviceManager(drm_)); |
105 display_manager_.reset(new DisplayManager()); | 105 display_manager_.reset(new DisplayManager()); |
| 106 window_manager_.reset(new DrmWindowHostManager()); |
106 cursor_.reset(new DrmCursor(window_manager_.get())); | 107 cursor_.reset(new DrmCursor(window_manager_.get())); |
107 surface_factory_ozone_.reset( | 108 surface_factory_ozone_.reset( |
108 new DrmSurfaceFactory(&window_delegate_manager_)); | 109 new DrmSurfaceFactory(&window_delegate_manager_)); |
109 scoped_ptr<DrmGpuDisplayManager> ndd(new DrmGpuDisplayManager( | 110 scoped_ptr<DrmGpuDisplayManager> ndd(new DrmGpuDisplayManager( |
110 screen_manager_.get(), drm_, | 111 screen_manager_.get(), drm_, |
111 scoped_ptr<DrmDeviceGenerator>(new DrmDeviceGenerator()))); | 112 scoped_ptr<DrmDeviceGenerator>(new DrmDeviceGenerator()))); |
112 gpu_platform_support_.reset(new DrmGpuPlatformSupport( | 113 gpu_platform_support_.reset(new DrmGpuPlatformSupport( |
113 drm_device_manager_.get(), &window_delegate_manager_, | 114 drm_device_manager_.get(), &window_delegate_manager_, |
114 screen_manager_.get(), ndd.Pass())); | 115 screen_manager_.get(), ndd.Pass())); |
115 gpu_platform_support_host_.reset( | 116 gpu_platform_support_host_.reset( |
116 new DrmGpuPlatformSupportHost(cursor_.get())); | 117 new DrmGpuPlatformSupportHost(cursor_.get())); |
117 window_manager_.reset(new DrmWindowHostManager()); | |
118 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); | 118 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); |
119 #if defined(USE_XKBCOMMON) | 119 #if defined(USE_XKBCOMMON) |
120 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(make_scoped_ptr( | 120 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(make_scoped_ptr( |
121 new XkbKeyboardLayoutEngine(xkb_evdev_code_converter_))); | 121 new XkbKeyboardLayoutEngine(xkb_evdev_code_converter_))); |
122 #else | 122 #else |
123 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( | 123 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( |
124 make_scoped_ptr(new StubKeyboardLayoutEngine())); | 124 make_scoped_ptr(new StubKeyboardLayoutEngine())); |
125 #endif | 125 #endif |
126 event_factory_ozone_.reset(new EventFactoryEvdev( | 126 event_factory_ozone_.reset(new EventFactoryEvdev( |
127 cursor_.get(), device_manager_.get(), | 127 cursor_.get(), device_manager_.get(), |
(...skipping 12 matching lines...) Expand all Loading... |
140 scoped_refptr<DrmDevice> drm_; | 140 scoped_refptr<DrmDevice> drm_; |
141 scoped_ptr<DrmDeviceManager> drm_device_manager_; | 141 scoped_ptr<DrmDeviceManager> drm_device_manager_; |
142 scoped_ptr<DrmBufferGenerator> buffer_generator_; | 142 scoped_ptr<DrmBufferGenerator> buffer_generator_; |
143 scoped_ptr<ScreenManager> screen_manager_; | 143 scoped_ptr<ScreenManager> screen_manager_; |
144 scoped_ptr<DrmGpuPlatformSupport> gpu_platform_support_; | 144 scoped_ptr<DrmGpuPlatformSupport> gpu_platform_support_; |
145 DrmWindowManager window_delegate_manager_; | 145 DrmWindowManager window_delegate_manager_; |
146 | 146 |
147 // Objects in the "Browser" process. | 147 // Objects in the "Browser" process. |
148 scoped_ptr<DeviceManager> device_manager_; | 148 scoped_ptr<DeviceManager> device_manager_; |
149 scoped_ptr<BitmapCursorFactoryOzone> cursor_factory_ozone_; | 149 scoped_ptr<BitmapCursorFactoryOzone> cursor_factory_ozone_; |
| 150 scoped_ptr<DrmWindowHostManager> window_manager_; |
150 scoped_ptr<DrmCursor> cursor_; | 151 scoped_ptr<DrmCursor> cursor_; |
151 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; | 152 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; |
152 scoped_ptr<DrmWindowHostManager> window_manager_; | |
153 scoped_ptr<DisplayManager> display_manager_; | 153 scoped_ptr<DisplayManager> display_manager_; |
154 scoped_ptr<DrmGpuPlatformSupportHost> gpu_platform_support_host_; | 154 scoped_ptr<DrmGpuPlatformSupportHost> gpu_platform_support_host_; |
155 | 155 |
156 #if defined(USE_XKBCOMMON) | 156 #if defined(USE_XKBCOMMON) |
157 XkbEvdevCodes xkb_evdev_code_converter_; | 157 XkbEvdevCodes xkb_evdev_code_converter_; |
158 #endif | 158 #endif |
159 | 159 |
160 // Objects on both processes. | 160 // Objects on both processes. |
161 scoped_ptr<DrmSurfaceFactory> surface_factory_ozone_; | 161 scoped_ptr<DrmSurfaceFactory> surface_factory_ozone_; |
162 | 162 |
163 OzoneGpuTestHelper gpu_helper_; | 163 OzoneGpuTestHelper gpu_helper_; |
164 | 164 |
165 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDrm); | 165 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDrm); |
166 }; | 166 }; |
167 | 167 |
168 } // namespace | 168 } // namespace |
169 | 169 |
170 OzonePlatform* CreateOzonePlatformDri() { | 170 OzonePlatform* CreateOzonePlatformDri() { |
171 return new OzonePlatformDrm; | 171 return new OzonePlatformDrm; |
172 } | 172 } |
173 | 173 |
174 OzonePlatform* CreateOzonePlatformDrm() { | 174 OzonePlatform* CreateOzonePlatformDrm() { |
175 return new OzonePlatformDrm; | 175 return new OzonePlatformDrm; |
176 } | 176 } |
177 | 177 |
178 } // namespace ui | 178 } // namespace ui |
OLD | NEW |