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 <unordered_map> | 9 #include <unordered_map> |
10 | 10 |
11 #include "base/containers/flat_map.h" | 11 #include "base/containers/flat_map.h" |
12 #include "base/containers/flat_set.h" | 12 #include "base/containers/flat_set.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "cc/quads/draw_quad.h" | 15 #include "cc/quads/draw_quad.h" |
16 #include "cc/quads/render_pass.h" | 16 #include "cc/quads/render_pass.h" |
17 #include "cc/resources/transferable_resource.h" | 17 #include "cc/resources/transferable_resource.h" |
18 #include "cc/surfaces/surface_id.h" | 18 #include "cc/surfaces/surface_id.h" |
19 #include "cc/surfaces/surfaces_export.h" | 19 #include "cc/surfaces/surfaces_export.h" |
20 #include "ui/gfx/color_space.h" | 20 #include "ui/gfx/color_space.h" |
21 | 21 |
22 namespace cc { | 22 namespace cc { |
23 | 23 |
| 24 class BlockingTaskRunner; |
24 class CompositorFrame; | 25 class CompositorFrame; |
| 26 class CompositorFrameSinkSupport; |
25 class ResourceProvider; | 27 class ResourceProvider; |
26 class Surface; | 28 class Surface; |
27 class SurfaceDrawQuad; | 29 class SurfaceDrawQuad; |
28 class SurfaceManager; | 30 class SurfaceManager; |
29 | 31 |
30 class CC_SURFACES_EXPORT SurfaceAggregator { | 32 class CC_SURFACES_EXPORT SurfaceAggregator { |
31 public: | 33 public: |
32 using SurfaceIndexMap = base::flat_map<SurfaceId, int>; | 34 using SurfaceIndexMap = base::flat_map<SurfaceId, int>; |
33 | 35 |
34 SurfaceAggregator(SurfaceManager* manager, | 36 SurfaceAggregator(SurfaceManager* manager, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 } | 85 } |
84 | 86 |
85 // The surface exists and has an active frame. | 87 // The surface exists and has an active frame. |
86 int valid_surface; | 88 int valid_surface; |
87 // The surface doesn't exist. | 89 // The surface doesn't exist. |
88 int missing_surface; | 90 int missing_surface; |
89 // The surface exists but doesn't have an active frame. | 91 // The surface exists but doesn't have an active frame. |
90 int no_active_frame; | 92 int no_active_frame; |
91 }; | 93 }; |
92 | 94 |
| 95 static void UnrefHelper( |
| 96 base::WeakPtr<CompositorFrameSinkSupport> compositor_frame_sink_support, |
| 97 const ReturnedResourceArray& resources, |
| 98 BlockingTaskRunner* main_thread_task_runner); |
| 99 |
93 ClipData CalculateClipRect(const ClipData& surface_clip, | 100 ClipData CalculateClipRect(const ClipData& surface_clip, |
94 const ClipData& quad_clip, | 101 const ClipData& quad_clip, |
95 const gfx::Transform& target_transform); | 102 const gfx::Transform& target_transform); |
96 | 103 |
97 int RemapPassId(int surface_local_pass_id, const SurfaceId& surface_id); | 104 int RemapPassId(int surface_local_pass_id, const SurfaceId& surface_id); |
98 | 105 |
99 void HandleSurfaceQuad(const SurfaceDrawQuad* surface_quad, | 106 void HandleSurfaceQuad(const SurfaceDrawQuad* surface_quad, |
100 const gfx::Transform& target_transform, | 107 const gfx::Transform& target_transform, |
101 const ClipData& clip_rect, | 108 const ClipData& clip_rect, |
102 RenderPass* dest_pass, | 109 RenderPass* dest_pass, |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 SurfaceDrawQuadUmaStats uma_stats_; | 214 SurfaceDrawQuadUmaStats uma_stats_; |
208 | 215 |
209 base::WeakPtrFactory<SurfaceAggregator> weak_factory_; | 216 base::WeakPtrFactory<SurfaceAggregator> weak_factory_; |
210 | 217 |
211 DISALLOW_COPY_AND_ASSIGN(SurfaceAggregator); | 218 DISALLOW_COPY_AND_ASSIGN(SurfaceAggregator); |
212 }; | 219 }; |
213 | 220 |
214 } // namespace cc | 221 } // namespace cc |
215 | 222 |
216 #endif // CC_SURFACES_SURFACE_AGGREGATOR_H_ | 223 #endif // CC_SURFACES_SURFACE_AGGREGATOR_H_ |
OLD | NEW |