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_AGGREGATOR_H_ | 5 #ifndef CC_SURFACES_SURFACE_AGGREGATOR_H_ |
6 #define CC_SURFACES_SURFACE_AGGREGATOR_H_ | 6 #define CC_SURFACES_SURFACE_AGGREGATOR_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <unordered_map> | 9 #include <unordered_map> |
10 | 10 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 void CopyUndrawnSurfaces(PrewalkResult* prewalk); | 124 void CopyUndrawnSurfaces(PrewalkResult* prewalk); |
125 void CopyPasses(const CompositorFrame& frame, Surface* surface); | 125 void CopyPasses(const CompositorFrame& frame, Surface* surface); |
126 void AddColorConversionPass(); | 126 void AddColorConversionPass(); |
127 | 127 |
128 // Remove Surfaces that were referenced before but aren't currently | 128 // Remove Surfaces that were referenced before but aren't currently |
129 // referenced from the ResourceProvider. | 129 // referenced from the ResourceProvider. |
130 // Also notifies SurfaceAggregatorClient of newly added and removed | 130 // Also notifies SurfaceAggregatorClient of newly added and removed |
131 // child surfaces. | 131 // child surfaces. |
132 void ProcessAddedAndRemovedSurfaces(); | 132 void ProcessAddedAndRemovedSurfaces(); |
133 | 133 |
134 void PropagateCopyRequestPasses(); | 134 void PropagatePasses(base::flat_set<RenderPassId>* passes); |
135 | 135 |
136 int ChildIdForSurface(Surface* surface); | 136 int ChildIdForSurface(Surface* surface); |
137 gfx::Rect DamageRectForSurface(const Surface* surface, | 137 gfx::Rect DamageRectForSurface(const Surface* surface, |
138 const RenderPass& source, | 138 const RenderPass& source, |
139 const gfx::Rect& full_rect) const; | 139 const gfx::Rect& full_rect) const; |
140 | 140 |
141 SurfaceManager* manager_; | 141 SurfaceManager* manager_; |
142 ResourceProvider* provider_; | 142 ResourceProvider* provider_; |
143 | 143 |
144 // Every Surface has its own RenderPass ID namespace. This structure maps | 144 // Every Surface has its own RenderPass ID namespace. This structure maps |
(...skipping 29 matching lines...) Expand all Loading... |
174 // For each Surface used in the last aggregation, gives the frame_index at | 174 // For each Surface used in the last aggregation, gives the frame_index at |
175 // that time. | 175 // that time. |
176 SurfaceIndexMap previous_contained_surfaces_; | 176 SurfaceIndexMap previous_contained_surfaces_; |
177 SurfaceIndexMap contained_surfaces_; | 177 SurfaceIndexMap contained_surfaces_; |
178 | 178 |
179 // After surface validation, every Surface in this set is valid. | 179 // After surface validation, every Surface in this set is valid. |
180 base::flat_set<SurfaceId> valid_surfaces_; | 180 base::flat_set<SurfaceId> valid_surfaces_; |
181 | 181 |
182 // This is the pass list for the aggregated frame. | 182 // This is the pass list for the aggregated frame. |
183 RenderPassList* dest_pass_list_; | 183 RenderPassList* dest_pass_list_; |
| 184 // This maps pass id to itself. |
| 185 base::flat_map<RenderPassId, RenderPass*> passes_id_map; |
184 | 186 |
185 // This is the set of aggregated pass ids that are affected by filters that | 187 // This is the set of aggregated pass ids that are affected by filters that |
186 // move pixels. | 188 // move pixels. |
187 base::flat_set<RenderPassId> moved_pixel_passes_; | 189 base::flat_set<RenderPassId> moved_pixel_passes_; |
188 | 190 |
189 // This is the set of aggregated pass ids that are drawn by copy requests, so | 191 // This is the set of aggregated pass ids that are drawn by copy requests, so |
190 // should not have their damage rects clipped to the root damage rect. | 192 // should not have their damage rects clipped to the root damage rect. |
191 base::flat_set<RenderPassId> copy_request_passes_; | 193 base::flat_set<RenderPassId> copy_request_passes_; |
192 | 194 |
| 195 // This is the set of aggregated pass ids that are drawn by force render |
| 196 // surface, so should not have their damage rects clipped to the root damage |
| 197 // rect. |
| 198 base::flat_set<RenderPassId> cache_render_surface_passes_; |
| 199 |
193 // This maps each aggregated pass id to the set of (aggregated) pass ids | 200 // This maps each aggregated pass id to the set of (aggregated) pass ids |
194 // that its RenderPassDrawQuads depend on | 201 // that its RenderPassDrawQuads depend on |
195 base::flat_map<RenderPassId, base::flat_set<RenderPassId>> | 202 base::flat_map<RenderPassId, base::flat_set<RenderPassId>> |
196 render_pass_dependencies_; | 203 render_pass_dependencies_; |
197 | 204 |
198 // The root damage rect of the currently-aggregating frame. | 205 // The root damage rect of the currently-aggregating frame. |
199 gfx::Rect root_damage_rect_; | 206 gfx::Rect root_damage_rect_; |
200 | 207 |
201 // True if the frame that's currently being aggregated has copy requests. | 208 // True if the frame that's currently being aggregated has copy requests. |
202 // This is valid during Aggregate after PrewalkTree is called. | 209 // This is valid during Aggregate after PrewalkTree is called. |
203 bool has_copy_requests_; | 210 bool has_copy_requests_; |
204 | 211 |
| 212 // True if the frame that's currently being aggregated has force render |
| 213 // surface. This is valid during Aggregate after PrewalkTree is called. |
| 214 bool has_cache_render_surfaces_; |
| 215 |
205 // Tracks UMA stats for SurfaceDrawQuads during a call to Aggregate(). | 216 // Tracks UMA stats for SurfaceDrawQuads during a call to Aggregate(). |
206 SurfaceDrawQuadUmaStats uma_stats_; | 217 SurfaceDrawQuadUmaStats uma_stats_; |
207 | 218 |
208 base::WeakPtrFactory<SurfaceAggregator> weak_factory_; | 219 base::WeakPtrFactory<SurfaceAggregator> weak_factory_; |
209 | 220 |
210 DISALLOW_COPY_AND_ASSIGN(SurfaceAggregator); | 221 DISALLOW_COPY_AND_ASSIGN(SurfaceAggregator); |
211 }; | 222 }; |
212 | 223 |
213 } // namespace cc | 224 } // namespace cc |
214 | 225 |
215 #endif // CC_SURFACES_SURFACE_AGGREGATOR_H_ | 226 #endif // CC_SURFACES_SURFACE_AGGREGATOR_H_ |
OLD | NEW |