From 440031320bfc90c4daf481d71341489c88357f9e Mon Sep 17 00:00:00 2001
From: Zeno Albisser <zeno.albisser@digia.com>
Date: Thu, 11 Sep 2014 07:48:34 -0700
Subject: [PATCH] Update OzonePlatformEglfs after update to Chromium 37.

The Ozone platform base class has received several
new pure virtual functions that needed to be implemented.
Most of the functions are implemented according to
how it is done in OzonePlatformGbm.

Change-Id: Ibab75ae0891b67d03f705da611949ed6cf75ad9f
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
---
 src/core/ozone_platform_eglfs.cpp | 43 ++++++++++++++++++++++++++++---
 src/core/ozone_platform_eglfs.h   | 17 +++++++++---
 2 files changed, 54 insertions(+), 6 deletions(-)

diff --git a/src/core/ozone_platform_eglfs.cpp b/src/core/ozone_platform_eglfs.cpp
index ee1f066b5..b6b367aeb 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 4dcc419a6..9d96688a5 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);
 };
-- 
GitLab