| 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/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 #include "ui/events/ozone/layout/stub/stub_keyboard_layout_engine.h" | 13 #include "ui/events/ozone/layout/xkb/xkb_evdev_codes.h" |
| 14 #include "ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.h" |
| 14 #include "ui/ozone/platform/dri/display_manager.h" | 15 #include "ui/ozone/platform/dri/display_manager.h" |
| 15 #include "ui/ozone/platform/dri/dri_buffer.h" | 16 #include "ui/ozone/platform/dri/dri_buffer.h" |
| 16 #include "ui/ozone/platform/dri/dri_cursor.h" | 17 #include "ui/ozone/platform/dri/dri_cursor.h" |
| 17 #include "ui/ozone/platform/dri/dri_gpu_platform_support.h" | 18 #include "ui/ozone/platform/dri/dri_gpu_platform_support.h" |
| 18 #include "ui/ozone/platform/dri/dri_gpu_platform_support_host.h" | 19 #include "ui/ozone/platform/dri/dri_gpu_platform_support_host.h" |
| 19 #include "ui/ozone/platform/dri/dri_surface_factory.h" | 20 #include "ui/ozone/platform/dri/dri_surface_factory.h" |
| 20 #include "ui/ozone/platform/dri/dri_window.h" | 21 #include "ui/ozone/platform/dri/dri_window.h" |
| 21 #include "ui/ozone/platform/dri/dri_window_delegate_impl.h" | 22 #include "ui/ozone/platform/dri/dri_window_delegate_impl.h" |
| 22 #include "ui/ozone/platform/dri/dri_window_delegate_manager.h" | 23 #include "ui/ozone/platform/dri/dri_window_delegate_manager.h" |
| 23 #include "ui/ozone/platform/dri/dri_window_manager.h" | 24 #include "ui/ozone/platform/dri/dri_window_manager.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 scoped_ptr<NativeDisplayDelegateDri> ndd( | 93 scoped_ptr<NativeDisplayDelegateDri> ndd( |
| 93 new NativeDisplayDelegateDri(dri_.get(), screen_manager_.get())); | 94 new NativeDisplayDelegateDri(dri_.get(), screen_manager_.get())); |
| 94 ndd->Initialize(); | 95 ndd->Initialize(); |
| 95 gpu_platform_support_.reset( | 96 gpu_platform_support_.reset( |
| 96 new DriGpuPlatformSupport(dri_.get(), &window_delegate_manager_, | 97 new DriGpuPlatformSupport(dri_.get(), &window_delegate_manager_, |
| 97 screen_manager_.get(), ndd.Pass())); | 98 screen_manager_.get(), ndd.Pass())); |
| 98 gpu_platform_support_host_.reset(new DriGpuPlatformSupportHost()); | 99 gpu_platform_support_host_.reset(new DriGpuPlatformSupportHost()); |
| 99 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); | 100 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); |
| 100 window_manager_.reset( | 101 window_manager_.reset( |
| 101 new DriWindowManager(gpu_platform_support_host_.get())); | 102 new DriWindowManager(gpu_platform_support_host_.get())); |
| 102 KeyboardLayoutEngineManager::Create( | 103 KeyboardLayoutEngineManager::Create(make_scoped_ptr( |
| 103 make_scoped_ptr(new StubKeyboardLayoutEngine())); | 104 new XkbKeyboardLayoutEngine(xkb_evdev_code_converter_))); |
| 104 event_factory_ozone_.reset(new EventFactoryEvdev( | 105 event_factory_ozone_.reset(new EventFactoryEvdev( |
| 105 window_manager_->cursor(), device_manager_.get(), | 106 window_manager_->cursor(), device_manager_.get(), |
| 106 KeyboardLayoutEngineManager::GetKeyboardLayoutEngine())); | 107 KeyboardLayoutEngineManager::GetKeyboardLayoutEngine())); |
| 107 if (surface_factory_ozone_->InitializeHardware() != | 108 if (surface_factory_ozone_->InitializeHardware() != |
| 108 DriSurfaceFactory::INITIALIZED) | 109 DriSurfaceFactory::INITIALIZED) |
| 109 LOG(FATAL) << "Failed to initialize display hardware."; | 110 LOG(FATAL) << "Failed to initialize display hardware."; |
| 110 | 111 |
| 111 if (!ui_thread_gpu_.Initialize()) | 112 if (!ui_thread_gpu_.Initialize()) |
| 112 LOG(FATAL) << "Failed to initialize dummy channel."; | 113 LOG(FATAL) << "Failed to initialize dummy channel."; |
| 113 } | 114 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 127 scoped_ptr<DriWindowManager> window_manager_; | 128 scoped_ptr<DriWindowManager> window_manager_; |
| 128 scoped_ptr<DisplayManager> display_manager_; | 129 scoped_ptr<DisplayManager> display_manager_; |
| 129 | 130 |
| 130 scoped_ptr<DriGpuPlatformSupport> gpu_platform_support_; | 131 scoped_ptr<DriGpuPlatformSupport> gpu_platform_support_; |
| 131 scoped_ptr<DriGpuPlatformSupportHost> gpu_platform_support_host_; | 132 scoped_ptr<DriGpuPlatformSupportHost> gpu_platform_support_host_; |
| 132 | 133 |
| 133 DriWindowDelegateManager window_delegate_manager_; | 134 DriWindowDelegateManager window_delegate_manager_; |
| 134 | 135 |
| 135 UiThreadGpu ui_thread_gpu_; | 136 UiThreadGpu ui_thread_gpu_; |
| 136 | 137 |
| 138 XkbEvdevCodes xkb_evdev_code_converter_; |
| 139 |
| 137 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri); | 140 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri); |
| 138 }; | 141 }; |
| 139 | 142 |
| 140 } // namespace | 143 } // namespace |
| 141 | 144 |
| 142 OzonePlatform* CreateOzonePlatformDri() { | 145 OzonePlatform* CreateOzonePlatformDri() { |
| 143 return new OzonePlatformDri; | 146 return new OzonePlatformDri; |
| 144 } | 147 } |
| 145 | 148 |
| 146 } // namespace ui | 149 } // namespace ui |
| OLD | NEW |