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/egltest/ozone_platform_egltest.h" | 5 #include "ui/ozone/platform/egltest/ozone_platform_egltest.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/environment.h" | 8 #include "base/environment.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
11 #include "library_loaders/libeglplatform_shim.h" | 11 #include "library_loaders/libeglplatform_shim.h" |
12 #include "ui/events/ozone/device/device_manager.h" | 12 #include "ui/events/ozone/device/device_manager.h" |
13 #include "ui/events/ozone/evdev/event_factory_evdev.h" | 13 #include "ui/events/ozone/evdev/event_factory_evdev.h" |
14 #include "ui/gfx/vsync_provider.h" | 14 #include "ui/gfx/vsync_provider.h" |
15 #include "ui/ozone/ozone_platform.h" | 15 #include "ui/ozone/ozone_platform.h" |
16 #include "ui/ozone/ozone_switches.h" | 16 #include "ui/ozone/ozone_switches.h" |
17 #include "ui/ozone/platform/test/file_surface_factory.h" | 17 #include "ui/ozone/platform/test/file_surface_factory.h" |
18 #include "ui/ozone/public/cursor_factory_ozone.h" | 18 #include "ui/ozone/public/cursor_factory_ozone.h" |
| 19 #include "ui/ozone/public/gpu_platform_support.h" |
| 20 #include "ui/ozone/public/gpu_platform_support_host.h" |
19 #include "ui/ozone/public/surface_ozone_egl.h" | 21 #include "ui/ozone/public/surface_ozone_egl.h" |
20 | 22 |
21 #if defined(OS_CHROMEOS) | 23 #if defined(OS_CHROMEOS) |
22 #include "ui/ozone/common/chromeos/native_display_delegate_ozone.h" | 24 #include "ui/ozone/common/chromeos/native_display_delegate_ozone.h" |
23 #include "ui/ozone/common/chromeos/touchscreen_device_manager_ozone.h" | 25 #include "ui/ozone/common/chromeos/touchscreen_device_manager_ozone.h" |
24 #endif | 26 #endif |
25 | 27 |
26 #include <EGL/egl.h> | 28 #include <EGL/egl.h> |
27 | 29 |
28 namespace ui { | 30 namespace ui { |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 // OzonePlatform: | 239 // OzonePlatform: |
238 virtual ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE { | 240 virtual ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE { |
239 return surface_factory_ozone_.get(); | 241 return surface_factory_ozone_.get(); |
240 } | 242 } |
241 virtual EventFactoryOzone* GetEventFactoryOzone() OVERRIDE { | 243 virtual EventFactoryOzone* GetEventFactoryOzone() OVERRIDE { |
242 return event_factory_ozone_.get(); | 244 return event_factory_ozone_.get(); |
243 } | 245 } |
244 virtual CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE { | 246 virtual CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE { |
245 return cursor_factory_ozone_.get(); | 247 return cursor_factory_ozone_.get(); |
246 } | 248 } |
| 249 virtual GpuPlatformSupport* GetGpuPlatformSupport() OVERRIDE { |
| 250 return gpu_platform_support_.get(); |
| 251 } |
| 252 virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() OVERRIDE { |
| 253 return gpu_platform_support_host_.get(); |
| 254 } |
247 | 255 |
248 #if defined(OS_CHROMEOS) | 256 #if defined(OS_CHROMEOS) |
249 virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() | 257 virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() |
250 OVERRIDE { | 258 OVERRIDE { |
251 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateOzone()); | 259 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateOzone()); |
252 } | 260 } |
253 virtual scoped_ptr<TouchscreenDeviceManager> | 261 virtual scoped_ptr<TouchscreenDeviceManager> |
254 CreateTouchscreenDeviceManager() OVERRIDE { | 262 CreateTouchscreenDeviceManager() OVERRIDE { |
255 return scoped_ptr<TouchscreenDeviceManager>( | 263 return scoped_ptr<TouchscreenDeviceManager>( |
256 new TouchscreenDeviceManagerOzone()); | 264 new TouchscreenDeviceManagerOzone()); |
257 } | 265 } |
258 #endif | 266 #endif |
259 | 267 |
260 virtual void InitializeUI() OVERRIDE { | 268 virtual void InitializeUI() OVERRIDE { |
261 device_manager_ = CreateDeviceManager(); | 269 device_manager_ = CreateDeviceManager(); |
262 surface_factory_ozone_.reset(new SurfaceFactoryEgltest(&eglplatform_shim_)); | 270 surface_factory_ozone_.reset(new SurfaceFactoryEgltest(&eglplatform_shim_)); |
263 event_factory_ozone_.reset( | 271 event_factory_ozone_.reset( |
264 new EventFactoryEvdev(NULL, device_manager_.get())); | 272 new EventFactoryEvdev(NULL, device_manager_.get())); |
265 cursor_factory_ozone_.reset(new CursorFactoryOzone()); | 273 cursor_factory_ozone_.reset(new CursorFactoryOzone()); |
| 274 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); |
266 } | 275 } |
267 | 276 |
268 virtual void InitializeGPU() OVERRIDE { | 277 virtual void InitializeGPU() OVERRIDE { |
269 surface_factory_ozone_.reset(new SurfaceFactoryEgltest(&eglplatform_shim_)); | 278 surface_factory_ozone_.reset(new SurfaceFactoryEgltest(&eglplatform_shim_)); |
| 279 gpu_platform_support_.reset(CreateStubGpuPlatformSupport()); |
270 } | 280 } |
271 | 281 |
272 private: | 282 private: |
273 LibeglplatformShimLoader eglplatform_shim_; | 283 LibeglplatformShimLoader eglplatform_shim_; |
274 scoped_ptr<DeviceManager> device_manager_; | 284 scoped_ptr<DeviceManager> device_manager_; |
275 scoped_ptr<SurfaceFactoryEgltest> surface_factory_ozone_; | 285 scoped_ptr<SurfaceFactoryEgltest> surface_factory_ozone_; |
276 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; | 286 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; |
277 scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_; | 287 scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_; |
| 288 scoped_ptr<GpuPlatformSupport> gpu_platform_support_; |
| 289 scoped_ptr<GpuPlatformSupportHost> gpu_platform_support_host_; |
278 | 290 |
279 bool shim_initialized_; | 291 bool shim_initialized_; |
280 | 292 |
281 DISALLOW_COPY_AND_ASSIGN(OzonePlatformEgltest); | 293 DISALLOW_COPY_AND_ASSIGN(OzonePlatformEgltest); |
282 }; | 294 }; |
283 | 295 |
284 } // namespace | 296 } // namespace |
285 | 297 |
286 OzonePlatform* CreateOzonePlatformEgltest() { | 298 OzonePlatform* CreateOzonePlatformEgltest() { |
287 OzonePlatformEgltest* platform = new OzonePlatformEgltest; | 299 OzonePlatformEgltest* platform = new OzonePlatformEgltest; |
288 platform->Initialize(); | 300 platform->Initialize(); |
289 return platform; | 301 return platform; |
290 } | 302 } |
291 | 303 |
292 } // namespace ui | 304 } // namespace ui |
OLD | NEW |