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)), | 50 : dri_(new DriWrapper(kDefaultGraphicsCardPath, true)), |
51 buffer_generator_(new DriBufferGenerator(dri_.get())), | 51 buffer_generator_(new DriBufferGenerator(dri_.get())), |
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 base::AtExitManager::RegisterTask( | 54 base::AtExitManager::RegisterTask( |
55 base::Bind(&base::DeletePointer<OzonePlatformDri>, this)); | 55 base::Bind(&base::DeletePointer<OzonePlatformDri>, this)); |
56 } | 56 } |
57 ~OzonePlatformDri() override {} | 57 ~OzonePlatformDri() override {} |
58 | 58 |
59 // OzonePlatform: | 59 // OzonePlatform: |
60 ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() override { | 60 ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() override { |
(...skipping 88 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 |