Chromium Code Reviews| 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 COMPONENTS_VIZ_SERVICE_DISPLAY_SURFACE_AGGREGATOR_H_ | 5 #ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_SURFACE_AGGREGATOR_H_ |
| 6 #define COMPONENTS_VIZ_SERVICE_DISPLAY_SURFACE_AGGREGATOR_H_ | 6 #define COMPONENTS_VIZ_SERVICE_DISPLAY_SURFACE_AGGREGATOR_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <unordered_map> | 9 #include <unordered_map> |
| 10 | 10 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 void CopyUndrawnSurfaces(PrewalkResult* prewalk); | 130 void CopyUndrawnSurfaces(PrewalkResult* prewalk); |
| 131 void CopyPasses(const cc::CompositorFrame& frame, cc::Surface* surface); | 131 void CopyPasses(const cc::CompositorFrame& frame, cc::Surface* surface); |
| 132 void AddColorConversionPass(); | 132 void AddColorConversionPass(); |
| 133 | 133 |
| 134 // Remove Surfaces that were referenced before but aren't currently | 134 // Remove Surfaces that were referenced before but aren't currently |
| 135 // referenced from the ResourceProvider. | 135 // referenced from the ResourceProvider. |
| 136 // Also notifies SurfaceAggregatorClient of newly added and removed | 136 // Also notifies SurfaceAggregatorClient of newly added and removed |
| 137 // child surfaces. | 137 // child surfaces. |
| 138 void ProcessAddedAndRemovedSurfaces(); | 138 void ProcessAddedAndRemovedSurfaces(); |
| 139 | 139 |
| 140 void PropagateCopyRequestPasses(); | 140 void PropagatePasses(base::flat_set<cc::RenderPassId>* passes); |
|
danakj
2017/07/19 22:52:55
Please give the variable more context in the name
wutao
2017/07/21 05:59:24
Related to the other comments. Do not need this mo
| |
| 141 | 141 |
| 142 int ChildIdForSurface(cc::Surface* surface); | 142 int ChildIdForSurface(cc::Surface* surface); |
| 143 gfx::Rect DamageRectForSurface(const cc::Surface* surface, | 143 gfx::Rect DamageRectForSurface(const cc::Surface* surface, |
| 144 const cc::RenderPass& source, | 144 const cc::RenderPass& source, |
| 145 const gfx::Rect& full_rect) const; | 145 const gfx::Rect& full_rect) const; |
| 146 | 146 |
| 147 static void UnrefResources(base::WeakPtr<cc::SurfaceClient> surface_client, | 147 static void UnrefResources(base::WeakPtr<cc::SurfaceClient> surface_client, |
| 148 const std::vector<cc::ReturnedResource>& resources, | 148 const std::vector<cc::ReturnedResource>& resources, |
| 149 cc::BlockingTaskRunner* main_thread_task_runner); | 149 cc::BlockingTaskRunner* main_thread_task_runner); |
| 150 | 150 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 184 // For each Surface used in the last aggregation, gives the frame_index at | 184 // For each Surface used in the last aggregation, gives the frame_index at |
| 185 // that time. | 185 // that time. |
| 186 SurfaceIndexMap previous_contained_surfaces_; | 186 SurfaceIndexMap previous_contained_surfaces_; |
| 187 SurfaceIndexMap contained_surfaces_; | 187 SurfaceIndexMap contained_surfaces_; |
| 188 | 188 |
| 189 // After surface validation, every Surface in this set is valid. | 189 // After surface validation, every Surface in this set is valid. |
| 190 base::flat_set<SurfaceId> valid_surfaces_; | 190 base::flat_set<SurfaceId> valid_surfaces_; |
| 191 | 191 |
| 192 // This is the pass list for the aggregated frame. | 192 // This is the pass list for the aggregated frame. |
| 193 cc::RenderPassList* dest_pass_list_; | 193 cc::RenderPassList* dest_pass_list_; |
| 194 // This maps pass id to itself. | |
| 195 base::flat_map<cc::RenderPassId, cc::RenderPass*> id_to_render_pass_map_; | |
| 194 | 196 |
| 195 // This is the set of aggregated pass ids that are affected by filters that | 197 // This is the set of aggregated pass ids that are affected by filters that |
| 196 // move pixels. | 198 // move pixels. |
| 197 base::flat_set<cc::RenderPassId> moved_pixel_passes_; | 199 base::flat_set<cc::RenderPassId> moved_pixel_passes_; |
| 198 | 200 |
| 199 // This is the set of aggregated pass ids that are drawn by copy requests, so | 201 // This is the set of aggregated pass ids that are drawn by copy requests, so |
| 200 // should not have their damage rects clipped to the root damage rect. | 202 // should not have their damage rects clipped to the root damage rect. |
| 201 base::flat_set<cc::RenderPassId> copy_request_passes_; | 203 base::flat_set<cc::RenderPassId> copy_request_passes_; |
| 202 | 204 |
| 205 // This is the set of aggregated pass ids that are drawn by force render | |
| 206 // surface, so should not have their damage rects clipped to the root damage | |
| 207 // rect. | |
| 208 base::flat_set<cc::RenderPassId> cached_render_surface_passes_; | |
| 209 | |
| 203 // This maps each aggregated pass id to the set of (aggregated) pass ids | 210 // This maps each aggregated pass id to the set of (aggregated) pass ids |
| 204 // that its RenderPassDrawQuads depend on | 211 // that its RenderPassDrawQuads depend on |
| 205 base::flat_map<cc::RenderPassId, base::flat_set<cc::RenderPassId>> | 212 base::flat_map<cc::RenderPassId, base::flat_set<cc::RenderPassId>> |
| 206 render_pass_dependencies_; | 213 render_pass_dependencies_; |
| 207 | 214 |
| 208 // The root damage rect of the currently-aggregating frame. | 215 // The root damage rect of the currently-aggregating frame. |
| 209 gfx::Rect root_damage_rect_; | 216 gfx::Rect root_damage_rect_; |
| 210 | 217 |
| 211 // True if the frame that's currently being aggregated has copy requests. | 218 // True if the frame that's currently being aggregated has copy requests. |
| 212 // This is valid during Aggregate after PrewalkTree is called. | 219 // This is valid during Aggregate after PrewalkTree is called. |
| 213 bool has_copy_requests_; | 220 bool has_copy_requests_; |
| 214 | 221 |
| 222 // True if the frame that's currently being aggregated has force render | |
| 223 // surface. This is valid during Aggregate after PrewalkTree is called. | |
| 224 bool has_cached_render_surfaces_; | |
| 225 | |
| 215 // Tracks UMA stats for SurfaceDrawQuads during a call to Aggregate(). | 226 // Tracks UMA stats for SurfaceDrawQuads during a call to Aggregate(). |
| 216 SurfaceDrawQuadUmaStats uma_stats_; | 227 SurfaceDrawQuadUmaStats uma_stats_; |
| 217 | 228 |
| 218 base::WeakPtrFactory<SurfaceAggregator> weak_factory_; | 229 base::WeakPtrFactory<SurfaceAggregator> weak_factory_; |
| 219 | 230 |
| 220 DISALLOW_COPY_AND_ASSIGN(SurfaceAggregator); | 231 DISALLOW_COPY_AND_ASSIGN(SurfaceAggregator); |
| 221 }; | 232 }; |
| 222 | 233 |
| 223 } // namespace viz | 234 } // namespace viz |
| 224 | 235 |
| 225 #endif // COMPONENTS_VIZ_SERVICE_DISPLAY_SURFACE_AGGREGATOR_H_ | 236 #endif // COMPONENTS_VIZ_SERVICE_DISPLAY_SURFACE_AGGREGATOR_H_ |
| OLD | NEW |