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

Unified Diff: ui/ozone/public/client_native_pixmap_factory.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: handle zygote Created 5 years, 4 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/public/client_native_pixmap_factory.cc
diff --git a/ui/ozone/public/client_native_pixmap_factory.cc b/ui/ozone/public/client_native_pixmap_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..cd224944dafa6c1edac8af9f6695c8cccbebb1eb
--- /dev/null
+++ b/ui/ozone/public/client_native_pixmap_factory.cc
@@ -0,0 +1,43 @@
+// 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/public/client_native_pixmap_factory.h"
+
+#include "base/trace_event/trace_event.h"
+#include "ui/ozone/platform_object.h"
+#include "ui/ozone/platform_selection.h"
+
+namespace ui {
+
+namespace {
+
+ClientNativePixmapFactory* g_instance = nullptr;
+
+} // namespace
+
+// static
+ClientNativePixmapFactory* ClientNativePixmapFactory::GetInstance() {
+ return g_instance;
+}
+
+// static
+void ClientNativePixmapFactory::SetInstance(
+ ClientNativePixmapFactory* instance) {
+ DCHECK(!g_instance);
+ DCHECK(instance);
+ g_instance = instance;
+}
+
+// static
+scoped_ptr<ClientNativePixmapFactory> ClientNativePixmapFactory::Create() {
+ TRACE_EVENT1("ozone", "ClientNativePixmapFactory::Create", "platform",
+ GetOzonePlatformName());
+ return PlatformObject<ClientNativePixmapFactory>::Create();
+}
+
+ClientNativePixmapFactory::ClientNativePixmapFactory() {}
+
+ClientNativePixmapFactory::~ClientNativePixmapFactory() {}
no sievers 2015/08/05 18:27:02 nit: It's a bit of an interesting pattern - the si
dshwang 2015/08/05 18:46:34 This pattern is originated from SurfaceTextureMana
reveman 2015/08/05 19:54:03 The reason for Set/GetInstance is to push the owne
+
+} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698