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

Side by Side Diff: ui/ozone/platform/dri/ozone_platform_dri.cc

Issue 778503002: XKB implementation of Ozone key layout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@x430194-layout
Patch Set: address review comments (spang, 3) Created 6 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
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/dri/ozone_platform_dri.h" 5 #include "ui/ozone/platform/dri/ozone_platform_dri.h"
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h" 8 #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.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 #if defined(USE_XKBCOMMON)
14 #include "ui/events/ozone/layout/xkb/xkb_evdev_codes.h"
15 #include "ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.h"
16 #else
spang 2014/12/15 19:53:44 conditional #includes go below the unconditional o
kpschoedel 2014/12/15 20:10:22 Done.
13 #include "ui/events/ozone/layout/stub/stub_keyboard_layout_engine.h" 17 #include "ui/events/ozone/layout/stub/stub_keyboard_layout_engine.h"
18 #endif
14 #include "ui/ozone/platform/dri/display_manager.h" 19 #include "ui/ozone/platform/dri/display_manager.h"
15 #include "ui/ozone/platform/dri/dri_buffer.h" 20 #include "ui/ozone/platform/dri/dri_buffer.h"
16 #include "ui/ozone/platform/dri/dri_cursor.h" 21 #include "ui/ozone/platform/dri/dri_cursor.h"
17 #include "ui/ozone/platform/dri/dri_gpu_platform_support.h" 22 #include "ui/ozone/platform/dri/dri_gpu_platform_support.h"
18 #include "ui/ozone/platform/dri/dri_gpu_platform_support_host.h" 23 #include "ui/ozone/platform/dri/dri_gpu_platform_support_host.h"
19 #include "ui/ozone/platform/dri/dri_surface_factory.h" 24 #include "ui/ozone/platform/dri/dri_surface_factory.h"
20 #include "ui/ozone/platform/dri/dri_window.h" 25 #include "ui/ozone/platform/dri/dri_window.h"
21 #include "ui/ozone/platform/dri/dri_window_delegate_impl.h" 26 #include "ui/ozone/platform/dri/dri_window_delegate_impl.h"
22 #include "ui/ozone/platform/dri/dri_window_delegate_manager.h" 27 #include "ui/ozone/platform/dri/dri_window_delegate_manager.h"
23 #include "ui/ozone/platform/dri/dri_window_manager.h" 28 #include "ui/ozone/platform/dri/dri_window_manager.h"
24 #include "ui/ozone/platform/dri/dri_wrapper.h" 29 #include "ui/ozone/platform/dri/dri_wrapper.h"
25 #include "ui/ozone/platform/dri/native_display_delegate_dri.h" 30 #include "ui/ozone/platform/dri/native_display_delegate_dri.h"
26 #include "ui/ozone/platform/dri/native_display_delegate_proxy.h" 31 #include "ui/ozone/platform/dri/native_display_delegate_proxy.h"
27 #include "ui/ozone/platform/dri/screen_manager.h" 32 #include "ui/ozone/platform/dri/screen_manager.h"
28 #include "ui/ozone/public/ozone_platform.h" 33 #include "ui/ozone/public/ozone_platform.h"
29 #include "ui/ozone/public/ui_thread_gpu.h" 34 #include "ui/ozone/public/ui_thread_gpu.h"
30 35
spang 2014/12/15 19:53:44 put them here after a blank line
kpschoedel 2014/12/15 20:10:22 Acknowledged.
31 namespace ui { 36 namespace ui {
32 37
33 namespace { 38 namespace {
34 39
35 const char kDefaultGraphicsCardPath[] = "/dev/dri/card0"; 40 const char kDefaultGraphicsCardPath[] = "/dev/dri/card0";
36 41
37 // OzonePlatform for Linux DRI (Direct Rendering Infrastructure) 42 // OzonePlatform for Linux DRI (Direct Rendering Infrastructure)
38 // 43 //
39 // This platform is Linux without any display server (no X, wayland, or 44 // This platform is Linux without any display server (no X, wayland, or
40 // anything). This means chrome alone owns the display and input devices. 45 // anything). This means chrome alone owns the display and input devices.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 scoped_ptr<NativeDisplayDelegateDri> ndd( 97 scoped_ptr<NativeDisplayDelegateDri> ndd(
93 new NativeDisplayDelegateDri(dri_.get(), screen_manager_.get())); 98 new NativeDisplayDelegateDri(dri_.get(), screen_manager_.get()));
94 ndd->Initialize(); 99 ndd->Initialize();
95 gpu_platform_support_.reset( 100 gpu_platform_support_.reset(
96 new DriGpuPlatformSupport(dri_.get(), &window_delegate_manager_, 101 new DriGpuPlatformSupport(dri_.get(), &window_delegate_manager_,
97 screen_manager_.get(), ndd.Pass())); 102 screen_manager_.get(), ndd.Pass()));
98 gpu_platform_support_host_.reset(new DriGpuPlatformSupportHost()); 103 gpu_platform_support_host_.reset(new DriGpuPlatformSupportHost());
99 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); 104 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone);
100 window_manager_.reset( 105 window_manager_.reset(
101 new DriWindowManager(gpu_platform_support_host_.get())); 106 new DriWindowManager(gpu_platform_support_host_.get()));
107 #if defined(USE_XKBCOMMON)
108 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(make_scoped_ptr(
109 new XkbKeyboardLayoutEngine(xkb_evdev_code_converter_)));
110 #else
102 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( 111 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(
103 make_scoped_ptr(new StubKeyboardLayoutEngine())); 112 make_scoped_ptr(new StubKeyboardLayoutEngine()));
113 #endif
104 event_factory_ozone_.reset(new EventFactoryEvdev( 114 event_factory_ozone_.reset(new EventFactoryEvdev(
105 window_manager_->cursor(), device_manager_.get(), 115 window_manager_->cursor(), device_manager_.get(),
106 KeyboardLayoutEngineManager::GetKeyboardLayoutEngine())); 116 KeyboardLayoutEngineManager::GetKeyboardLayoutEngine()));
107 117
108 if (!ui_thread_gpu_.Initialize()) 118 if (!ui_thread_gpu_.Initialize())
109 LOG(FATAL) << "Failed to initialize dummy channel."; 119 LOG(FATAL) << "Failed to initialize dummy channel.";
110 } 120 }
111 121
112 void InitializeGPU() override {} 122 void InitializeGPU() override {}
113 123
(...skipping 10 matching lines...) Expand all
124 scoped_ptr<DriWindowManager> window_manager_; 134 scoped_ptr<DriWindowManager> window_manager_;
125 scoped_ptr<DisplayManager> display_manager_; 135 scoped_ptr<DisplayManager> display_manager_;
126 136
127 scoped_ptr<DriGpuPlatformSupport> gpu_platform_support_; 137 scoped_ptr<DriGpuPlatformSupport> gpu_platform_support_;
128 scoped_ptr<DriGpuPlatformSupportHost> gpu_platform_support_host_; 138 scoped_ptr<DriGpuPlatformSupportHost> gpu_platform_support_host_;
129 139
130 DriWindowDelegateManager window_delegate_manager_; 140 DriWindowDelegateManager window_delegate_manager_;
131 141
132 UiThreadGpu ui_thread_gpu_; 142 UiThreadGpu ui_thread_gpu_;
133 143
144 #if defined(USE_XKBCOMMON)
145 XkbEvdevCodes xkb_evdev_code_converter_;
146 #endif
147
134 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri); 148 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri);
135 }; 149 };
136 150
137 } // namespace 151 } // namespace
138 152
139 OzonePlatform* CreateOzonePlatformDri() { 153 OzonePlatform* CreateOzonePlatformDri() {
140 return new OzonePlatformDri; 154 return new OzonePlatformDri;
141 } 155 }
142 156
143 } // namespace ui 157 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698