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

Side by Side Diff: components/mus/surfaces/compositor_frame_sink_factory_impl.cc

Issue 1989693002: Introduce DisplayCompositor Mojo API for Mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix client_id Created 4 years, 6 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 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 "components/mus/surfaces/compositor_frame_sink_factory_impl.h"
6
7 #include "base/memory/ptr_util.h"
8 #include "cc/surfaces/surface_id.h"
9 #include "components/mus/surfaces/compositor_frame_sink_impl.h"
10
11 namespace mus {
12 namespace gpu {
13
14 CompositorFrameSinkFactoryImpl::CompositorFrameSinkFactoryImpl(
15 uint32_t client_id,
16 mojo::InterfaceRequest<mojom::CompositorFrameSinkFactory> request,
17 const scoped_refptr<SurfacesState>& surfaces_state)
18 : client_id_(client_id),
19 surfaces_state_(surfaces_state),
20 allocator_(client_id),
21 binding_(this, std::move(request)) {}
22
23 CompositorFrameSinkFactoryImpl::~CompositorFrameSinkFactoryImpl() {}
24
25 void CompositorFrameSinkFactoryImpl::CompositorFrameSinkConnectionLost(
26 int local_id) {
27 sinks_.erase(local_id);
28 }
29
30 cc::SurfaceId CompositorFrameSinkFactoryImpl::GenerateSurfaceId() {
31 return allocator_.GenerateId();
32 }
33
34 void CompositorFrameSinkFactoryImpl::CreateCompositorFrameSink(
35 uint32_t local_id,
36 uint64_t nonce,
37 mojo::InterfaceRequest<mojom::CompositorFrameSink> sink,
38 mojom::CompositorFrameSinkClientPtr client) {
39 // TODO(fsamuel): Use nonce once patch lands:
40 // https://codereview.chromium.org/1996783002/
41 sinks_[local_id] = base::WrapUnique(new CompositorFrameSinkImpl(
42 this, local_id, surfaces_state_, std::move(sink), std::move(client)));
43 }
44
45 } // namespace gpu
46 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/surfaces/compositor_frame_sink_factory_impl.h ('k') | components/mus/surfaces/compositor_frame_sink_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698