OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SURFACE_H_ | 5 #ifndef CC_SURFACES_SURFACE_H_ |
6 #define CC_SURFACES_SURFACE_H_ | 6 #define CC_SURFACES_SURFACE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 94 |
95 // Satisfy all destruction dependencies that are contained in sequences, and | 95 // Satisfy all destruction dependencies that are contained in sequences, and |
96 // remove them from sequences. | 96 // remove them from sequences. |
97 void SatisfyDestructionDependencies( | 97 void SatisfyDestructionDependencies( |
98 std::unordered_set<SurfaceSequence, SurfaceSequenceHash>* sequences, | 98 std::unordered_set<SurfaceSequence, SurfaceSequenceHash>* sequences, |
99 std::unordered_set<FrameSinkId, FrameSinkIdHash>* valid_id_namespaces); | 99 std::unordered_set<FrameSinkId, FrameSinkIdHash>* valid_id_namespaces); |
100 size_t GetDestructionDependencyCount() const { | 100 size_t GetDestructionDependencyCount() const { |
101 return destruction_dependencies_.size(); | 101 return destruction_dependencies_.size(); |
102 } | 102 } |
103 | 103 |
104 const std::vector<SurfaceId>& referenced_surfaces() const { | 104 const std::vector<SurfaceId>& active_referenced_surfaces() const { |
105 return referenced_surfaces_; | 105 return active_referenced_surfaces_; |
| 106 } |
| 107 |
| 108 const std::vector<SurfaceId>& pending_referenced_surfaces() const { |
| 109 return pending_referenced_surfaces_; |
106 } | 110 } |
107 | 111 |
108 const SurfaceDependencies& blocking_surfaces_for_testing() const { | 112 const SurfaceDependencies& blocking_surfaces_for_testing() const { |
109 return blocking_surfaces_; | 113 return blocking_surfaces_; |
110 } | 114 } |
111 | 115 |
112 bool HasActiveFrame() const { return active_frame_.has_value(); } | 116 bool HasActiveFrame() const { return active_frame_.has_value(); } |
113 bool HasPendingFrame() const { return pending_frame_.has_value(); } | 117 bool HasPendingFrame() const { return pending_frame_.has_value(); } |
114 | 118 |
115 bool destroyed() const { return destroyed_; } | 119 bool destroyed() const { return destroyed_; } |
(...skipping 17 matching lines...) Expand all Loading... |
133 base::Optional<CompositorFrame> pending_frame_; | 137 base::Optional<CompositorFrame> pending_frame_; |
134 base::Optional<CompositorFrame> active_frame_; | 138 base::Optional<CompositorFrame> active_frame_; |
135 int frame_index_; | 139 int frame_index_; |
136 bool destroyed_; | 140 bool destroyed_; |
137 std::vector<SurfaceSequence> destruction_dependencies_; | 141 std::vector<SurfaceSequence> destruction_dependencies_; |
138 | 142 |
139 // This surface may have multiple BeginFrameSources if it is | 143 // This surface may have multiple BeginFrameSources if it is |
140 // on multiple Displays. | 144 // on multiple Displays. |
141 std::set<BeginFrameSource*> begin_frame_sources_; | 145 std::set<BeginFrameSource*> begin_frame_sources_; |
142 | 146 |
143 // The total set of CompositorFrames referenced by the active CompositorFrame. | 147 // The set of SurfaceIds referenced by the active CompositorFrame. |
144 std::vector<SurfaceId> referenced_surfaces_; | 148 // TODO(fsamuel): It seems unnecessary to copy this vector over |
| 149 // from CompostiorFrameMetadata to store locally here. We can simply |
| 150 // provide an accessor to the referenced surfaces directly from |
| 151 // CompositorFrameMetadata. |
| 152 std::vector<SurfaceId> active_referenced_surfaces_; |
| 153 |
| 154 // The set of SurfaceIds referenced by the pending CompositorFrame. |
| 155 // TODO(fsamuel): It seems unnecessary to copy this vector over |
| 156 // from CompostiorFrameMetadata to store locally here. We can simply |
| 157 // provide an accessor to the referenced surfaces directly from |
| 158 // CompositorFrameMetadata. |
| 159 std::vector<SurfaceId> pending_referenced_surfaces_; |
145 | 160 |
146 SurfaceDependencies blocking_surfaces_; | 161 SurfaceDependencies blocking_surfaces_; |
147 base::ObserverList<PendingFrameObserver, true> observers_; | 162 base::ObserverList<PendingFrameObserver, true> observers_; |
148 | 163 |
149 DrawCallback draw_callback_; | 164 DrawCallback draw_callback_; |
150 | 165 |
151 DISALLOW_COPY_AND_ASSIGN(Surface); | 166 DISALLOW_COPY_AND_ASSIGN(Surface); |
152 }; | 167 }; |
153 | 168 |
154 using PendingSurfaceSet = base::flat_set<Surface*>; | 169 using PendingSurfaceSet = base::flat_set<Surface*>; |
155 | 170 |
156 } // namespace cc | 171 } // namespace cc |
157 | 172 |
158 #endif // CC_SURFACES_SURFACE_H_ | 173 #endif // CC_SURFACES_SURFACE_H_ |
OLD | NEW |