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

Side by Side 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 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "services/ui/surfaces/display_compositor_factory.h"
6
7 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
8 #include "gpu/ipc/gpu_in_process_thread_service.h"
9 #include "mojo/public/cpp/bindings/strong_binding.h"
10 #include "services/ui/surfaces/display_compositor_factory_delegate.h"
11
12 namespace ui {
13
14 DisplayCompositorFactory::DisplayCompositorFactory(
15 DisplayCompositorFactoryDelegate* delegate,
16 scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_command_service,
17 scoped_refptr<base::SingleThreadTaskRunner> compositor_runner,
18 gpu::ImageFactory* image_factory,
19 cc::mojom::DisplayCompositorFactoryRequest request)
20 : delegate_(delegate),
21 compositor_runner_(std::move(compositor_runner)),
22 image_factory_(image_factory),
23 gpu_command_service_(std::move(gpu_command_service)),
24 binding_(this, std::move(request)) {
25 DCHECK(compositor_runner_->BelongsToCurrentThread());
26 }
27
28 DisplayCompositorFactory::~DisplayCompositorFactory() {
29 DCHECK(compositor_runner_->BelongsToCurrentThread());
30 }
31
32 void DisplayCompositorFactory::CreateDisplayCompositor(
33 cc::mojom::DisplayCompositorRequest display_compositor_request,
34 cc::mojom::DisplayCompositorClientPtr display_compositor_client) {
35 DCHECK(compositor_runner_->BelongsToCurrentThread());
36 CHECK_EQ(nullptr, display_compositor_.get());
37
38 display_compositor_ = base::MakeUnique<DisplayCompositor>(
39 gpu_command_service_, delegate_->CreateGpuMemoryBufferManager(),
40 image_factory_, std::move(display_compositor_request),
41 std::move(display_compositor_client));
42 }
43
44 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698