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

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

Issue 2696743002: Prepare CompositorFrameSinkSupport To Be Used By DirectCompositorFrameSink (Closed)
Patch Set: rebase android Created 3 years, 10 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 10
(...skipping 12 matching lines...) Expand all
23 class CompositorFrameSinkSupportClient; 23 class CompositorFrameSinkSupportClient;
24 class SurfaceManager; 24 class SurfaceManager;
25 25
26 class CC_SURFACES_EXPORT CompositorFrameSinkSupport 26 class CC_SURFACES_EXPORT CompositorFrameSinkSupport
27 : public SurfaceFactoryClient, 27 : public SurfaceFactoryClient,
28 public BeginFrameObserver { 28 public BeginFrameObserver {
29 public: 29 public:
30 CompositorFrameSinkSupport(CompositorFrameSinkSupportClient* client, 30 CompositorFrameSinkSupport(CompositorFrameSinkSupportClient* client,
31 SurfaceManager* surface_manager, 31 SurfaceManager* surface_manager,
32 const FrameSinkId& frame_sink_id, 32 const FrameSinkId& frame_sink_id,
33 bool submits_to_display_compositor); 33 bool submits_to_display_compositor,
34 bool handles_frame_sink_id_invalidation,
35 bool needs_sync_points);
34 36
35 ~CompositorFrameSinkSupport() override; 37 ~CompositorFrameSinkSupport() override;
36 38
37 const FrameSinkId& frame_sink_id() const { return frame_sink_id_; } 39 const FrameSinkId& frame_sink_id() const { return frame_sink_id_; }
38 40
39 Surface* current_surface_for_testing() { 41 Surface* current_surface_for_testing() {
40 return surface_factory_.current_surface_for_testing(); 42 return surface_factory_.current_surface_for_testing();
41 } 43 }
42 44
43 const ReferencedSurfaceTracker& ReferenceTrackerForTesting() const { 45 const ReferencedSurfaceTracker& ReferenceTrackerForTesting() const {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 108
107 // Track the surface references for the surface corresponding to this 109 // Track the surface references for the surface corresponding to this
108 // compositor frame sink. 110 // compositor frame sink.
109 ReferencedSurfaceTracker reference_tracker_; 111 ReferencedSurfaceTracker reference_tracker_;
110 112
111 // The set of BeginFrame children of this CompositorFrameSink. 113 // The set of BeginFrame children of this CompositorFrameSink.
112 std::unordered_set<FrameSinkId, FrameSinkIdHash> child_frame_sinks_; 114 std::unordered_set<FrameSinkId, FrameSinkIdHash> child_frame_sinks_;
113 115
114 const bool submits_to_display_compositor_; 116 const bool submits_to_display_compositor_;
115 117
118 // TODO(staraz): Remove this flag once ui::Compositor no longer needs to call
119 // RegisterFrameSinkId().
120 // A surfaceSequence's validity is bound to the lifetime of the parent
121 // FrameSink that created it. We track the lifetime of FrameSinks through
122 // RegisterFrameSinkId and InvalidateFrameSinkId. During startup and GPU
123 // restart, a SurfaceSequence created by the top most layer compositor may be
124 // used prior to the creation of the associated CompositorFrameSinkSupport.
125 // CompositorFrameSinkSupport is created asynchronously when a new GPU channel
126 // is established. Once we switch to SurfaceReferences, this ordering concern
127 // goes away and we can remove this bool.
128 const bool handles_frame_sink_id_invalidation_;
129
116 base::WeakPtrFactory<CompositorFrameSinkSupport> weak_factory_; 130 base::WeakPtrFactory<CompositorFrameSinkSupport> weak_factory_;
117 131
118 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkSupport); 132 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkSupport);
119 }; 133 };
120 134
121 } // namespace cc 135 } // namespace cc
122 136
123 #endif // CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_ 137 #endif // CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698