Index: ui/ozone/platform/dri/ozone_platform_dri.cc |
diff --git a/ui/ozone/platform/dri/ozone_platform_dri.cc b/ui/ozone/platform/dri/ozone_platform_dri.cc |
index 66bcba4b6e185084b11dd7587d5d60131bddce65..7410ec9aba5d34779f6e31c49edc465e39800df5 100644 |
--- a/ui/ozone/platform/dri/ozone_platform_dri.cc |
+++ b/ui/ozone/platform/dri/ozone_platform_dri.cc |
@@ -9,8 +9,10 @@ |
#include "ui/events/ozone/evdev/event_factory_evdev.h" |
#include "ui/ozone/ozone_platform.h" |
#include "ui/ozone/platform/dri/cursor_factory_evdev_dri.h" |
+#include "ui/ozone/platform/dri/dri_surface.h" |
#include "ui/ozone/platform/dri/dri_surface_factory.h" |
#include "ui/ozone/platform/dri/dri_wrapper.h" |
+#include "ui/ozone/platform/dri/scanout_surface.h" |
#include "ui/ozone/platform/dri/screen_manager.h" |
#if defined(OS_CHROMEOS) |
@@ -23,6 +25,21 @@ namespace { |
const char kDefaultGraphicsCardPath[] = "/dev/dri/card0"; |
+class DriSurfaceGenerator : public ScanoutSurfaceGenerator { |
+ public: |
+ DriSurfaceGenerator(DriWrapper* dri) : dri_(dri) {} |
+ virtual ~DriSurfaceGenerator() {} |
+ |
+ virtual ScanoutSurface* Create(const gfx::Size& size) OVERRIDE { |
+ return new DriSurface(dri_, size); |
+ } |
+ |
+ private: |
+ DriWrapper* dri_; // Not owned. |
+ |
+ DISALLOW_COPY_AND_ASSIGN(DriSurfaceGenerator); |
+}; |
+ |
// OzonePlatform for Linux DRI (Direct Rendering Infrastructure) |
// |
// This platform is Linux without any display server (no X, wayland, or |
@@ -31,7 +48,9 @@ class OzonePlatformDri : public OzonePlatform { |
public: |
OzonePlatformDri() |
: dri_(new DriWrapper(kDefaultGraphicsCardPath)), |
- screen_manager_(new ScreenManager(dri_.get())), |
+ surface_generator_(new DriSurfaceGenerator(dri_.get())), |
+ screen_manager_(new ScreenManager(dri_.get(), |
+ surface_generator_.get())), |
device_manager_(CreateDeviceManager()) {} |
virtual ~OzonePlatformDri() {} |
@@ -65,6 +84,7 @@ class OzonePlatformDri : public OzonePlatform { |
private: |
scoped_ptr<DriWrapper> dri_; |
+ scoped_ptr<DriSurfaceGenerator> surface_generator_; |
// TODO(dnicoara) Move ownership of |screen_manager_| to NDD. |
scoped_ptr<ScreenManager> screen_manager_; |
scoped_ptr<DeviceManager> device_manager_; |