OLD | NEW |
(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 uint32_t client_id, |
| 23 mojo::InterfaceRequest<mojom::CompositorFrameSinkFactory> request, |
| 24 const scoped_refptr<SurfacesState>& surfaces_state); |
| 25 ~CompositorFrameSinkFactoryImpl() override; |
| 26 |
| 27 void CompositorFrameSinkConnectionLost(int local_id) override; |
| 28 cc::SurfaceId GenerateSurfaceId() override; |
| 29 |
| 30 // mojom::CompositorFrameSinkFactory implementation. |
| 31 void CreateCompositorFrameSink( |
| 32 uint32_t local_id, |
| 33 uint64_t nonce, |
| 34 mojo::InterfaceRequest<mojom::CompositorFrameSink> sink, |
| 35 mojom::CompositorFrameSinkClientPtr client) override; |
| 36 |
| 37 private: |
| 38 const uint32_t client_id_; |
| 39 scoped_refptr<SurfacesState> surfaces_state_; |
| 40 cc::SurfaceIdAllocator allocator_; |
| 41 using CompositorFrameSinkMap = |
| 42 std::map<uint32_t, std::unique_ptr<CompositorFrameSinkImpl>>; |
| 43 CompositorFrameSinkMap sinks_; |
| 44 mojo::StrongBinding<mojom::CompositorFrameSinkFactory> binding_; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkFactoryImpl); |
| 47 }; |
| 48 |
| 49 } // namespace mus |
| 50 |
| 51 #endif // COMPONENTS_MUS_SURFACES_COMPOSITOR_FRAME_SINK_FACTORY_IMPL_H_ |
OLD | NEW |