| 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 <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 bool may_contain_video = false; | 69 bool may_contain_video = false; |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 struct RenderPassInfo { | 72 struct RenderPassInfo { |
| 73 // This is the id the pass is mapped to. | 73 // This is the id the pass is mapped to. |
| 74 int id; | 74 int id; |
| 75 // This is true if the pass was used in the last aggregated frame. | 75 // This is true if the pass was used in the last aggregated frame. |
| 76 bool in_use = true; | 76 bool in_use = true; |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 struct SurfaceDrawQuadUmaStats { |
| 80 void Reset() { |
| 81 valid_surface = 0; |
| 82 missing_surface = 0; |
| 83 no_active_frame = 0; |
| 84 } |
| 85 |
| 86 // The surface exists and has an active frame. |
| 87 int valid_surface; |
| 88 // The surface doesn't exist. |
| 89 int missing_surface; |
| 90 // The surface exists but doesn't have an active frame. |
| 91 int no_active_frame; |
| 92 }; |
| 93 |
| 79 ClipData CalculateClipRect(const ClipData& surface_clip, | 94 ClipData CalculateClipRect(const ClipData& surface_clip, |
| 80 const ClipData& quad_clip, | 95 const ClipData& quad_clip, |
| 81 const gfx::Transform& target_transform); | 96 const gfx::Transform& target_transform); |
| 82 | 97 |
| 83 int RemapPassId(int surface_local_pass_id, const SurfaceId& surface_id); | 98 int RemapPassId(int surface_local_pass_id, const SurfaceId& surface_id); |
| 84 | 99 |
| 85 void HandleSurfaceQuad(const SurfaceDrawQuad* surface_quad, | 100 void HandleSurfaceQuad(const SurfaceDrawQuad* surface_quad, |
| 86 const gfx::Transform& target_transform, | 101 const gfx::Transform& target_transform, |
| 87 const ClipData& clip_rect, | 102 const ClipData& clip_rect, |
| 88 RenderPass* dest_pass, | 103 RenderPass* dest_pass, |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 // The root damage rect of the currently-aggregating frame. | 201 // The root damage rect of the currently-aggregating frame. |
| 187 gfx::Rect root_damage_rect_; | 202 gfx::Rect root_damage_rect_; |
| 188 | 203 |
| 189 // 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. |
| 190 // This is valid during Aggregate after PrewalkTree is called. | 205 // This is valid during Aggregate after PrewalkTree is called. |
| 191 bool has_copy_requests_; | 206 bool has_copy_requests_; |
| 192 | 207 |
| 193 // Resource list for the aggregated frame. | 208 // Resource list for the aggregated frame. |
| 194 TransferableResourceArray* dest_resource_list_; | 209 TransferableResourceArray* dest_resource_list_; |
| 195 | 210 |
| 211 // Tracks UMA stats for SurfaceDrawQuads during a call to Aggregate(). |
| 212 SurfaceDrawQuadUmaStats uma_stats_; |
| 213 |
| 196 base::WeakPtrFactory<SurfaceAggregator> weak_factory_; | 214 base::WeakPtrFactory<SurfaceAggregator> weak_factory_; |
| 197 | 215 |
| 198 DISALLOW_COPY_AND_ASSIGN(SurfaceAggregator); | 216 DISALLOW_COPY_AND_ASSIGN(SurfaceAggregator); |
| 199 }; | 217 }; |
| 200 | 218 |
| 201 } // namespace cc | 219 } // namespace cc |
| 202 | 220 |
| 203 #endif // CC_SURFACES_SURFACE_AGGREGATOR_H_ | 221 #endif // CC_SURFACES_SURFACE_AGGREGATOR_H_ |
| OLD | NEW |