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

Unified Diff: content/public/browser/surface_utils.cc

Issue 1808313002: Register surface namespace in BlimpUiContextFactory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Host surface_utils into chrome/public Created 4 years, 9 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: content/public/browser/surface_utils.cc
diff --git a/content/public/browser/surface_utils.cc b/content/public/browser/surface_utils.cc
new file mode 100644
index 0000000000000000000000000000000000000000..22bee37c91fd864ec2e003246790f9724a5cf3bc
--- /dev/null
+++ b/content/public/browser/surface_utils.cc
@@ -0,0 +1,37 @@
+// Copyright 2016 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 "content/public/browser/surface_utils.h"
+
+#include "build/build_config.h"
+#include "cc/surfaces/surface_id_allocator.h"
+
+#if defined(OS_ANDROID)
+#include "content/browser/renderer_host/compositor_impl_android.h"
+#else
+#include "content/browser/compositor/image_transport_factory.h"
+#include "ui/compositor/compositor.h"
+#endif
+
+namespace content {
+
+scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() {
+#if defined(OS_ANDROID)
+ return CompositorImpl::CreateSurfaceIdAllocator();
+#else
+ ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
+ return factory->GetContextFactory()->CreateSurfaceIdAllocator();
+#endif
+}
+
+cc::SurfaceManager* GetSurfaceManager() {
+#if defined(OS_ANDROID)
+ return CompositorImpl::GetSurfaceManager();
+#else
+ ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
+ return factory->GetSurfaceManager();
+#endif
+}
+
+} // namespace content
« content/public/browser/surface_utils.h ('K') | « content/public/browser/surface_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698