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" |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 } | 275 } |
276 virtual scoped_ptr<TouchscreenDeviceManager> | 276 virtual scoped_ptr<TouchscreenDeviceManager> |
277 CreateTouchscreenDeviceManager() OVERRIDE { | 277 CreateTouchscreenDeviceManager() OVERRIDE { |
278 return scoped_ptr<TouchscreenDeviceManager>( | 278 return scoped_ptr<TouchscreenDeviceManager>( |
279 new TouchscreenDeviceManagerOzone()); | 279 new TouchscreenDeviceManagerOzone()); |
280 } | 280 } |
281 #endif | 281 #endif |
282 | 282 |
283 virtual void InitializeUI() OVERRIDE { | 283 virtual void InitializeUI() OVERRIDE { |
284 device_manager_ = CreateDeviceManager(); | 284 device_manager_ = CreateDeviceManager(); |
285 surface_factory_ozone_.reset(new SurfaceFactoryEgltest(&eglplatform_shim_)); | 285 if (!surface_factory_ozone_) |
| 286 surface_factory_ozone_.reset( |
| 287 new SurfaceFactoryEgltest(&eglplatform_shim_)); |
286 event_factory_ozone_.reset( | 288 event_factory_ozone_.reset( |
287 new EventFactoryEvdev(NULL, device_manager_.get())); | 289 new EventFactoryEvdev(NULL, device_manager_.get())); |
288 cursor_factory_ozone_.reset(new CursorFactoryOzone()); | 290 cursor_factory_ozone_.reset(new CursorFactoryOzone()); |
289 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); | 291 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); |
290 } | 292 } |
291 | 293 |
292 virtual void InitializeGPU() OVERRIDE { | 294 virtual void InitializeGPU() OVERRIDE { |
293 surface_factory_ozone_.reset(new SurfaceFactoryEgltest(&eglplatform_shim_)); | 295 if (!surface_factory_ozone_) |
| 296 surface_factory_ozone_.reset( |
| 297 new SurfaceFactoryEgltest(&eglplatform_shim_)); |
294 gpu_platform_support_.reset(CreateStubGpuPlatformSupport()); | 298 gpu_platform_support_.reset(CreateStubGpuPlatformSupport()); |
295 } | 299 } |
296 | 300 |
297 private: | 301 private: |
298 LibeglplatformShimLoader eglplatform_shim_; | 302 LibeglplatformShimLoader eglplatform_shim_; |
299 scoped_ptr<DeviceManager> device_manager_; | 303 scoped_ptr<DeviceManager> device_manager_; |
300 scoped_ptr<SurfaceFactoryEgltest> surface_factory_ozone_; | 304 scoped_ptr<SurfaceFactoryEgltest> surface_factory_ozone_; |
301 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; | 305 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; |
302 scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_; | 306 scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_; |
303 scoped_ptr<GpuPlatformSupport> gpu_platform_support_; | 307 scoped_ptr<GpuPlatformSupport> gpu_platform_support_; |
304 scoped_ptr<GpuPlatformSupportHost> gpu_platform_support_host_; | 308 scoped_ptr<GpuPlatformSupportHost> gpu_platform_support_host_; |
305 | 309 |
306 bool shim_initialized_; | 310 bool shim_initialized_; |
307 | 311 |
308 DISALLOW_COPY_AND_ASSIGN(OzonePlatformEgltest); | 312 DISALLOW_COPY_AND_ASSIGN(OzonePlatformEgltest); |
309 }; | 313 }; |
310 | 314 |
311 } // namespace | 315 } // namespace |
312 | 316 |
313 OzonePlatform* CreateOzonePlatformEgltest() { | 317 OzonePlatform* CreateOzonePlatformEgltest() { |
314 OzonePlatformEgltest* platform = new OzonePlatformEgltest; | 318 OzonePlatformEgltest* platform = new OzonePlatformEgltest; |
315 platform->Initialize(); | 319 platform->Initialize(); |
316 return platform; | 320 return platform; |
317 } | 321 } |
318 | 322 |
319 } // namespace ui | 323 } // namespace ui |
OLD | NEW |