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