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

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

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.cc
diff --git a/services/ui/surfaces/display_compositor_factory.cc b/services/ui/surfaces/display_compositor_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..bcaa17d5ac027d78de1b8bc4c37261d0a711e418
--- /dev/null
+++ b/services/ui/surfaces/display_compositor_factory.cc
@@ -0,0 +1,44 @@
+// 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 "services/ui/surfaces/display_compositor_factory.h"
+
+#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
+#include "gpu/ipc/gpu_in_process_thread_service.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
+#include "services/ui/surfaces/display_compositor_factory_delegate.h"
+
+namespace ui {
+
+DisplayCompositorFactory::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)
+ : delegate_(delegate),
+ compositor_runner_(std::move(compositor_runner)),
+ image_factory_(image_factory),
+ gpu_command_service_(std::move(gpu_command_service)),
+ binding_(this, std::move(request)) {
+ DCHECK(compositor_runner_->BelongsToCurrentThread());
+}
+
+DisplayCompositorFactory::~DisplayCompositorFactory() {
+ DCHECK(compositor_runner_->BelongsToCurrentThread());
+}
+
+void DisplayCompositorFactory::CreateDisplayCompositor(
+ cc::mojom::DisplayCompositorRequest display_compositor_request,
+ cc::mojom::DisplayCompositorClientPtr display_compositor_client) {
+ DCHECK(compositor_runner_->BelongsToCurrentThread());
+ CHECK_EQ(nullptr, display_compositor_.get());
+
+ display_compositor_ = base::MakeUnique<DisplayCompositor>(
+ gpu_command_service_, delegate_->CreateGpuMemoryBufferManager(),
+ image_factory_, std::move(display_compositor_request),
+ std::move(display_compositor_client));
+}
+
+} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698