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 <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 #include <unordered_map> | 10 #include <unordered_map> |
(...skipping 24 matching lines...) Expand all Loading... |
35 ResourceProvider* provider, | 35 ResourceProvider* provider, |
36 bool aggregate_only_damaged); | 36 bool aggregate_only_damaged); |
37 ~SurfaceAggregator(); | 37 ~SurfaceAggregator(); |
38 | 38 |
39 std::unique_ptr<CompositorFrame> Aggregate(SurfaceId surface_id); | 39 std::unique_ptr<CompositorFrame> Aggregate(SurfaceId surface_id); |
40 void ReleaseResources(SurfaceId surface_id); | 40 void ReleaseResources(SurfaceId surface_id); |
41 SurfaceIndexMap& previous_contained_surfaces() { | 41 SurfaceIndexMap& previous_contained_surfaces() { |
42 return previous_contained_surfaces_; | 42 return previous_contained_surfaces_; |
43 } | 43 } |
44 void SetFullDamageForSurface(SurfaceId surface_id); | 44 void SetFullDamageForSurface(SurfaceId surface_id); |
| 45 void set_output_is_secure(bool secure) { output_is_secure_ = secure; } |
45 | 46 |
46 private: | 47 private: |
47 struct ClipData { | 48 struct ClipData { |
48 ClipData() : is_clipped(false) {} | 49 ClipData() : is_clipped(false) {} |
49 ClipData(bool is_clipped, const gfx::Rect& rect) | 50 ClipData(bool is_clipped, const gfx::Rect& rect) |
50 : is_clipped(is_clipped), rect(rect) {} | 51 : is_clipped(is_clipped), rect(rect) {} |
51 | 52 |
52 bool is_clipped; | 53 bool is_clipped; |
53 gfx::Rect rect; | 54 gfx::Rect rect; |
54 }; | 55 }; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 ResourceProvider* provider_; | 109 ResourceProvider* provider_; |
109 | 110 |
110 class RenderPassIdAllocator; | 111 class RenderPassIdAllocator; |
111 using RenderPassIdAllocatorMap = | 112 using RenderPassIdAllocatorMap = |
112 std::unordered_map<SurfaceId, | 113 std::unordered_map<SurfaceId, |
113 std::unique_ptr<RenderPassIdAllocator>, | 114 std::unique_ptr<RenderPassIdAllocator>, |
114 SurfaceIdHash>; | 115 SurfaceIdHash>; |
115 RenderPassIdAllocatorMap render_pass_allocator_map_; | 116 RenderPassIdAllocatorMap render_pass_allocator_map_; |
116 int next_render_pass_id_; | 117 int next_render_pass_id_; |
117 const bool aggregate_only_damaged_; | 118 const bool aggregate_only_damaged_; |
| 119 bool output_is_secure_; |
118 | 120 |
119 using SurfaceToResourceChildIdMap = | 121 using SurfaceToResourceChildIdMap = |
120 std::unordered_map<SurfaceId, int, SurfaceIdHash>; | 122 std::unordered_map<SurfaceId, int, SurfaceIdHash>; |
121 SurfaceToResourceChildIdMap surface_id_to_resource_child_id_; | 123 SurfaceToResourceChildIdMap surface_id_to_resource_child_id_; |
122 | 124 |
123 // The following state is only valid for the duration of one Aggregate call | 125 // The following state is only valid for the duration of one Aggregate call |
124 // and is only stored on the class to avoid having to pass through every | 126 // and is only stored on the class to avoid having to pass through every |
125 // function call. | 127 // function call. |
126 | 128 |
127 // This is the set of surfaces referenced in the aggregation so far, used to | 129 // This is the set of surfaces referenced in the aggregation so far, used to |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 TransferableResourceArray* dest_resource_list_; | 168 TransferableResourceArray* dest_resource_list_; |
167 | 169 |
168 base::WeakPtrFactory<SurfaceAggregator> weak_factory_; | 170 base::WeakPtrFactory<SurfaceAggregator> weak_factory_; |
169 | 171 |
170 DISALLOW_COPY_AND_ASSIGN(SurfaceAggregator); | 172 DISALLOW_COPY_AND_ASSIGN(SurfaceAggregator); |
171 }; | 173 }; |
172 | 174 |
173 } // namespace cc | 175 } // namespace cc |
174 | 176 |
175 #endif // CC_SURFACES_SURFACE_AGGREGATOR_H_ | 177 #endif // CC_SURFACES_SURFACE_AGGREGATOR_H_ |
OLD | NEW |