| 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/base/cursor/ozone/cursor_factory_ozone.h" | 12 #include "ui/base/cursor/ozone/cursor_factory_ozone.h" |
| 13 #include "ui/events/ozone/device/device_manager.h" | 13 #include "ui/events/ozone/device/device_manager.h" |
| 14 #include "ui/events/ozone/evdev/event_factory_evdev.h" | 14 #include "ui/events/ozone/evdev/event_factory_evdev.h" |
| 15 #include "ui/gfx/ozone/impl/file_surface_factory.h" | 15 #include "ui/gfx/ozone/impl/file_surface_factory.h" |
| 16 #include "ui/gfx/ozone/surface_ozone_egl.h" | 16 #include "ui/gfx/ozone/surface_ozone_egl.h" |
| 17 #include "ui/gfx/vsync_provider.h" | 17 #include "ui/gfx/vsync_provider.h" |
| 18 #include "ui/ozone/ime/input_method_context_factory_ozone.h" | |
| 19 #include "ui/ozone/ozone_platform.h" | 18 #include "ui/ozone/ozone_platform.h" |
| 20 #include "ui/ozone/ozone_switches.h" | 19 #include "ui/ozone/ozone_switches.h" |
| 21 | 20 |
| 22 #if defined(OS_CHROMEOS) | 21 #if defined(OS_CHROMEOS) |
| 23 #include "ui/ozone/common/chromeos/native_display_delegate_ozone.h" | 22 #include "ui/ozone/common/chromeos/native_display_delegate_ozone.h" |
| 24 #endif | 23 #endif |
| 25 | 24 |
| 26 #include <EGL/egl.h> | 25 #include <EGL/egl.h> |
| 27 | 26 |
| 28 namespace ui { | 27 namespace ui { |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 shim_initialized_ = eglplatform_shim_.ShimInitialize(); | 232 shim_initialized_ = eglplatform_shim_.ShimInitialize(); |
| 234 } | 233 } |
| 235 | 234 |
| 236 // OzonePlatform: | 235 // OzonePlatform: |
| 237 virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE { | 236 virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE { |
| 238 return surface_factory_ozone_.get(); | 237 return surface_factory_ozone_.get(); |
| 239 } | 238 } |
| 240 virtual EventFactoryOzone* GetEventFactoryOzone() OVERRIDE { | 239 virtual EventFactoryOzone* GetEventFactoryOzone() OVERRIDE { |
| 241 return event_factory_ozone_.get(); | 240 return event_factory_ozone_.get(); |
| 242 } | 241 } |
| 243 virtual InputMethodContextFactoryOzone* GetInputMethodContextFactoryOzone() | |
| 244 OVERRIDE { | |
| 245 return input_method_context_factory_ozone_.get(); | |
| 246 } | |
| 247 virtual CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE { | 242 virtual CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE { |
| 248 return cursor_factory_ozone_.get(); | 243 return cursor_factory_ozone_.get(); |
| 249 } | 244 } |
| 250 | 245 |
| 251 #if defined(OS_CHROMEOS) | 246 #if defined(OS_CHROMEOS) |
| 252 virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() | 247 virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() |
| 253 OVERRIDE { | 248 OVERRIDE { |
| 254 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateOzone()); | 249 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateOzone()); |
| 255 } | 250 } |
| 256 #endif | 251 #endif |
| 257 | 252 |
| 258 virtual void InitializeUI() OVERRIDE { | 253 virtual void InitializeUI() OVERRIDE { |
| 259 device_manager_ = CreateDeviceManager(); | 254 device_manager_ = CreateDeviceManager(); |
| 260 surface_factory_ozone_.reset(new SurfaceFactoryEgltest(&eglplatform_shim_)); | 255 surface_factory_ozone_.reset(new SurfaceFactoryEgltest(&eglplatform_shim_)); |
| 261 event_factory_ozone_.reset( | 256 event_factory_ozone_.reset( |
| 262 new EventFactoryEvdev(NULL, device_manager_.get())); | 257 new EventFactoryEvdev(NULL, device_manager_.get())); |
| 263 input_method_context_factory_ozone_.reset( | |
| 264 new InputMethodContextFactoryOzone()); | |
| 265 cursor_factory_ozone_.reset(new CursorFactoryOzone()); | 258 cursor_factory_ozone_.reset(new CursorFactoryOzone()); |
| 266 } | 259 } |
| 267 | 260 |
| 268 virtual void InitializeGPU() OVERRIDE {} | 261 virtual void InitializeGPU() OVERRIDE {} |
| 269 | 262 |
| 270 private: | 263 private: |
| 271 LibeglplatformShimLoader eglplatform_shim_; | 264 LibeglplatformShimLoader eglplatform_shim_; |
| 272 scoped_ptr<DeviceManager> device_manager_; | 265 scoped_ptr<DeviceManager> device_manager_; |
| 273 scoped_ptr<SurfaceFactoryEgltest> surface_factory_ozone_; | 266 scoped_ptr<SurfaceFactoryEgltest> surface_factory_ozone_; |
| 274 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; | 267 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; |
| 275 scoped_ptr<InputMethodContextFactoryOzone> | |
| 276 input_method_context_factory_ozone_; | |
| 277 scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_; | 268 scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_; |
| 278 | 269 |
| 279 bool shim_initialized_; | 270 bool shim_initialized_; |
| 280 | 271 |
| 281 DISALLOW_COPY_AND_ASSIGN(OzonePlatformEgltest); | 272 DISALLOW_COPY_AND_ASSIGN(OzonePlatformEgltest); |
| 282 }; | 273 }; |
| 283 | 274 |
| 284 } // namespace | 275 } // namespace |
| 285 | 276 |
| 286 OzonePlatform* CreateOzonePlatformEgltest() { | 277 OzonePlatform* CreateOzonePlatformEgltest() { |
| 287 OzonePlatformEgltest* platform = new OzonePlatformEgltest; | 278 OzonePlatformEgltest* platform = new OzonePlatformEgltest; |
| 288 platform->Initialize(); | 279 platform->Initialize(); |
| 289 return platform; | 280 return platform; |
| 290 } | 281 } |
| 291 | 282 |
| 292 } // namespace ui | 283 } // namespace ui |
| OLD | NEW |