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

Side by Side Diff: ui/ozone/platform/drm/ozone_platform_drm.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/events/xkb.gni ('k') | ui/ozone/platform/drm/ozone_platform_gbm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/events/ozone/device/device_manager.h" 9 #include "ui/events/ozone/device/device_manager.h"
10 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h" 10 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h"
11 #include "ui/events/ozone/evdev/event_factory_evdev.h" 11 #include "ui/events/ozone/evdev/event_factory_evdev.h"
12 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h" 12 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h"
13 #include "ui/events/ozone/layout/stub/stub_keyboard_layout_engine.h"
13 #include "ui/ozone/platform/drm/common/drm_util.h" 14 #include "ui/ozone/platform/drm/common/drm_util.h"
14 #include "ui/ozone/platform/drm/gpu/drm_buffer.h" 15 #include "ui/ozone/platform/drm/gpu/drm_buffer.h"
15 #include "ui/ozone/platform/drm/gpu/drm_device.h" 16 #include "ui/ozone/platform/drm/gpu/drm_device.h"
16 #include "ui/ozone/platform/drm/gpu/drm_device_generator.h" 17 #include "ui/ozone/platform/drm/gpu/drm_device_generator.h"
17 #include "ui/ozone/platform/drm/gpu/drm_device_manager.h" 18 #include "ui/ozone/platform/drm/gpu/drm_device_manager.h"
18 #include "ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h" 19 #include "ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h"
19 #include "ui/ozone/platform/drm/gpu/drm_gpu_platform_support.h" 20 #include "ui/ozone/platform/drm/gpu/drm_gpu_platform_support.h"
20 #include "ui/ozone/platform/drm/gpu/drm_surface_factory.h" 21 #include "ui/ozone/platform/drm/gpu/drm_surface_factory.h"
21 #include "ui/ozone/platform/drm/gpu/drm_window.h" 22 #include "ui/ozone/platform/drm/gpu/drm_window.h"
22 #include "ui/ozone/platform/drm/gpu/screen_manager.h" 23 #include "ui/ozone/platform/drm/gpu/screen_manager.h"
23 #include "ui/ozone/platform/drm/host/drm_cursor.h" 24 #include "ui/ozone/platform/drm/host/drm_cursor.h"
24 #include "ui/ozone/platform/drm/host/drm_display_host_manager.h" 25 #include "ui/ozone/platform/drm/host/drm_display_host_manager.h"
25 #include "ui/ozone/platform/drm/host/drm_gpu_platform_support_host.h" 26 #include "ui/ozone/platform/drm/host/drm_gpu_platform_support_host.h"
26 #include "ui/ozone/platform/drm/host/drm_native_display_delegate.h" 27 #include "ui/ozone/platform/drm/host/drm_native_display_delegate.h"
27 #include "ui/ozone/platform/drm/host/drm_overlay_manager.h" 28 #include "ui/ozone/platform/drm/host/drm_overlay_manager.h"
28 #include "ui/ozone/platform/drm/host/drm_window_host.h" 29 #include "ui/ozone/platform/drm/host/drm_window_host.h"
29 #include "ui/ozone/platform/drm/host/drm_window_host_manager.h" 30 #include "ui/ozone/platform/drm/host/drm_window_host_manager.h"
30 #include "ui/ozone/public/ozone_gpu_test_helper.h" 31 #include "ui/ozone/public/ozone_gpu_test_helper.h"
31 #include "ui/ozone/public/ozone_platform.h" 32 #include "ui/ozone/public/ozone_platform.h"
32 33
33 #if defined(USE_XKBCOMMON)
34 #include "ui/events/ozone/layout/xkb/xkb_evdev_codes.h"
35 #include "ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.h"
36 #else
37 #include "ui/events/ozone/layout/stub/stub_keyboard_layout_engine.h"
38 #endif
39
40 namespace ui { 34 namespace ui {
41 35
42 namespace { 36 namespace {
43 37
44 // OzonePlatform for Linux DRM (Direct Rendering Manager) 38 // OzonePlatform for Linux DRM (Direct Rendering Manager)
45 // 39 //
46 // This platform is Linux without any display server (no X, wayland, or 40 // This platform is Linux without any display server (no X, wayland, or
47 // anything). This means chrome alone owns the display and input devices. 41 // anything). This means chrome alone owns the display and input devices.
48 class OzonePlatformDrm : public OzonePlatform { 42 class OzonePlatformDrm : public OzonePlatform {
49 public: 43 public:
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 82 }
89 scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() override { 83 scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() override {
90 return make_scoped_ptr( 84 return make_scoped_ptr(
91 new DrmNativeDisplayDelegate(display_manager_.get())); 85 new DrmNativeDisplayDelegate(display_manager_.get()));
92 } 86 }
93 void InitializeUI() override { 87 void InitializeUI() override {
94 drm_device_manager_.reset(new DrmDeviceManager( 88 drm_device_manager_.reset(new DrmDeviceManager(
95 scoped_ptr<DrmDeviceGenerator>(new DrmDeviceGenerator()))); 89 scoped_ptr<DrmDeviceGenerator>(new DrmDeviceGenerator())));
96 window_manager_.reset(new DrmWindowHostManager()); 90 window_manager_.reset(new DrmWindowHostManager());
97 cursor_.reset(new DrmCursor(window_manager_.get())); 91 cursor_.reset(new DrmCursor(window_manager_.get()));
98 #if defined(USE_XKBCOMMON)
99 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(make_scoped_ptr(
100 new XkbKeyboardLayoutEngine(xkb_evdev_code_converter_)));
101 #else
102 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( 92 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(
103 make_scoped_ptr(new StubKeyboardLayoutEngine())); 93 make_scoped_ptr(new StubKeyboardLayoutEngine()));
104 #endif
105 event_factory_ozone_.reset(new EventFactoryEvdev( 94 event_factory_ozone_.reset(new EventFactoryEvdev(
106 cursor_.get(), device_manager_.get(), 95 cursor_.get(), device_manager_.get(),
107 KeyboardLayoutEngineManager::GetKeyboardLayoutEngine())); 96 KeyboardLayoutEngineManager::GetKeyboardLayoutEngine()));
108 overlay_manager_.reset(new DrmOverlayManager(false, nullptr)); 97 overlay_manager_.reset(new DrmOverlayManager(false, nullptr));
109 surface_factory_ozone_.reset(new DrmSurfaceFactory(screen_manager_.get())); 98 surface_factory_ozone_.reset(new DrmSurfaceFactory(screen_manager_.get()));
110 scoped_ptr<DrmGpuDisplayManager> display_manager(new DrmGpuDisplayManager( 99 scoped_ptr<DrmGpuDisplayManager> display_manager(new DrmGpuDisplayManager(
111 screen_manager_.get(), drm_device_manager_.get())); 100 screen_manager_.get(), drm_device_manager_.get()));
112 gpu_platform_support_.reset(new DrmGpuPlatformSupport( 101 gpu_platform_support_.reset(new DrmGpuPlatformSupport(
113 drm_device_manager_.get(), screen_manager_.get(), 102 drm_device_manager_.get(), screen_manager_.get(),
114 buffer_generator_.get(), display_manager.Pass())); 103 buffer_generator_.get(), display_manager.Pass()));
(...skipping 19 matching lines...) Expand all
134 123
135 // Objects in the "Browser" process. 124 // Objects in the "Browser" process.
136 scoped_ptr<OverlayManagerOzone> overlay_manager_; 125 scoped_ptr<OverlayManagerOzone> overlay_manager_;
137 scoped_ptr<DeviceManager> device_manager_; 126 scoped_ptr<DeviceManager> device_manager_;
138 scoped_ptr<DrmWindowHostManager> window_manager_; 127 scoped_ptr<DrmWindowHostManager> window_manager_;
139 scoped_ptr<DrmCursor> cursor_; 128 scoped_ptr<DrmCursor> cursor_;
140 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; 129 scoped_ptr<EventFactoryEvdev> event_factory_ozone_;
141 scoped_ptr<DrmGpuPlatformSupportHost> gpu_platform_support_host_; 130 scoped_ptr<DrmGpuPlatformSupportHost> gpu_platform_support_host_;
142 scoped_ptr<DrmDisplayHostManager> display_manager_; 131 scoped_ptr<DrmDisplayHostManager> display_manager_;
143 132
144 #if defined(USE_XKBCOMMON)
145 XkbEvdevCodes xkb_evdev_code_converter_;
146 #endif
147
148 // Objects on both processes. 133 // Objects on both processes.
149 scoped_ptr<DrmSurfaceFactory> surface_factory_ozone_; 134 scoped_ptr<DrmSurfaceFactory> surface_factory_ozone_;
150 135
151 OzoneGpuTestHelper gpu_helper_; 136 OzoneGpuTestHelper gpu_helper_;
152 137
153 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDrm); 138 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDrm);
154 }; 139 };
155 140
156 } // namespace 141 } // namespace
157 142
158 OzonePlatform* CreateOzonePlatformDri() { 143 OzonePlatform* CreateOzonePlatformDri() {
159 return new OzonePlatformDrm; 144 return new OzonePlatformDrm;
160 } 145 }
161 146
162 OzonePlatform* CreateOzonePlatformDrm() { 147 OzonePlatform* CreateOzonePlatformDrm() {
163 return new OzonePlatformDrm; 148 return new OzonePlatformDrm;
164 } 149 }
165 150
166 } // namespace ui 151 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/xkb.gni ('k') | ui/ozone/platform/drm/ozone_platform_gbm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698