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" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 const char kDefaultGraphicsCardPath[] = "/dev/dri/card0"; | 41 const char kDefaultGraphicsCardPath[] = "/dev/dri/card0"; |
42 | 42 |
43 // OzonePlatform for Linux DRI (Direct Rendering Infrastructure) | 43 // OzonePlatform for Linux DRI (Direct Rendering Infrastructure) |
44 // | 44 // |
45 // This platform is Linux without any display server (no X, wayland, or | 45 // This platform is Linux without any display server (no X, wayland, or |
46 // anything). This means chrome alone owns the display and input devices. | 46 // anything). This means chrome alone owns the display and input devices. |
47 class OzonePlatformDri : public OzonePlatform { | 47 class OzonePlatformDri : public OzonePlatform { |
48 public: | 48 public: |
49 OzonePlatformDri() | 49 OzonePlatformDri() |
50 : dri_(new DriWrapper(kDefaultGraphicsCardPath, true)), | 50 : dri_(new DriWrapper(kDefaultGraphicsCardPath, nullptr)), |
51 buffer_generator_(new DriBufferGenerator()), | 51 buffer_generator_(new DriBufferGenerator()), |
52 screen_manager_(new ScreenManager(dri_.get(), buffer_generator_.get())), | 52 screen_manager_(new ScreenManager(dri_.get(), buffer_generator_.get())), |
53 device_manager_(CreateDeviceManager()) {} | 53 device_manager_(CreateDeviceManager()) {} |
54 ~OzonePlatformDri() override {} | 54 ~OzonePlatformDri() override {} |
55 | 55 |
56 // OzonePlatform: | 56 // OzonePlatform: |
57 ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() override { | 57 ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() override { |
58 return surface_factory_ozone_.get(); | 58 return surface_factory_ozone_.get(); |
59 } | 59 } |
60 CursorFactoryOzone* GetCursorFactoryOzone() override { | 60 CursorFactoryOzone* GetCursorFactoryOzone() override { |
(...skipping 29 matching lines...) Expand all Loading... |
90 void InitializeUI() override { | 90 void InitializeUI() override { |
91 dri_->Initialize(); | 91 dri_->Initialize(); |
92 display_manager_.reset(new DisplayManager()); | 92 display_manager_.reset(new DisplayManager()); |
93 surface_factory_ozone_.reset( | 93 surface_factory_ozone_.reset( |
94 new DriSurfaceFactory(dri_.get(), &window_delegate_manager_)); | 94 new DriSurfaceFactory(dri_.get(), &window_delegate_manager_)); |
95 scoped_ptr<NativeDisplayDelegateDri> ndd( | 95 scoped_ptr<NativeDisplayDelegateDri> ndd( |
96 new NativeDisplayDelegateDri(dri_.get(), screen_manager_.get())); | 96 new NativeDisplayDelegateDri(dri_.get(), screen_manager_.get())); |
97 ndd->Initialize(); | 97 ndd->Initialize(); |
98 gpu_platform_support_.reset( | 98 gpu_platform_support_.reset( |
99 new DriGpuPlatformSupport(dri_.get(), &window_delegate_manager_, | 99 new DriGpuPlatformSupport(dri_.get(), &window_delegate_manager_, |
100 screen_manager_.get(), ndd.Pass())); | 100 screen_manager_.get(), nullptr, ndd.Pass())); |
101 gpu_platform_support_host_.reset(new DriGpuPlatformSupportHost()); | 101 gpu_platform_support_host_.reset(new DriGpuPlatformSupportHost()); |
102 window_manager_.reset(new DriWindowManager()); | 102 window_manager_.reset(new DriWindowManager()); |
103 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); | 103 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); |
104 cursor_.reset( | 104 cursor_.reset( |
105 new DriCursor(window_manager_.get(), gpu_platform_support_host_.get())); | 105 new DriCursor(window_manager_.get(), gpu_platform_support_host_.get())); |
106 cursor_->Init(); | 106 cursor_->Init(); |
107 #if defined(USE_XKBCOMMON) | 107 #if defined(USE_XKBCOMMON) |
108 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(make_scoped_ptr( | 108 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(make_scoped_ptr( |
109 new XkbKeyboardLayoutEngine(xkb_evdev_code_converter_))); | 109 new XkbKeyboardLayoutEngine(xkb_evdev_code_converter_))); |
110 #else | 110 #else |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri); | 149 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri); |
150 }; | 150 }; |
151 | 151 |
152 } // namespace | 152 } // namespace |
153 | 153 |
154 OzonePlatform* CreateOzonePlatformDri() { | 154 OzonePlatform* CreateOzonePlatformDri() { |
155 return new OzonePlatformDri; | 155 return new OzonePlatformDri; |
156 } | 156 } |
157 | 157 |
158 } // namespace ui | 158 } // namespace ui |
OLD | NEW |