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/dri/ozone_platform_gbm.h" | 5 #include "ui/ozone/platform/dri/ozone_platform_gbm.h" |
6 | 6 |
7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
8 #include <gbm.h> | 8 #include <gbm.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "ui/ozone/platform/dri/scanout_buffer.h" | 26 #include "ui/ozone/platform/dri/scanout_buffer.h" |
27 #include "ui/ozone/platform/dri/screen_manager.h" | 27 #include "ui/ozone/platform/dri/screen_manager.h" |
28 #include "ui/ozone/platform/dri/virtual_terminal_manager.h" | 28 #include "ui/ozone/platform/dri/virtual_terminal_manager.h" |
29 #include "ui/ozone/public/cursor_factory_ozone.h" | 29 #include "ui/ozone/public/cursor_factory_ozone.h" |
30 #include "ui/ozone/public/gpu_platform_support.h" | 30 #include "ui/ozone/public/gpu_platform_support.h" |
31 #include "ui/ozone/public/gpu_platform_support_host.h" | 31 #include "ui/ozone/public/gpu_platform_support_host.h" |
32 #include "ui/ozone/public/ozone_platform.h" | 32 #include "ui/ozone/public/ozone_platform.h" |
33 #include "ui/ozone/public/ozone_switches.h" | 33 #include "ui/ozone/public/ozone_switches.h" |
34 | 34 |
35 #if defined(OS_CHROMEOS) | 35 #if defined(OS_CHROMEOS) |
36 #include "ui/ozone/common/chromeos/touchscreen_device_manager_ozone.h" | |
37 #include "ui/ozone/platform/dri/chromeos/display_message_handler.h" | 36 #include "ui/ozone/platform/dri/chromeos/display_message_handler.h" |
38 #include "ui/ozone/platform/dri/chromeos/native_display_delegate_dri.h" | 37 #include "ui/ozone/platform/dri/chromeos/native_display_delegate_dri.h" |
39 #include "ui/ozone/platform/dri/chromeos/native_display_delegate_proxy.h" | 38 #include "ui/ozone/platform/dri/chromeos/native_display_delegate_proxy.h" |
40 #endif | 39 #endif |
41 | 40 |
42 namespace ui { | 41 namespace ui { |
43 | 42 |
44 namespace { | 43 namespace { |
45 | 44 |
46 const char kDefaultGraphicsCardPath[] = "/dev/dri/card0"; | 45 const char kDefaultGraphicsCardPath[] = "/dev/dri/card0"; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 cursor_.get())); | 112 cursor_.get())); |
114 platform_window->Initialize(); | 113 platform_window->Initialize(); |
115 return platform_window.PassAs<PlatformWindow>(); | 114 return platform_window.PassAs<PlatformWindow>(); |
116 } | 115 } |
117 #if defined(OS_CHROMEOS) | 116 #if defined(OS_CHROMEOS) |
118 virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() | 117 virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() |
119 OVERRIDE { | 118 OVERRIDE { |
120 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateProxy( | 119 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateProxy( |
121 gpu_platform_support_host_.get(), device_manager_.get())); | 120 gpu_platform_support_host_.get(), device_manager_.get())); |
122 } | 121 } |
123 virtual scoped_ptr<TouchscreenDeviceManager> | |
124 CreateTouchscreenDeviceManager() OVERRIDE { | |
125 return scoped_ptr<TouchscreenDeviceManager>( | |
126 new TouchscreenDeviceManagerOzone()); | |
127 } | |
128 #endif | 122 #endif |
129 virtual void InitializeUI() OVERRIDE { | 123 virtual void InitializeUI() OVERRIDE { |
130 vt_manager_.reset(new VirtualTerminalManager()); | 124 vt_manager_.reset(new VirtualTerminalManager()); |
131 // Needed since the browser process creates the accelerated widgets and that | 125 // Needed since the browser process creates the accelerated widgets and that |
132 // happens through SFO. | 126 // happens through SFO. |
133 surface_factory_ozone_.reset(new GbmSurfaceFactory(use_surfaceless_)); | 127 surface_factory_ozone_.reset(new GbmSurfaceFactory(use_surfaceless_)); |
134 device_manager_ = CreateDeviceManager(); | 128 device_manager_ = CreateDeviceManager(); |
135 gpu_platform_support_host_.reset(new GpuPlatformSupportHostGbm()); | 129 gpu_platform_support_host_.reset(new GpuPlatformSupportHostGbm()); |
136 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); | 130 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); |
137 cursor_.reset(new DriCursor(gpu_platform_support_host_.get())); | 131 cursor_.reset(new DriCursor(gpu_platform_support_host_.get())); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 }; | 186 }; |
193 | 187 |
194 } // namespace | 188 } // namespace |
195 | 189 |
196 OzonePlatform* CreateOzonePlatformGbm() { | 190 OzonePlatform* CreateOzonePlatformGbm() { |
197 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 191 CommandLine* cmd = CommandLine::ForCurrentProcess(); |
198 return new OzonePlatformGbm(cmd->HasSwitch(switches::kOzoneUseSurfaceless)); | 192 return new OzonePlatformGbm(cmd->HasSwitch(switches::kOzoneUseSurfaceless)); |
199 } | 193 } |
200 | 194 |
201 } // namespace ui | 195 } // namespace ui |
OLD | NEW |