Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(418)

Unified Diff: ui/ozone/platform/dri/ozone_platform_dri.cc

Issue 106633002: GBM Ozone implementation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_;
« no previous file with comments | « ui/ozone/platform/dri/hardware_display_controller_unittest.cc ('k') | ui/ozone/platform/dri/ozone_platform_gbm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698