| 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" |
| 9 #include "cc/ipc/mojo_compositor_frame_sink.mojom.h" | 10 #include "cc/ipc/mojo_compositor_frame_sink.mojom.h" |
| 10 #include "cc/output/compositor_frame_sink.h" | 11 #include "cc/output/compositor_frame_sink.h" |
| 11 #include "cc/output/context_provider.h" | 12 #include "cc/output/context_provider.h" |
| 12 #include "cc/scheduler/begin_frame_source.h" | 13 #include "cc/scheduler/begin_frame_source.h" |
| 13 #include "cc/surfaces/local_surface_id_allocator.h" | 14 #include "cc/surfaces/local_surface_id_allocator.h" |
| 14 #include "cc/surfaces/surface_id.h" | 15 #include "cc/surfaces/surface_id.h" |
| 15 #include "mojo/public/cpp/bindings/binding.h" | 16 #include "mojo/public/cpp/bindings/binding.h" |
| 16 | 17 |
| 17 namespace viz { | 18 namespace viz { |
| 18 | 19 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 35 ClientCompositorFrameSink( | 36 ClientCompositorFrameSink( |
| 36 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider, | 37 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider, |
| 37 std::unique_ptr<cc::SyntheticBeginFrameSource> | 38 std::unique_ptr<cc::SyntheticBeginFrameSource> |
| 38 synthetic_begin_frame_source, | 39 synthetic_begin_frame_source, |
| 39 cc::mojom::MojoCompositorFrameSinkPtrInfo compositor_frame_sink_info, | 40 cc::mojom::MojoCompositorFrameSinkPtrInfo compositor_frame_sink_info, |
| 40 cc::mojom::MojoCompositorFrameSinkClientRequest client_request, | 41 cc::mojom::MojoCompositorFrameSinkClientRequest client_request, |
| 41 bool enable_surface_synchronization); | 42 bool enable_surface_synchronization); |
| 42 | 43 |
| 43 ~ClientCompositorFrameSink() override; | 44 ~ClientCompositorFrameSink() override; |
| 44 | 45 |
| 46 base::WeakPtr<ClientCompositorFrameSink> GetWeakPtr(); |
| 47 |
| 45 // cc::CompositorFrameSink implementation. | 48 // cc::CompositorFrameSink implementation. |
| 46 bool BindToClient(cc::CompositorFrameSinkClient* client) override; | 49 bool BindToClient(cc::CompositorFrameSinkClient* client) override; |
| 47 void DetachFromClient() override; | 50 void DetachFromClient() override; |
| 48 void SetLocalSurfaceId(const cc::LocalSurfaceId& local_surface_id) override; | 51 void SetLocalSurfaceId(const cc::LocalSurfaceId& local_surface_id) override; |
| 49 void SubmitCompositorFrame(cc::CompositorFrame frame) override; | 52 void SubmitCompositorFrame(cc::CompositorFrame frame) override; |
| 50 void DidNotProduceFrame(const cc::BeginFrameAck& ack) override; | 53 void DidNotProduceFrame(const cc::BeginFrameAck& ack) override; |
| 51 | 54 |
| 52 private: | 55 private: |
| 53 virtual bool ShouldAllocateNewLocalSurfaceId( | 56 virtual bool ShouldAllocateNewLocalSurfaceId( |
| 54 const cc::CompositorFrame& frame); | 57 const cc::CompositorFrame& frame); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 69 cc::LocalSurfaceIdAllocator id_allocator_; | 72 cc::LocalSurfaceIdAllocator id_allocator_; |
| 70 std::unique_ptr<cc::ExternalBeginFrameSource> begin_frame_source_; | 73 std::unique_ptr<cc::ExternalBeginFrameSource> begin_frame_source_; |
| 71 std::unique_ptr<cc::SyntheticBeginFrameSource> synthetic_begin_frame_source_; | 74 std::unique_ptr<cc::SyntheticBeginFrameSource> synthetic_begin_frame_source_; |
| 72 cc::mojom::MojoCompositorFrameSinkPtrInfo compositor_frame_sink_info_; | 75 cc::mojom::MojoCompositorFrameSinkPtrInfo compositor_frame_sink_info_; |
| 73 cc::mojom::MojoCompositorFrameSinkClientRequest client_request_; | 76 cc::mojom::MojoCompositorFrameSinkClientRequest client_request_; |
| 74 cc::mojom::MojoCompositorFrameSinkPtr compositor_frame_sink_; | 77 cc::mojom::MojoCompositorFrameSinkPtr compositor_frame_sink_; |
| 75 mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient> client_binding_; | 78 mojo::Binding<cc::mojom::MojoCompositorFrameSinkClient> client_binding_; |
| 76 THREAD_CHECKER(thread_checker_); | 79 THREAD_CHECKER(thread_checker_); |
| 77 const bool enable_surface_synchronization_; | 80 const bool enable_surface_synchronization_; |
| 78 | 81 |
| 82 base::WeakPtrFactory<ClientCompositorFrameSink> weak_factory_; |
| 83 |
| 79 DISALLOW_COPY_AND_ASSIGN(ClientCompositorFrameSink); | 84 DISALLOW_COPY_AND_ASSIGN(ClientCompositorFrameSink); |
| 80 }; | 85 }; |
| 81 | 86 |
| 82 } // namespace viz | 87 } // namespace viz |
| 83 | 88 |
| 84 #endif // COMPONENTS_VIZ_CLIENT_CLIENT_COMPOSITOR_FRAME_SINK_H_ | 89 #endif // COMPONENTS_VIZ_CLIENT_CLIENT_COMPOSITOR_FRAME_SINK_H_ |
| OLD | NEW |