OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_VIZ_CLIENT_CLIENT_COMPOSITOR_FRAME_SINK_H_ | 5 #ifndef COMPONENTS_VIZ_CLIENT_CLIENT_COMPOSITOR_FRAME_SINK_H_ |
6 #define COMPONENTS_VIZ_CLIENT_CLIENT_COMPOSITOR_FRAME_SINK_H_ | 6 #define COMPONENTS_VIZ_CLIENT_CLIENT_COMPOSITOR_FRAME_SINK_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/weak_ptr.h" | |
10 #include "cc/ipc/mojo_compositor_frame_sink.mojom.h" | 9 #include "cc/ipc/mojo_compositor_frame_sink.mojom.h" |
11 #include "cc/output/compositor_frame_sink.h" | 10 #include "cc/output/compositor_frame_sink.h" |
12 #include "cc/output/context_provider.h" | 11 #include "cc/output/context_provider.h" |
13 #include "cc/scheduler/begin_frame_source.h" | 12 #include "cc/scheduler/begin_frame_source.h" |
14 #include "cc/surfaces/local_surface_id_allocator.h" | 13 #include "cc/surfaces/local_surface_id_allocator.h" |
15 #include "cc/surfaces/surface_id.h" | 14 #include "cc/surfaces/surface_id.h" |
16 #include "mojo/public/cpp/bindings/binding.h" | 15 #include "mojo/public/cpp/bindings/binding.h" |
17 | 16 |
18 namespace viz { | 17 namespace viz { |
19 | 18 |
(...skipping 20 matching lines...) Expand all Loading... |
40 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider, | 39 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider, |
41 std::unique_ptr<cc::SyntheticBeginFrameSource> | 40 std::unique_ptr<cc::SyntheticBeginFrameSource> |
42 synthetic_begin_frame_source, | 41 synthetic_begin_frame_source, |
43 cc::mojom::MojoCompositorFrameSinkPtrInfo compositor_frame_sink_info, | 42 cc::mojom::MojoCompositorFrameSinkPtrInfo compositor_frame_sink_info, |
44 cc::mojom::MojoCompositorFrameSinkClientRequest client_request, | 43 cc::mojom::MojoCompositorFrameSinkClientRequest client_request, |
45 std::unique_ptr<LocalSurfaceIdProvider> local_surface_id_provider, | 44 std::unique_ptr<LocalSurfaceIdProvider> local_surface_id_provider, |
46 bool enable_surface_synchronization); | 45 bool enable_surface_synchronization); |
47 | 46 |
48 ~ClientCompositorFrameSink() override; | 47 ~ClientCompositorFrameSink() override; |
49 | 48 |
50 base::WeakPtr<ClientCompositorFrameSink> GetWeakPtr(); | |
51 | |
52 // cc::CompositorFrameSink implementation. | 49 // cc::CompositorFrameSink implementation. |
53 bool BindToClient(cc::CompositorFrameSinkClient* client) override; | 50 bool BindToClient(cc::CompositorFrameSinkClient* client) override; |
54 void DetachFromClient() override; | 51 void DetachFromClient() override; |
55 void SetLocalSurfaceId(const cc::LocalSurfaceId& local_surface_id) override; | 52 void SetLocalSurfaceId(const cc::LocalSurfaceId& local_surface_id) override; |
56 void SubmitCompositorFrame(cc::CompositorFrame frame) override; | 53 void SubmitCompositorFrame(cc::CompositorFrame frame) override; |
57 void DidNotProduceFrame(const cc::BeginFrameAck& ack) override; | 54 void DidNotProduceFrame(const cc::BeginFrameAck& ack) override; |
58 | 55 |
59 private: | 56 private: |
60 // cc::mojom::MojoCompositorFrameSinkClient implementation: | 57 // cc::mojom::MojoCompositorFrameSinkClient implementation: |
61 void DidReceiveCompositorFrameAck( | 58 void DidReceiveCompositorFrameAck( |
62 const cc::ReturnedResourceArray& resources) override; | 59 const cc::ReturnedResourceArray& resources) override; |
63 void OnBeginFrame(const cc::BeginFrameArgs& begin_frame_args) override; | 60 void OnBeginFrame(const cc::BeginFrameArgs& begin_frame_args) override; |
64 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; | 61 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; |
65 | 62 |
66 // cc::ExternalBeginFrameSourceClient implementation. | 63 // cc::ExternalBeginFrameSourceClient implementation. |
67 void OnNeedsBeginFrames(bool needs_begin_frames) override; | 64 void OnNeedsBeginFrames(bool needs_begin_frames) override; |
68 | 65 |
69 cc::LocalSurfaceId local_surface_id_; | 66 cc::LocalSurfaceId local_surface_id_; |
70 std::unique_ptr<LocalSurfaceIdProvider> local_surface_id_provider_; | 67 std::unique_ptr<LocalSurfaceIdProvider> local_surface_id_provider_; |
71 std::unique_ptr<cc::ExternalBeginFrameSource> begin_frame_source_; | 68 std::unique_ptr<cc::ExternalBeginFrameSource> begin_frame_source_; |
72 std::unique_ptr<cc::SyntheticBeginFrameSource> synthetic_begin_frame_source_; | 69 std::unique_ptr<cc::SyntheticBeginFrameSource> synthetic_begin_frame_source_; |
73 cc::mojom::MojoCompositorFrameSinkPtrInfo compositor_frame_sink_info_; | 70 cc::mojom::MojoCompositorFrameSinkPtrInfo compositor_frame_sink_info_; |
74 cc::mojom::MojoCompositorFrameSinkClientRequest client_request_; | 71 cc::mojom::MojoCompositorFrameSinkClientRequest client_request_; |
75 cc::mojom::MojoCompositorFrameSinkPtr compositor_frame_sink_; | 72 cc::mojom::MojoCompositorFrameSinkPtr compositor_frame_sink_; |
76 mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient> client_binding_; | 73 mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient> client_binding_; |
77 THREAD_CHECKER(thread_checker_); | 74 THREAD_CHECKER(thread_checker_); |
78 const bool enable_surface_synchronization_; | 75 const bool enable_surface_synchronization_; |
79 | 76 |
80 base::WeakPtrFactory<ClientCompositorFrameSink> weak_factory_; | |
81 | |
82 DISALLOW_COPY_AND_ASSIGN(ClientCompositorFrameSink); | 77 DISALLOW_COPY_AND_ASSIGN(ClientCompositorFrameSink); |
83 }; | 78 }; |
84 | 79 |
85 } // namespace viz | 80 } // namespace viz |
86 | 81 |
87 #endif // COMPONENTS_VIZ_CLIENT_CLIENT_COMPOSITOR_FRAME_SINK_H_ | 82 #endif // COMPONENTS_VIZ_CLIENT_CLIENT_COMPOSITOR_FRAME_SINK_H_ |
OLD | NEW |