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 20 matching lines...) Expand all Loading... |
31 SurfaceAggregator(SurfaceManager* manager, ResourceProvider* provider); | 31 SurfaceAggregator(SurfaceManager* manager, ResourceProvider* provider); |
32 ~SurfaceAggregator(); | 32 ~SurfaceAggregator(); |
33 | 33 |
34 scoped_ptr<CompositorFrame> Aggregate(SurfaceId surface_id); | 34 scoped_ptr<CompositorFrame> Aggregate(SurfaceId surface_id); |
35 void ReleaseResources(SurfaceId surface_id); | 35 void ReleaseResources(SurfaceId surface_id); |
36 SurfaceIndexMap& previous_contained_surfaces() { | 36 SurfaceIndexMap& previous_contained_surfaces() { |
37 return previous_contained_surfaces_; | 37 return previous_contained_surfaces_; |
38 } | 38 } |
39 | 39 |
40 private: | 40 private: |
| 41 struct ClipData { |
| 42 ClipData() : is_clipped(false) {} |
| 43 ClipData(bool is_clipped, const gfx::Rect& rect) |
| 44 : is_clipped(is_clipped), rect(rect) {} |
| 45 |
| 46 bool is_clipped; |
| 47 gfx::Rect rect; |
| 48 }; |
| 49 |
| 50 ClipData CalculateClipRect(const ClipData& surface_clip, |
| 51 const ClipData& quad_clip, |
| 52 const gfx::Transform& content_to_target_transform); |
| 53 |
41 RenderPassId RemapPassId(RenderPassId surface_local_pass_id, | 54 RenderPassId RemapPassId(RenderPassId surface_local_pass_id, |
42 SurfaceId surface_id); | 55 SurfaceId surface_id); |
43 | 56 |
44 void HandleSurfaceQuad(const SurfaceDrawQuad* surface_quad, | 57 void HandleSurfaceQuad(const SurfaceDrawQuad* surface_quad, |
45 float opacity, | 58 const gfx::Transform& content_to_target_transform, |
| 59 const ClipData& clip_rect, |
46 RenderPass* dest_pass); | 60 RenderPass* dest_pass); |
47 void CopySharedQuadState(const SharedQuadState* source_sqs, | 61 void CopySharedQuadState(const SharedQuadState* source_sqs, |
48 const gfx::Transform& content_to_target_transform, | 62 const gfx::Transform& content_to_target_transform, |
| 63 const ClipData& clip_rect, |
49 RenderPass* dest_render_pass); | 64 RenderPass* dest_render_pass); |
50 void CopyQuadsToPass(const QuadList& source_quad_list, | 65 void CopyQuadsToPass(const QuadList& source_quad_list, |
51 const SharedQuadStateList& source_shared_quad_state_list, | 66 const SharedQuadStateList& source_shared_quad_state_list, |
52 const gfx::Transform& content_to_target_transform, | 67 const gfx::Transform& content_to_target_transform, |
53 float opacity, | 68 const ClipData& clip_rect, |
54 RenderPass* dest_pass, | 69 RenderPass* dest_pass, |
55 SurfaceId surface_id); | 70 SurfaceId surface_id); |
56 void CopyPasses(const DelegatedFrameData* frame_data, Surface* surface); | 71 void CopyPasses(const DelegatedFrameData* frame_data, Surface* surface); |
57 | 72 |
58 // Remove Surfaces that were referenced before but aren't currently | 73 // Remove Surfaces that were referenced before but aren't currently |
59 // referenced from the ResourceProvider. | 74 // referenced from the ResourceProvider. |
60 void RemoveUnreferencedChildren(); | 75 void RemoveUnreferencedChildren(); |
61 | 76 |
62 bool TakeResources(Surface* surface, | 77 bool TakeResources(Surface* surface, |
63 const DelegatedFrameData* frame_data, | 78 const DelegatedFrameData* frame_data, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 113 |
99 // Resource list for the aggregated frame. | 114 // Resource list for the aggregated frame. |
100 TransferableResourceArray* dest_resource_list_; | 115 TransferableResourceArray* dest_resource_list_; |
101 | 116 |
102 DISALLOW_COPY_AND_ASSIGN(SurfaceAggregator); | 117 DISALLOW_COPY_AND_ASSIGN(SurfaceAggregator); |
103 }; | 118 }; |
104 | 119 |
105 } // namespace cc | 120 } // namespace cc |
106 | 121 |
107 #endif // CC_SURFACES_SURFACE_AGGREGATOR_H_ | 122 #endif // CC_SURFACES_SURFACE_AGGREGATOR_H_ |
OLD | NEW |