| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CC_SURFACES_SURFACE_AGGREGATOR_H_ |
| 6 #define CC_SURFACES_SURFACE_AGGREGATOR_H_ |
| 7 |
| 8 #include <set> |
| 9 |
| 10 #include "base/containers/scoped_ptr_hash_map.h" |
| 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "cc/quads/render_pass.h" |
| 13 #include "cc/surfaces/surfaces_export.h" |
| 14 |
| 15 namespace cc { |
| 16 |
| 17 class CompositorFrame; |
| 18 class DelegatedFrameData; |
| 19 class SurfaceDrawQuad; |
| 20 class SurfaceManager; |
| 21 |
| 22 class CC_SURFACES_EXPORT SurfaceAggregator { |
| 23 public: |
| 24 explicit SurfaceAggregator(SurfaceManager* manager); |
| 25 ~SurfaceAggregator(); |
| 26 |
| 27 scoped_ptr<CompositorFrame> Aggregate(int surface_id); |
| 28 |
| 29 private: |
| 30 DelegatedFrameData* GetReferencedDataForSurfaceID(int surface_id); |
| 31 RenderPass::Id RemapPassId(RenderPass::Id surface_local_pass_id, |
| 32 int surface_id); |
| 33 |
| 34 void HandleSurfaceQuad(const SurfaceDrawQuad* surface_quad, |
| 35 RenderPass* dest_pass); |
| 36 void CopyQuadsToPass(const QuadList& source_quad_list, |
| 37 const SharedQuadStateList& source_shared_quad_state_list, |
| 38 RenderPass* dest_pass, |
| 39 int surface_id); |
| 40 void CopyPasses(const RenderPassList& source_pass_list, int surface_id); |
| 41 |
| 42 SurfaceManager* manager_; |
| 43 |
| 44 class RenderPassIdAllocator; |
| 45 typedef base::ScopedPtrHashMap<int, RenderPassIdAllocator> |
| 46 RenderPassIdAllocatorMap; |
| 47 RenderPassIdAllocatorMap render_pass_allocator_map_; |
| 48 |
| 49 // The following state is only valid for the duration of one Aggregate call |
| 50 // and is only stored on the class to avoid having to pass through every |
| 51 // function call. |
| 52 |
| 53 // This is the set of surfaces referenced in the aggregation so far, used to |
| 54 // detect cycles. |
| 55 std::set<int> referenced_surfaces_; |
| 56 |
| 57 // This is the pass list for the aggregated frame. |
| 58 RenderPassList* dest_pass_list_; |
| 59 |
| 60 DISALLOW_COPY_AND_ASSIGN(SurfaceAggregator); |
| 61 }; |
| 62 |
| 63 } // namespace cc |
| 64 |
| 65 #endif // CC_SURFACES_SURFACE_AGGREGATOR_H_ |
| OLD | NEW |