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 <fcntl.h> | 8 #include <fcntl.h> |
9 #include <gbm.h> | 9 #include <gbm.h> |
10 #include <stdlib.h> | 10 #include <stdlib.h> |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 } | 128 } |
129 | 129 |
130 std::unique_ptr<DrmWindowHost> platform_window(new DrmWindowHost( | 130 std::unique_ptr<DrmWindowHost> platform_window(new DrmWindowHost( |
131 delegate, bounds, adapter, event_factory_ozone_.get(), cursor_.get(), | 131 delegate, bounds, adapter, event_factory_ozone_.get(), cursor_.get(), |
132 window_manager_.get(), display_manager_.get(), overlay_manager_.get())); | 132 window_manager_.get(), display_manager_.get(), overlay_manager_.get())); |
133 platform_window->Initialize(); | 133 platform_window->Initialize(); |
134 return std::move(platform_window); | 134 return std::move(platform_window); |
135 } | 135 } |
136 std::unique_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() | 136 std::unique_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() |
137 override { | 137 override { |
138 return base::WrapUnique( | 138 return base::MakeUnique<DrmNativeDisplayDelegate>(display_manager_.get()); |
139 new DrmNativeDisplayDelegate(display_manager_.get())); | |
140 } | 139 } |
141 void InitializeUI() override { | 140 void InitializeUI() override { |
142 InitParams default_params; | 141 InitParams default_params; |
143 InitializeUI(default_params); | 142 InitializeUI(default_params); |
144 } | 143 } |
145 void InitializeUI(const InitParams& args) override { | 144 void InitializeUI(const InitParams& args) override { |
146 // Ozone drm can operate in three modes configured at runtime: | 145 // Ozone drm can operate in three modes configured at runtime: |
147 // 1. legacy mode where browser and gpu components communicate | 146 // 1. legacy mode where browser and gpu components communicate |
148 // via param traits IPC. | 147 // via param traits IPC. |
149 // 2. single-process mode where browser and gpu components | 148 // 2. single-process mode where browser and gpu components |
150 // communicate via PostTask. | 149 // communicate via PostTask. |
151 // 3. mojo mode where browser and gpu components communicate | 150 // 3. mojo mode where browser and gpu components communicate |
152 // via mojo IPC. | 151 // via mojo IPC. |
153 // Currently, mojo mode uses mojo in a single process but this is | 152 // Currently, mojo mode uses mojo in a single process but this is |
154 // an interim implementation detail that will be eliminated in a | 153 // an interim implementation detail that will be eliminated in a |
155 // future CL. | 154 // future CL. |
156 single_process_ = args.single_process; | 155 single_process_ = args.single_process; |
157 using_mojo_ = args.connector != nullptr; | 156 using_mojo_ = args.connector != nullptr; |
158 DCHECK(!(using_mojo_ && single_process_)); | 157 DCHECK(!(using_mojo_ && single_process_)); |
159 | 158 |
160 device_manager_ = CreateDeviceManager(); | 159 device_manager_ = CreateDeviceManager(); |
161 window_manager_.reset(new DrmWindowHostManager()); | 160 window_manager_.reset(new DrmWindowHostManager()); |
162 cursor_.reset(new DrmCursor(window_manager_.get())); | 161 cursor_.reset(new DrmCursor(window_manager_.get())); |
163 #if defined(USE_XKBCOMMON) | 162 #if defined(USE_XKBCOMMON) |
164 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(base::WrapUnique( | 163 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( |
165 new XkbKeyboardLayoutEngine(xkb_evdev_code_converter_))); | 164 base::MakeUnique<XkbKeyboardLayoutEngine>(xkb_evdev_code_converter_)); |
166 #else | 165 #else |
167 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( | 166 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( |
168 base::WrapUnique(new StubKeyboardLayoutEngine())); | 167 base::MakeUnique<StubKeyboardLayoutEngine>()); |
169 #endif | 168 #endif |
170 | 169 |
171 event_factory_ozone_.reset(new EventFactoryEvdev( | 170 event_factory_ozone_.reset(new EventFactoryEvdev( |
172 cursor_.get(), device_manager_.get(), | 171 cursor_.get(), device_manager_.get(), |
173 KeyboardLayoutEngineManager::GetKeyboardLayoutEngine())); | 172 KeyboardLayoutEngineManager::GetKeyboardLayoutEngine())); |
174 | 173 |
175 GpuThreadAdapter* adapter; | 174 GpuThreadAdapter* adapter; |
176 | 175 |
177 // TODO(rjkroege): Once mus is split, only do this for single_process. | 176 // TODO(rjkroege): Once mus is split, only do this for single_process. |
178 if (single_process_ || using_mojo_) | 177 if (single_process_ || using_mojo_) |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 DISALLOW_COPY_AND_ASSIGN(OzonePlatformGbm); | 269 DISALLOW_COPY_AND_ASSIGN(OzonePlatformGbm); |
271 }; | 270 }; |
272 | 271 |
273 } // namespace | 272 } // namespace |
274 | 273 |
275 OzonePlatform* CreateOzonePlatformGbm() { | 274 OzonePlatform* CreateOzonePlatformGbm() { |
276 return new OzonePlatformGbm; | 275 return new OzonePlatformGbm; |
277 } | 276 } |
278 | 277 |
279 } // namespace ui | 278 } // namespace ui |
OLD | NEW |