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

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

Issue 1989693002: Introduce DisplayCompositor Mojo API for Mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup interface a bit more Created 4 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 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 #ifndef COMPONENTS_MUS_SURFACES_COMPOSITOR_FRAME_SINK_FACTORY_IMPL_H_
6 #define COMPONENTS_MUS_SURFACES_COMPOSITOR_FRAME_SINK_FACTORY_IMPL_H_
7
8 #include "cc/surfaces/surface_id_allocator.h"
9 #include "components/mus/public/interfaces/display_compositor.mojom.h"
10 #include "components/mus/surfaces/compositor_frame_sink_delegate.h"
11 #include "components/mus/surfaces/surfaces_state.h"
12 #include "mojo/public/cpp/bindings/strong_binding.h"
13
14 namespace mus {
15
16 class CompositorFrameSinkImpl;
17
18 class CompositorFrameSinkFactoryImpl : public mojom::CompositorFrameSinkFactory,
19 public CompositorFrameSinkDelegate {
20 public:
21 CompositorFrameSinkFactoryImpl(
22 int client_id,
23 mojo::InterfaceRequest<mojom::CompositorFrameSinkFactory> request,
24 const scoped_refptr<SurfacesState>& surfaces_state);
25 ~CompositorFrameSinkFactoryImpl() override;
26
27 void CompositorFrameSinkConnectionLost(int sink_id) override;
rjkroege 2016/05/19 22:08:38 // CompositorFrameSinkDelegate implementation? An
Fady Samuel 2016/05/25 12:37:01 For unit testing. One can test this class without
28 cc::SurfaceId GenerateSurfaceId() override;
29
30 // mojom::CompositorFrameSinkFactory implementation.
31 void CreateCompositorFrameSink(
32 int sink_id,
33 mojo::InterfaceRequest<mojom::CompositorFrameSink> sink,
34 mojom::CompositorFrameSinkClientPtr client) override;
35
36 private:
37 const int client_id_;
38 scoped_refptr<SurfacesState> surfaces_state_;
39 cc::SurfaceIdAllocator allocator_;
40 using CompositorFrameSinkMap =
41 std::map<int, std::unique_ptr<CompositorFrameSinkImpl>>;
42 CompositorFrameSinkMap sinks_;
43 mojo::StrongBinding<mojom::CompositorFrameSinkFactory> binding_;
44
45 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkFactoryImpl);
46 };
47
48 } // namespace mus
49
50 #endif // COMPONENTS_MUS_SURFACES_COMPOSITOR_FRAME_SINK_FACTORY_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698