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

Unified Diff: services/ui/surfaces/display_compositor_factory.h

Issue 2539893002: Mus: Implement GpuMain mojo interface (Closed)
Patch Set: Cleanup of naming some more Created 4 years, 1 month 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: services/ui/surfaces/display_compositor_factory.h
diff --git a/services/ui/surfaces/display_compositor_factory.h b/services/ui/surfaces/display_compositor_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..4a12a908edf6d07ffa38b6ed1ae3f9e559ffb8a2
--- /dev/null
+++ b/services/ui/surfaces/display_compositor_factory.h
@@ -0,0 +1,60 @@
+// 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.
+
+#ifndef SERVICES_UI_SURFACES_DISPLAY_COMPOSITOR_FACTORY_H_
+#define SERVICES_UI_SURFACES_DISPLAY_COMPOSITOR_FACTORY_H_
+
+#include "base/threading/thread.h"
+#include "base/threading/thread_checker.h"
+#include "cc/ipc/display_compositor.mojom.h"
+#include "mojo/public/cpp/bindings/binding.h"
+#include "services/ui/surfaces/display_compositor.h"
+
+namespace gpu {
+class ImageFactory;
+}
+
+namespace ui {
+
+class DisplayCompositorFactoryDelegate;
+
+// A DisplayCompositorFactory permits the display compositor to request a
+// DisplayCompositor interface while providing a DisplayCompositorClient
+// interface.
+class DisplayCompositorFactory : public cc::mojom::DisplayCompositorFactory {
+ public:
+ DisplayCompositorFactory(
+ DisplayCompositorFactoryDelegate* delegate,
+ scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_command_service,
+ scoped_refptr<base::SingleThreadTaskRunner> compositor_runner,
+ gpu::ImageFactory* image_factory,
+ cc::mojom::DisplayCompositorFactoryRequest request);
+
+ ~DisplayCompositorFactory() override;
+
+ // cc::mojom::DisplayCompositorFactory implementation.
+ void CreateDisplayCompositor(
+ cc::mojom::DisplayCompositorRequest display_compositor_request,
+ cc::mojom::DisplayCompositorClientPtr display_compositor_client) override;
+
+ private:
+ DisplayCompositorFactoryDelegate* const delegate_;
+
+ scoped_refptr<base::SingleThreadTaskRunner> compositor_runner_;
+
+ gpu::ImageFactory* image_factory_;
+
+ scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_command_service_;
+
+ std::unique_ptr<DisplayCompositor> display_compositor_;
+
+ // Used for DCHECKs to ensure methods are executed on the correct thread.
+ base::ThreadChecker thread_checker_;
+
+ mojo::Binding<cc::mojom::DisplayCompositorFactory> binding_;
+};
+
+} // namespace ui
+
+#endif // SERVICES_UI_SURFACES_DISPLAY_COMPOSITOR_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698