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

Unified Diff: content/renderer/android/synchronous_compositor_factory.h

Issue 15851006: Move synchronous compositor into content/browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mkosiba comments1 Created 7 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: content/renderer/android/synchronous_compositor_factory.h
diff --git a/content/renderer/android/synchronous_compositor_factory.h b/content/renderer/android/synchronous_compositor_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..693b0174072545d3283d1cab91c53017e77d9bd5
--- /dev/null
+++ b/content/renderer/android/synchronous_compositor_factory.h
@@ -0,0 +1,45 @@
+// Copyright 2013 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.
+
+#ifndef CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FACTORY_H_
+#define CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FACTORY_H_
+
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+
+namespace base {
+class MessageLoopProxy;
+}
+
+namespace cc {
+class OutputSurface;
+}
+
+namespace content {
+
+// Decouples creation from usage of the parts needed for the synchonous
+// compositor rendering path. In practice this is only used in single
+// process mode (namely, for Android WebView) hence the implementation of
+// this will be injected from the logical 'browser' side code.
+class SynchronousCompositorFactory {
+ public:
+ // Must only be called once, e.g. on startup. Ownership of |instance| remains
+ // with the caller.
+ static void SetInstance(SynchronousCompositorFactory* instance);
+ static SynchronousCompositorFactory* GetInstance();
+ static bool HasInstance() { return GetInstance() != NULL; }
jamesr 2013/05/30 20:28:57 nit: i don't find this terribly valuable, code cou
joth 2013/05/30 21:22:14 Done. In my mind I was thinking of something a lit
+
+ virtual scoped_refptr<base::MessageLoopProxy>
+ GetCompositorMessageLoop() = 0;
+ virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(
+ int routing_id) = 0;
+
+ protected:
+ SynchronousCompositorFactory() {}
+ ~SynchronousCompositorFactory() {}
+};
+
+}
+
+#endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698