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