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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 private: | 53 private: |
54 struct ClipData { | 54 struct ClipData { |
55 ClipData() : is_clipped(false) {} | 55 ClipData() : is_clipped(false) {} |
56 ClipData(bool is_clipped, const gfx::Rect& rect) | 56 ClipData(bool is_clipped, const gfx::Rect& rect) |
57 : is_clipped(is_clipped), rect(rect) {} | 57 : is_clipped(is_clipped), rect(rect) {} |
58 | 58 |
59 bool is_clipped; | 59 bool is_clipped; |
60 gfx::Rect rect; | 60 gfx::Rect rect; |
61 }; | 61 }; |
62 | 62 |
63 struct PrewalkResult { | |
64 PrewalkResult(); | |
65 ~PrewalkResult(); | |
66 bool has_copy_requests = false; | |
67 // This is the set of Surfaces that were referenced by another Surface, but | |
68 // not included in a SurfaceDrawQuad. | |
69 std::set<SurfaceId> undrawn_surfaces; | |
70 }; | |
71 | |
72 ClipData CalculateClipRect(const ClipData& surface_clip, | 63 ClipData CalculateClipRect(const ClipData& surface_clip, |
73 const ClipData& quad_clip, | 64 const ClipData& quad_clip, |
74 const gfx::Transform& target_transform); | 65 const gfx::Transform& target_transform); |
75 | 66 |
76 RenderPassId RemapPassId(RenderPassId surface_local_pass_id, | 67 RenderPassId RemapPassId(RenderPassId surface_local_pass_id, |
77 SurfaceId surface_id); | 68 SurfaceId surface_id); |
78 | 69 |
79 void HandleSurfaceQuad(const SurfaceDrawQuad* surface_quad, | 70 void HandleSurfaceQuad(const SurfaceDrawQuad* surface_quad, |
80 const gfx::Transform& target_transform, | 71 const gfx::Transform& target_transform, |
81 const ClipData& clip_rect, | 72 const ClipData& clip_rect, |
82 RenderPass* dest_pass); | 73 RenderPass* dest_pass); |
83 SharedQuadState* CopySharedQuadState(const SharedQuadState* source_sqs, | 74 SharedQuadState* CopySharedQuadState(const SharedQuadState* source_sqs, |
84 const gfx::Transform& target_transform, | 75 const gfx::Transform& target_transform, |
85 const ClipData& clip_rect, | 76 const ClipData& clip_rect, |
86 RenderPass* dest_render_pass); | 77 RenderPass* dest_render_pass); |
87 void CopyQuadsToPass( | 78 void CopyQuadsToPass( |
88 const QuadList& source_quad_list, | 79 const QuadList& source_quad_list, |
89 const SharedQuadStateList& source_shared_quad_state_list, | 80 const SharedQuadStateList& source_shared_quad_state_list, |
90 const base::hash_map<ResourceId, ResourceId>& resource_to_child_map, | 81 const base::hash_map<ResourceId, ResourceId>& resource_to_child_map, |
91 const gfx::Transform& target_transform, | 82 const gfx::Transform& target_transform, |
92 const ClipData& clip_rect, | 83 const ClipData& clip_rect, |
93 RenderPass* dest_pass, | 84 RenderPass* dest_pass, |
94 SurfaceId surface_id); | 85 SurfaceId surface_id); |
95 gfx::Rect PrewalkTree(SurfaceId surface_id, PrewalkResult* result); | 86 gfx::Rect PrewalkTree(SurfaceId surface_id); |
96 void CopyUndrawnSurfaces(PrewalkResult* prewalk); | |
97 void CopyPasses(const DelegatedFrameData* frame_data, Surface* surface); | 87 void CopyPasses(const DelegatedFrameData* frame_data, Surface* surface); |
98 | 88 |
99 // Remove Surfaces that were referenced before but aren't currently | 89 // Remove Surfaces that were referenced before but aren't currently |
100 // referenced from the ResourceProvider. | 90 // referenced from the ResourceProvider. |
101 // Also notifies SurfaceAggregatorClient of newly added and removed | 91 // Also notifies SurfaceAggregatorClient of newly added and removed |
102 // child surfaces. | 92 // child surfaces. |
103 void ProcessAddedAndRemovedSurfaces(); | 93 void ProcessAddedAndRemovedSurfaces(); |
104 | 94 |
105 int ChildIdForSurface(Surface* surface); | 95 int ChildIdForSurface(Surface* surface); |
106 gfx::Rect DamageRectForSurface(const Surface* surface, | 96 gfx::Rect DamageRectForSurface(const Surface* surface, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 140 |
151 // Resource list for the aggregated frame. | 141 // Resource list for the aggregated frame. |
152 TransferableResourceArray* dest_resource_list_; | 142 TransferableResourceArray* dest_resource_list_; |
153 | 143 |
154 DISALLOW_COPY_AND_ASSIGN(SurfaceAggregator); | 144 DISALLOW_COPY_AND_ASSIGN(SurfaceAggregator); |
155 }; | 145 }; |
156 | 146 |
157 } // namespace cc | 147 } // namespace cc |
158 | 148 |
159 #endif // CC_SURFACES_SURFACE_AGGREGATOR_H_ | 149 #endif // CC_SURFACES_SURFACE_AGGREGATOR_H_ |
OLD | NEW |