| 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 22 matching lines...) Expand all Loading... |
| 33 #include "ui/events/ozone/layout/xkb/xkb_evdev_codes.h" | 33 #include "ui/events/ozone/layout/xkb/xkb_evdev_codes.h" |
| 34 #include "ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.h" | 34 #include "ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.h" |
| 35 #else | 35 #else |
| 36 #include "ui/events/ozone/layout/stub/stub_keyboard_layout_engine.h" | 36 #include "ui/events/ozone/layout/stub/stub_keyboard_layout_engine.h" |
| 37 #endif | 37 #endif |
| 38 | 38 |
| 39 namespace ui { | 39 namespace ui { |
| 40 | 40 |
| 41 namespace { | 41 namespace { |
| 42 | 42 |
| 43 const char kDefaultGraphicsCardPath[] = "/dev/dri/card0"; | |
| 44 | |
| 45 // OzonePlatform for Linux DRI (Direct Rendering Infrastructure) | 43 // OzonePlatform for Linux DRI (Direct Rendering Infrastructure) |
| 46 // | 44 // |
| 47 // 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 |
| 48 // anything). This means chrome alone owns the display and input devices. | 46 // anything). This means chrome alone owns the display and input devices. |
| 49 class OzonePlatformDri : public OzonePlatform { | 47 class OzonePlatformDri : public OzonePlatform { |
| 50 public: | 48 public: |
| 51 OzonePlatformDri() | 49 OzonePlatformDri() |
| 52 : dri_(new DriWrapper(base::FilePath(kDefaultGraphicsCardPath))), | 50 : dri_(new DriWrapper(GetFirstDisplayCardPath())), |
| 53 buffer_generator_(new DriBufferGenerator()), | 51 buffer_generator_(new DriBufferGenerator()), |
| 54 screen_manager_(new ScreenManager(buffer_generator_.get())), | 52 screen_manager_(new ScreenManager(buffer_generator_.get())), |
| 55 device_manager_(CreateDeviceManager()), | 53 device_manager_(CreateDeviceManager()), |
| 56 window_delegate_manager_() {} | 54 window_delegate_manager_() {} |
| 57 ~OzonePlatformDri() override {} | 55 ~OzonePlatformDri() override {} |
| 58 | 56 |
| 59 // OzonePlatform: | 57 // OzonePlatform: |
| 60 ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() override { | 58 ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() override { |
| 61 return surface_factory_ozone_.get(); | 59 return surface_factory_ozone_.get(); |
| 62 } | 60 } |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri); | 154 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri); |
| 157 }; | 155 }; |
| 158 | 156 |
| 159 } // namespace | 157 } // namespace |
| 160 | 158 |
| 161 OzonePlatform* CreateOzonePlatformDri() { | 159 OzonePlatform* CreateOzonePlatformDri() { |
| 162 return new OzonePlatformDri; | 160 return new OzonePlatformDri; |
| 163 } | 161 } |
| 164 | 162 |
| 165 } // namespace ui | 163 } // namespace ui |
| OLD | NEW |