OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/drm/ozone_platform_gbm.h" | 5 #include "ui/ozone/platform/drm/ozone_platform_gbm.h" |
6 | 6 |
7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <gbm.h> | 9 #include <gbm.h> |
10 #include <stdlib.h> | 10 #include <stdlib.h> |
11 #include <xf86drm.h> | 11 #include <xf86drm.h> |
| 12 #include <utility> |
12 | 13 |
13 #include "base/bind.h" | 14 #include "base/bind.h" |
14 #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h" | 15 #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h" |
15 #include "ui/events/ozone/device/device_manager.h" | 16 #include "ui/events/ozone/device/device_manager.h" |
16 #include "ui/events/ozone/evdev/event_factory_evdev.h" | 17 #include "ui/events/ozone/evdev/event_factory_evdev.h" |
17 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h" | 18 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h" |
18 #include "ui/ozone/platform/drm/common/drm_util.h" | 19 #include "ui/ozone/platform/drm/common/drm_util.h" |
19 #include "ui/ozone/platform/drm/gpu/drm_device_generator.h" | 20 #include "ui/ozone/platform/drm/gpu/drm_device_generator.h" |
20 #include "ui/ozone/platform/drm/gpu/drm_device_manager.h" | 21 #include "ui/ozone/platform/drm/gpu/drm_device_manager.h" |
21 #include "ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h" | 22 #include "ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 return event_factory_ozone_->CreateSystemInputInjector(); | 99 return event_factory_ozone_->CreateSystemInputInjector(); |
99 } | 100 } |
100 scoped_ptr<PlatformWindow> CreatePlatformWindow( | 101 scoped_ptr<PlatformWindow> CreatePlatformWindow( |
101 PlatformWindowDelegate* delegate, | 102 PlatformWindowDelegate* delegate, |
102 const gfx::Rect& bounds) override { | 103 const gfx::Rect& bounds) override { |
103 scoped_ptr<DrmWindowHost> platform_window( | 104 scoped_ptr<DrmWindowHost> platform_window( |
104 new DrmWindowHost(delegate, bounds, gpu_platform_support_host_.get(), | 105 new DrmWindowHost(delegate, bounds, gpu_platform_support_host_.get(), |
105 event_factory_ozone_.get(), cursor_.get(), | 106 event_factory_ozone_.get(), cursor_.get(), |
106 window_manager_.get(), display_manager_.get())); | 107 window_manager_.get(), display_manager_.get())); |
107 platform_window->Initialize(); | 108 platform_window->Initialize(); |
108 return platform_window.Pass(); | 109 return std::move(platform_window); |
109 } | 110 } |
110 scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() override { | 111 scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() override { |
111 return make_scoped_ptr( | 112 return make_scoped_ptr( |
112 new DrmNativeDisplayDelegate(display_manager_.get())); | 113 new DrmNativeDisplayDelegate(display_manager_.get())); |
113 } | 114 } |
114 base::ScopedFD OpenClientNativePixmapDevice() const override { | 115 base::ScopedFD OpenClientNativePixmapDevice() const override { |
115 #if defined(USE_VGEM_MAP) | 116 #if defined(USE_VGEM_MAP) |
116 int vgem_fd = drmOpenWithType("vgem", nullptr, DRM_NODE_RENDER); | 117 int vgem_fd = drmOpenWithType("vgem", nullptr, DRM_NODE_RENDER); |
117 if (vgem_fd < 0) { | 118 if (vgem_fd < 0) { |
118 PLOG(ERROR) << "Failed to find vgem device"; | 119 PLOG(ERROR) << "Failed to find vgem device"; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 DISALLOW_COPY_AND_ASSIGN(OzonePlatformGbm); | 182 DISALLOW_COPY_AND_ASSIGN(OzonePlatformGbm); |
182 }; | 183 }; |
183 | 184 |
184 } // namespace | 185 } // namespace |
185 | 186 |
186 OzonePlatform* CreateOzonePlatformGbm() { | 187 OzonePlatform* CreateOzonePlatformGbm() { |
187 return new OzonePlatformGbm; | 188 return new OzonePlatformGbm; |
188 } | 189 } |
189 | 190 |
190 } // namespace ui | 191 } // namespace ui |
OLD | NEW |