| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_ | 5 #ifndef CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_ |
| 6 #define CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_ | 6 #define CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <unordered_set> | 9 #include <unordered_set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 SurfaceManager* surface_manager, | 36 SurfaceManager* surface_manager, |
| 37 const FrameSinkId& frame_sink_id, | 37 const FrameSinkId& frame_sink_id, |
| 38 bool is_root, | 38 bool is_root, |
| 39 bool handles_frame_sink_id_invalidation, | 39 bool handles_frame_sink_id_invalidation, |
| 40 bool needs_sync_points); | 40 bool needs_sync_points); |
| 41 | 41 |
| 42 ~CompositorFrameSinkSupport() override; | 42 ~CompositorFrameSinkSupport() override; |
| 43 | 43 |
| 44 const FrameSinkId& frame_sink_id() const { return frame_sink_id_; } | 44 const FrameSinkId& frame_sink_id() const { return frame_sink_id_; } |
| 45 | 45 |
| 46 Surface* current_surface_for_testing() { return current_surface_.get(); } | 46 Surface* current_surface_for_testing() { return current_surface_; } |
| 47 SurfaceManager* surface_manager() { return surface_manager_; } | 47 SurfaceManager* surface_manager() { return surface_manager_; } |
| 48 bool needs_sync_points() { return needs_sync_points_; } | 48 bool needs_sync_points() { return needs_sync_points_; } |
| 49 | 49 |
| 50 // SurfaceResourceHolderClient implementation. | 50 // SurfaceResourceHolderClient implementation. |
| 51 void ReturnResources(const ReturnedResourceArray& resources) override; | 51 void ReturnResources(const ReturnedResourceArray& resources) override; |
| 52 | 52 |
| 53 // FrameSinkManagerClient implementation. | 53 // FrameSinkManagerClient implementation. |
| 54 void SetBeginFrameSource(BeginFrameSource* begin_frame_source) override; | 54 void SetBeginFrameSource(BeginFrameSource* begin_frame_source) override; |
| 55 | 55 |
| 56 void EvictCurrentSurface(); | 56 void EvictCurrentSurface(); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 void DidReceiveCompositorFrameAck(); | 92 void DidReceiveCompositorFrameAck(); |
| 93 void WillDrawSurface(const LocalSurfaceId& local_surface_id, | 93 void WillDrawSurface(const LocalSurfaceId& local_surface_id, |
| 94 const gfx::Rect& damage_rect); | 94 const gfx::Rect& damage_rect); |
| 95 | 95 |
| 96 // BeginFrameObserver implementation. | 96 // BeginFrameObserver implementation. |
| 97 void OnBeginFrame(const BeginFrameArgs& args) override; | 97 void OnBeginFrame(const BeginFrameArgs& args) override; |
| 98 const BeginFrameArgs& LastUsedBeginFrameArgs() const override; | 98 const BeginFrameArgs& LastUsedBeginFrameArgs() const override; |
| 99 void OnBeginFrameSourcePausedChanged(bool paused) override; | 99 void OnBeginFrameSourcePausedChanged(bool paused) override; |
| 100 | 100 |
| 101 void UpdateNeedsBeginFramesInternal(); | 101 void UpdateNeedsBeginFramesInternal(); |
| 102 std::unique_ptr<Surface> CreateSurface(const SurfaceInfo& surface_info); | 102 Surface* CreateSurface(const SurfaceInfo& surface_info); |
| 103 void DestroyCurrentSurface(); | |
| 104 | 103 |
| 105 CompositorFrameSinkSupportClient* const client_; | 104 CompositorFrameSinkSupportClient* const client_; |
| 106 | 105 |
| 107 SurfaceManager* surface_manager_ = nullptr; | 106 SurfaceManager* surface_manager_ = nullptr; |
| 108 | 107 |
| 109 const FrameSinkId frame_sink_id_; | 108 const FrameSinkId frame_sink_id_; |
| 110 | 109 |
| 111 // If this contains a value then a surface reference from the top-level root | 110 // If this contains a value then a surface reference from the top-level root |
| 112 // to SurfaceId(frame_sink_id_, referenced_local_surface_id_.value()) was | 111 // to SurfaceId(frame_sink_id_, referenced_local_surface_id_.value()) was |
| 113 // added. This will not contain a value if |is_root_| is false. | 112 // added. This will not contain a value if |is_root_| is false. |
| 114 base::Optional<LocalSurfaceId> referenced_local_surface_id_; | 113 base::Optional<LocalSurfaceId> referenced_local_surface_id_; |
| 115 | 114 |
| 116 SurfaceResourceHolder surface_resource_holder_; | 115 SurfaceResourceHolder surface_resource_holder_; |
| 117 | 116 |
| 118 std::unique_ptr<Surface> current_surface_; | 117 Surface* current_surface_ = nullptr; |
| 119 // Counts the number of CompositorFrames that have been submitted and have not | 118 // Counts the number of CompositorFrames that have been submitted and have not |
| 120 // yet received an ACK. | 119 // yet received an ACK. |
| 121 int ack_pending_count_ = 0; | 120 int ack_pending_count_ = 0; |
| 122 ReturnedResourceArray surface_returned_resources_; | 121 ReturnedResourceArray surface_returned_resources_; |
| 123 | 122 |
| 124 // The begin frame source being observered. Null if none. | 123 // The begin frame source being observered. Null if none. |
| 125 BeginFrameSource* begin_frame_source_ = nullptr; | 124 BeginFrameSource* begin_frame_source_ = nullptr; |
| 126 | 125 |
| 127 // The last begin frame args generated by the begin frame source. | 126 // The last begin frame args generated by the begin frame source. |
| 128 BeginFrameArgs last_begin_frame_args_; | 127 BeginFrameArgs last_begin_frame_args_; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 150 const bool handles_frame_sink_id_invalidation_; | 149 const bool handles_frame_sink_id_invalidation_; |
| 151 | 150 |
| 152 base::WeakPtrFactory<CompositorFrameSinkSupport> weak_factory_; | 151 base::WeakPtrFactory<CompositorFrameSinkSupport> weak_factory_; |
| 153 | 152 |
| 154 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkSupport); | 153 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkSupport); |
| 155 }; | 154 }; |
| 156 | 155 |
| 157 } // namespace cc | 156 } // namespace cc |
| 158 | 157 |
| 159 #endif // CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_ | 158 #endif // CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_ |
| OLD | NEW |