| 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 <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 const ClipData& clip_rect, | 65 const ClipData& clip_rect, |
| 66 RenderPass* dest_render_pass); | 66 RenderPass* dest_render_pass); |
| 67 void CopyQuadsToPass( | 67 void CopyQuadsToPass( |
| 68 const QuadList& source_quad_list, | 68 const QuadList& source_quad_list, |
| 69 const SharedQuadStateList& source_shared_quad_state_list, | 69 const SharedQuadStateList& source_shared_quad_state_list, |
| 70 const base::hash_map<ResourceId, ResourceId>& resource_to_child_map, | 70 const base::hash_map<ResourceId, ResourceId>& resource_to_child_map, |
| 71 const gfx::Transform& target_transform, | 71 const gfx::Transform& target_transform, |
| 72 const ClipData& clip_rect, | 72 const ClipData& clip_rect, |
| 73 RenderPass* dest_pass, | 73 RenderPass* dest_pass, |
| 74 SurfaceId surface_id); | 74 SurfaceId surface_id); |
| 75 gfx::Rect ValidateAndCalculateDamageRect(SurfaceId surface_id); |
| 75 void CopyPasses(const DelegatedFrameData* frame_data, Surface* surface); | 76 void CopyPasses(const DelegatedFrameData* frame_data, Surface* surface); |
| 76 | 77 |
| 77 // Remove Surfaces that were referenced before but aren't currently | 78 // Remove Surfaces that were referenced before but aren't currently |
| 78 // referenced from the ResourceProvider. | 79 // referenced from the ResourceProvider. |
| 79 void RemoveUnreferencedChildren(); | 80 void RemoveUnreferencedChildren(); |
| 80 | 81 |
| 81 bool ValidateResources(Surface* surface, | |
| 82 const DelegatedFrameData* frame_data); | |
| 83 int ChildIdForSurface(Surface* surface); | 82 int ChildIdForSurface(Surface* surface); |
| 84 gfx::Rect DamageRectForSurface(const Surface* surface, | 83 gfx::Rect DamageRectForSurface(const Surface* surface, |
| 85 const RenderPass& source, | 84 const RenderPass& source, |
| 86 const gfx::Rect& full_rect); | 85 const gfx::Rect& full_rect); |
| 87 | 86 |
| 88 SurfaceManager* manager_; | 87 SurfaceManager* manager_; |
| 89 ResourceProvider* provider_; | 88 ResourceProvider* provider_; |
| 90 | 89 |
| 91 class RenderPassIdAllocator; | 90 class RenderPassIdAllocator; |
| 92 typedef base::ScopedPtrHashMap<SurfaceId, scoped_ptr<RenderPassIdAllocator>> | 91 typedef base::ScopedPtrHashMap<SurfaceId, scoped_ptr<RenderPassIdAllocator>> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 104 // This is the set of surfaces referenced in the aggregation so far, used to | 103 // This is the set of surfaces referenced in the aggregation so far, used to |
| 105 // detect cycles. | 104 // detect cycles. |
| 106 typedef std::set<SurfaceId> SurfaceSet; | 105 typedef std::set<SurfaceId> SurfaceSet; |
| 107 SurfaceSet referenced_surfaces_; | 106 SurfaceSet referenced_surfaces_; |
| 108 | 107 |
| 109 // For each Surface used in the last aggregation, gives the frame_index at | 108 // For each Surface used in the last aggregation, gives the frame_index at |
| 110 // that time. | 109 // that time. |
| 111 SurfaceIndexMap previous_contained_surfaces_; | 110 SurfaceIndexMap previous_contained_surfaces_; |
| 112 SurfaceIndexMap contained_surfaces_; | 111 SurfaceIndexMap contained_surfaces_; |
| 113 | 112 |
| 113 // After surface validation, every Surface in this set is valid. |
| 114 base::hash_set<SurfaceId> valid_surfaces_; |
| 115 |
| 114 // This is the pass list for the aggregated frame. | 116 // This is the pass list for the aggregated frame. |
| 115 RenderPassList* dest_pass_list_; | 117 RenderPassList* dest_pass_list_; |
| 116 | 118 |
| 117 // Resource list for the aggregated frame. | 119 // Resource list for the aggregated frame. |
| 118 TransferableResourceArray* dest_resource_list_; | 120 TransferableResourceArray* dest_resource_list_; |
| 119 | 121 |
| 120 DISALLOW_COPY_AND_ASSIGN(SurfaceAggregator); | 122 DISALLOW_COPY_AND_ASSIGN(SurfaceAggregator); |
| 121 }; | 123 }; |
| 122 | 124 |
| 123 } // namespace cc | 125 } // namespace cc |
| 124 | 126 |
| 125 #endif // CC_SURFACES_SURFACE_AGGREGATOR_H_ | 127 #endif // CC_SURFACES_SURFACE_AGGREGATOR_H_ |
| OLD | NEW |