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

Unified Diff: ui/ozone/platform/drm/ozone_client_gbm.cc

Issue 1128113011: ozone: Introduce ClientPixmap and ClientPixmapFactory for non-GPU processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Introduce OzoneClient Created 5 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/drm/ozone_client_gbm.cc
diff --git a/ui/ozone/platform/drm/ozone_client_gbm.cc b/ui/ozone/platform/drm/ozone_client_gbm.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d37fb44f0e8e66503bfd9842abebe3e195239a9e
--- /dev/null
+++ b/ui/ozone/platform/drm/ozone_client_gbm.cc
@@ -0,0 +1,46 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/ozone/platform/drm/ozone_client_gbm.h"
+
+#include "ui/ozone/platform/drm/gbm_surface_client_factory.h"
+#include "ui/ozone/public/ozone_client.h"
+
+namespace ui {
+
+namespace {
+
+class OzoneClientGbm : public OzoneClient {
+ public:
+ OzoneClientGbm() {}
+ ~OzoneClientGbm() override {}
+
+ // OzoneClient:
+ SurfaceClientFactoryOzone* GetSurfaceClientFactoryOzone() override {
+ return surface_client_.get();
+ }
+
+ void InitializeUI() override {
+ if (!surface_client_)
+ surface_client_.reset(new GbmSurfaceClientFactory);
+ }
+
+ void InitializeRenderer() override {
+ if (!surface_client_)
+ surface_client_.reset(new GbmSurfaceClientFactory);
+ }
+
+ private:
+ scoped_ptr<GbmSurfaceClientFactory> surface_client_;
+
+ DISALLOW_COPY_AND_ASSIGN(OzoneClientGbm);
+};
+
+} // namespace
+
+OzoneClient* CreateOzoneClientGbm() {
+ return new OzoneClientGbm;
+}
+
+} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698