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

Side by Side Diff: cc/surfaces/compositor_frame_sink_support.h

Issue 2807653003: Move Work From CompositorFrameSinkSupport() To Init() (Closed)
Patch Set: Set needs_sync_points Created 3 years, 8 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
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 11 matching lines...) Expand all
22 namespace cc { 22 namespace cc {
23 23
24 class CompositorFrameSinkSupportClient; 24 class CompositorFrameSinkSupportClient;
25 class SurfaceManager; 25 class SurfaceManager;
26 26
27 class CC_SURFACES_EXPORT CompositorFrameSinkSupport 27 class CC_SURFACES_EXPORT CompositorFrameSinkSupport
28 : public SurfaceFactoryClient, 28 : public SurfaceFactoryClient,
29 public BeginFrameObserver { 29 public BeginFrameObserver {
30 public: 30 public:
31 CompositorFrameSinkSupport(CompositorFrameSinkSupportClient* client, 31 CompositorFrameSinkSupport(CompositorFrameSinkSupportClient* client,
32 SurfaceManager* surface_manager,
33 const FrameSinkId& frame_sink_id, 32 const FrameSinkId& frame_sink_id,
34 bool is_root, 33 bool is_root,
35 bool handles_frame_sink_id_invalidation, 34 bool handles_frame_sink_id_invalidation);
36 bool needs_sync_points);
37 35
38 ~CompositorFrameSinkSupport() override; 36 ~CompositorFrameSinkSupport() override;
39 37
38 void Init(SurfaceManager* surface_manager, bool needs_sync_points);
39
40 const FrameSinkId& frame_sink_id() const { return frame_sink_id_; } 40 const FrameSinkId& frame_sink_id() const { return frame_sink_id_; }
41 41
42 Surface* current_surface_for_testing() { 42 Surface* current_surface_for_testing() {
43 return surface_factory_.current_surface_for_testing(); 43 return surface_factory_->current_surface_for_testing();
44 } 44 }
45 45
46 const ReferencedSurfaceTracker& ReferenceTrackerForTesting() const { 46 const ReferencedSurfaceTracker& ReferenceTrackerForTesting() const {
47 return reference_tracker_; 47 return reference_tracker_;
48 } 48 }
49 49
50 // SurfaceFactoryClient implementation. 50 // SurfaceFactoryClient implementation.
51 void ReferencedSurfacesChanged( 51 void ReferencedSurfacesChanged(
52 const LocalSurfaceId& local_surface_id, 52 const LocalSurfaceId& local_surface_id,
53 const std::vector<SurfaceId>* active_referenced_surfaces, 53 const std::vector<SurfaceId>* active_referenced_surfaces,
(...skipping 27 matching lines...) Expand all
81 81
82 // BeginFrameObserver implementation. 82 // BeginFrameObserver implementation.
83 void OnBeginFrame(const BeginFrameArgs& args) override; 83 void OnBeginFrame(const BeginFrameArgs& args) override;
84 const BeginFrameArgs& LastUsedBeginFrameArgs() const override; 84 const BeginFrameArgs& LastUsedBeginFrameArgs() const override;
85 void OnBeginFrameSourcePausedChanged(bool paused) override; 85 void OnBeginFrameSourcePausedChanged(bool paused) override;
86 86
87 void UpdateNeedsBeginFramesInternal(); 87 void UpdateNeedsBeginFramesInternal();
88 88
89 CompositorFrameSinkSupportClient* const client_; 89 CompositorFrameSinkSupportClient* const client_;
90 90
91 SurfaceManager* const surface_manager_; 91 SurfaceManager* surface_manager_;
92 92
93 const FrameSinkId frame_sink_id_; 93 const FrameSinkId frame_sink_id_;
94 94
95 SurfaceFactory surface_factory_; 95 std::unique_ptr<SurfaceFactory> surface_factory_;
96 // Counts the number of CompositorFrames that have been submitted and have not 96 // Counts the number of CompositorFrames that have been submitted and have not
97 // yet received an ACK. 97 // yet received an ACK.
98 int ack_pending_count_ = 0; 98 int ack_pending_count_ = 0;
99 ReturnedResourceArray surface_returned_resources_; 99 ReturnedResourceArray surface_returned_resources_;
100 100
101 // The begin frame source being observered. Null if none. 101 // The begin frame source being observered. Null if none.
102 BeginFrameSource* begin_frame_source_ = nullptr; 102 BeginFrameSource* begin_frame_source_ = nullptr;
103 103
104 // The last begin frame args generated by the begin frame source. 104 // The last begin frame args generated by the begin frame source.
105 BeginFrameArgs last_begin_frame_args_; 105 BeginFrameArgs last_begin_frame_args_;
(...skipping 23 matching lines...) Expand all
129 const bool handles_frame_sink_id_invalidation_; 129 const bool handles_frame_sink_id_invalidation_;
130 130
131 base::WeakPtrFactory<CompositorFrameSinkSupport> weak_factory_; 131 base::WeakPtrFactory<CompositorFrameSinkSupport> weak_factory_;
132 132
133 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkSupport); 133 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkSupport);
134 }; 134 };
135 135
136 } // namespace cc 136 } // namespace cc
137 137
138 #endif // CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_ 138 #endif // CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698