diff --git a/src/core/ozone_platform_eglfs.cpp b/src/core/ozone_platform_eglfs.cpp index ee1f066b51582c6491b62e3b10c23cd06abd58b8..b6b367aeb26a46f301245ef1dde337dcf62c2365 100644 --- a/src/core/ozone_platform_eglfs.cpp +++ b/src/core/ozone_platform_eglfs.cpp @@ -36,26 +36,63 @@ #include "ozone_platform_eglfs.h" +#include "media/ozone/media_ozone_platform.h" +#include "ui/events/ozone/device/device_manager.h" #include "ui/ozone/ozone_platform.h" +#include "ui/ozone/public/cursor_factory_ozone.h" +#include "ui/ozone/public/gpu_platform_support.h" +#include "ui/ozone/public/gpu_platform_support_host.h" #if defined(USE_OZONE) +namespace media { + +MediaOzonePlatform* CreateMediaOzonePlatformEglfs() { + return new MediaOzonePlatform; +} + +} + namespace ui { OzonePlatformEglfs::OzonePlatformEglfs() {} OzonePlatformEglfs::~OzonePlatformEglfs() {} -gfx::SurfaceFactoryOzone* OzonePlatformEglfs::GetSurfaceFactoryOzone() { - return &surface_factory_ozone_; +ui::SurfaceFactoryOzone* OzonePlatformEglfs::GetSurfaceFactoryOzone() { + return surface_factory_ozone_.get(); } ui::EventFactoryOzone* OzonePlatformEglfs::GetEventFactoryOzone() { - return &event_factory_ozone_; + return event_factory_ozone_.get(); +} + +ui::CursorFactoryOzone* OzonePlatformEglfs::GetCursorFactoryOzone() { + return cursor_factory_ozone_.get(); +} + +GpuPlatformSupport* OzonePlatformEglfs::GetGpuPlatformSupport() { + return gpu_platform_support_.get(); +} + +GpuPlatformSupportHost* OzonePlatformEglfs::GetGpuPlatformSupportHost() { + return gpu_platform_support_host_.get(); } OzonePlatform* CreateOzonePlatformEglfs() { return new OzonePlatformEglfs; } +void OzonePlatformEglfs::InitializeUI() { + device_manager_ = CreateDeviceManager(); + cursor_factory_ozone_.reset(new CursorFactoryOzone()); + event_factory_ozone_.reset(new EventFactoryEvdev(NULL, device_manager_.get())); + gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); +} + +void OzonePlatformEglfs::InitializeGPU() { + surface_factory_ozone_.reset(new SurfaceFactoryQt()); + gpu_platform_support_.reset(CreateStubGpuPlatformSupport()); +} + } // namespace ui #endif diff --git a/src/core/ozone_platform_eglfs.h b/src/core/ozone_platform_eglfs.h index 4dcc419a6fce0bfdc68c2b4e9da7126fbb45bde4..9d96688a54eb7503fb59246340ec096e811169ea 100644 --- a/src/core/ozone_platform_eglfs.h +++ b/src/core/ozone_platform_eglfs.h @@ -51,12 +51,23 @@ class OzonePlatformEglfs : public OzonePlatform { OzonePlatformEglfs(); virtual ~OzonePlatformEglfs(); - virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE; + virtual ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE; virtual ui::EventFactoryOzone* GetEventFactoryOzone() OVERRIDE; + virtual ui::CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE; + virtual GpuPlatformSupport* GetGpuPlatformSupport() OVERRIDE; + virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() OVERRIDE; + virtual void InitializeUI() OVERRIDE; + virtual void InitializeGPU() OVERRIDE; private: - SurfaceFactoryQt surface_factory_ozone_; - ui::EventFactoryEvdev event_factory_ozone_; + scoped_ptr<DeviceManager> device_manager_; + + scoped_ptr<SurfaceFactoryQt> surface_factory_ozone_; + scoped_ptr<ui::CursorFactoryOzone> cursor_factory_ozone_; + scoped_ptr<ui::EventFactoryEvdev> event_factory_ozone_; + + scoped_ptr<GpuPlatformSupport> gpu_platform_support_; + scoped_ptr<GpuPlatformSupportHost> gpu_platform_support_host_; DISALLOW_COPY_AND_ASSIGN(OzonePlatformEglfs); };