Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Side by Side Diff: ui/ozone/platform/drm/ozone_platform_gbm.cc

Issue 1528443003: Remove xkbcommon support. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/ozone/platform/drm/ozone_platform_drm.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 #include "base/at_exit.h" 11 #include "base/at_exit.h"
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/thread_task_runner_handle.h" 14 #include "base/thread_task_runner_handle.h"
15 #include "ui/events/ozone/device/device_manager.h" 15 #include "ui/events/ozone/device/device_manager.h"
16 #include "ui/events/ozone/evdev/event_factory_evdev.h" 16 #include "ui/events/ozone/evdev/event_factory_evdev.h"
17 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h" 17 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h"
18 #include "ui/events/ozone/layout/stub/stub_keyboard_layout_engine.h"
18 #include "ui/ozone/platform/drm/common/drm_util.h" 19 #include "ui/ozone/platform/drm/common/drm_util.h"
19 #include "ui/ozone/platform/drm/gpu/drm_device_generator.h" 20 #include "ui/ozone/platform/drm/gpu/drm_device_generator.h"
20 #include "ui/ozone/platform/drm/gpu/drm_device_manager.h" 21 #include "ui/ozone/platform/drm/gpu/drm_device_manager.h"
21 #include "ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h" 22 #include "ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h"
22 #include "ui/ozone/platform/drm/gpu/drm_gpu_platform_support.h" 23 #include "ui/ozone/platform/drm/gpu/drm_gpu_platform_support.h"
23 #include "ui/ozone/platform/drm/gpu/gbm_buffer.h" 24 #include "ui/ozone/platform/drm/gpu/gbm_buffer.h"
24 #include "ui/ozone/platform/drm/gpu/gbm_device.h" 25 #include "ui/ozone/platform/drm/gpu/gbm_device.h"
25 #include "ui/ozone/platform/drm/gpu/gbm_surface.h" 26 #include "ui/ozone/platform/drm/gpu/gbm_surface.h"
26 #include "ui/ozone/platform/drm/gpu/gbm_surface_factory.h" 27 #include "ui/ozone/platform/drm/gpu/gbm_surface_factory.h"
27 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h" 28 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h"
28 #include "ui/ozone/platform/drm/gpu/screen_manager.h" 29 #include "ui/ozone/platform/drm/gpu/screen_manager.h"
29 #include "ui/ozone/platform/drm/host/drm_cursor.h" 30 #include "ui/ozone/platform/drm/host/drm_cursor.h"
30 #include "ui/ozone/platform/drm/host/drm_display_host_manager.h" 31 #include "ui/ozone/platform/drm/host/drm_display_host_manager.h"
31 #include "ui/ozone/platform/drm/host/drm_gpu_platform_support_host.h" 32 #include "ui/ozone/platform/drm/host/drm_gpu_platform_support_host.h"
32 #include "ui/ozone/platform/drm/host/drm_native_display_delegate.h" 33 #include "ui/ozone/platform/drm/host/drm_native_display_delegate.h"
33 #include "ui/ozone/platform/drm/host/drm_overlay_manager.h" 34 #include "ui/ozone/platform/drm/host/drm_overlay_manager.h"
34 #include "ui/ozone/platform/drm/host/drm_window_host.h" 35 #include "ui/ozone/platform/drm/host/drm_window_host.h"
35 #include "ui/ozone/platform/drm/host/drm_window_host_manager.h" 36 #include "ui/ozone/platform/drm/host/drm_window_host_manager.h"
36 #include "ui/ozone/public/cursor_factory_ozone.h" 37 #include "ui/ozone/public/cursor_factory_ozone.h"
37 #include "ui/ozone/public/gpu_platform_support.h" 38 #include "ui/ozone/public/gpu_platform_support.h"
38 #include "ui/ozone/public/gpu_platform_support_host.h" 39 #include "ui/ozone/public/gpu_platform_support_host.h"
39 #include "ui/ozone/public/ipc_init_helper_ozone.h" 40 #include "ui/ozone/public/ipc_init_helper_ozone.h"
40 #include "ui/ozone/public/ozone_gpu_test_helper.h" 41 #include "ui/ozone/public/ozone_gpu_test_helper.h"
41 #include "ui/ozone/public/ozone_platform.h" 42 #include "ui/ozone/public/ozone_platform.h"
42 #include "ui/ozone/public/ozone_switches.h" 43 #include "ui/ozone/public/ozone_switches.h"
43 44
44 #if defined(USE_XKBCOMMON)
45 #include "ui/events/ozone/layout/xkb/xkb_evdev_codes.h"
46 #include "ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.h"
47 #else
48 #include "ui/events/ozone/layout/stub/stub_keyboard_layout_engine.h"
49 #endif
50
51 namespace ui { 45 namespace ui {
52 46
53 namespace { 47 namespace {
54 48
55 class GlApiLoader { 49 class GlApiLoader {
56 public: 50 public:
57 GlApiLoader() 51 GlApiLoader()
58 : glapi_lib_(dlopen("libglapi.so.0", RTLD_LAZY | RTLD_GLOBAL)) {} 52 : glapi_lib_(dlopen("libglapi.so.0", RTLD_LAZY | RTLD_GLOBAL)) {}
59 53
60 ~GlApiLoader() { 54 ~GlApiLoader() {
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 return platform_window.Pass(); 148 return platform_window.Pass();
155 } 149 }
156 scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() override { 150 scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() override {
157 return make_scoped_ptr( 151 return make_scoped_ptr(
158 new DrmNativeDisplayDelegate(display_manager_.get())); 152 new DrmNativeDisplayDelegate(display_manager_.get()));
159 } 153 }
160 void InitializeUI() override { 154 void InitializeUI() override {
161 device_manager_ = CreateDeviceManager(); 155 device_manager_ = CreateDeviceManager();
162 window_manager_.reset(new DrmWindowHostManager()); 156 window_manager_.reset(new DrmWindowHostManager());
163 cursor_.reset(new DrmCursor(window_manager_.get())); 157 cursor_.reset(new DrmCursor(window_manager_.get()));
164 #if defined(USE_XKBCOMMON)
165 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(make_scoped_ptr(
166 new XkbKeyboardLayoutEngine(xkb_evdev_code_converter_)));
167 #else
168 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( 158 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(
169 make_scoped_ptr(new StubKeyboardLayoutEngine())); 159 make_scoped_ptr(new StubKeyboardLayoutEngine()));
170 #endif
171 event_factory_ozone_.reset(new EventFactoryEvdev( 160 event_factory_ozone_.reset(new EventFactoryEvdev(
172 cursor_.get(), device_manager_.get(), 161 cursor_.get(), device_manager_.get(),
173 KeyboardLayoutEngineManager::GetKeyboardLayoutEngine())); 162 KeyboardLayoutEngineManager::GetKeyboardLayoutEngine()));
174 gpu_platform_support_host_.reset( 163 gpu_platform_support_host_.reset(
175 new DrmGpuPlatformSupportHost(cursor_.get())); 164 new DrmGpuPlatformSupportHost(cursor_.get()));
176 display_manager_.reset(new DrmDisplayHostManager( 165 display_manager_.reset(new DrmDisplayHostManager(
177 gpu_platform_support_host_.get(), device_manager_.get(), 166 gpu_platform_support_host_.get(), device_manager_.get(),
178 event_factory_ozone_->input_controller())); 167 event_factory_ozone_->input_controller()));
179 overlay_manager_.reset(new DrmOverlayManager( 168 overlay_manager_.reset(new DrmOverlayManager(
180 use_surfaceless_, gpu_platform_support_host_.get())); 169 use_surfaceless_, gpu_platform_support_host_.get()));
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 204
216 // Objects in the Browser process. 205 // Objects in the Browser process.
217 scoped_ptr<DeviceManager> device_manager_; 206 scoped_ptr<DeviceManager> device_manager_;
218 scoped_ptr<DrmWindowHostManager> window_manager_; 207 scoped_ptr<DrmWindowHostManager> window_manager_;
219 scoped_ptr<DrmCursor> cursor_; 208 scoped_ptr<DrmCursor> cursor_;
220 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; 209 scoped_ptr<EventFactoryEvdev> event_factory_ozone_;
221 scoped_ptr<DrmGpuPlatformSupportHost> gpu_platform_support_host_; 210 scoped_ptr<DrmGpuPlatformSupportHost> gpu_platform_support_host_;
222 scoped_ptr<DrmDisplayHostManager> display_manager_; 211 scoped_ptr<DrmDisplayHostManager> display_manager_;
223 scoped_ptr<DrmOverlayManager> overlay_manager_; 212 scoped_ptr<DrmOverlayManager> overlay_manager_;
224 213
225 #if defined(USE_XKBCOMMON)
226 XkbEvdevCodes xkb_evdev_code_converter_;
227 #endif
228
229 DISALLOW_COPY_AND_ASSIGN(OzonePlatformGbm); 214 DISALLOW_COPY_AND_ASSIGN(OzonePlatformGbm);
230 }; 215 };
231 216
232 } // namespace 217 } // namespace
233 218
234 OzonePlatform* CreateOzonePlatformGbm() { 219 OzonePlatform* CreateOzonePlatformGbm() {
235 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); 220 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
236 // Always go surfaceless. 221 // Always go surfaceless.
237 cmd->AppendSwitch(switches::kOzoneUseSurfaceless); 222 cmd->AppendSwitch(switches::kOzoneUseSurfaceless);
238 return new OzonePlatformGbm(cmd->HasSwitch(switches::kOzoneUseSurfaceless)); 223 return new OzonePlatformGbm(cmd->HasSwitch(switches::kOzoneUseSurfaceless));
239 } 224 }
240 225
241 } // namespace ui 226 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/ozone_platform_drm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698