Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: cc/surfaces/surface_aggregator.h

Issue 2544203003: Delete old RenderPassId mappings in SurfaceAggregator. (Closed)
Patch Set: minor change Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <map>
8 #include <memory> 9 #include <memory>
9 #include <set> 10 #include <set>
10 #include <unordered_map> 11 #include <unordered_map>
11 #include <unordered_set> 12 #include <unordered_set>
12 13
13 #include "base/macros.h" 14 #include "base/macros.h"
14 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
15 #include "cc/quads/draw_quad.h" 16 #include "cc/quads/draw_quad.h"
16 #include "cc/quads/render_pass.h" 17 #include "cc/quads/render_pass.h"
17 #include "cc/resources/transferable_resource.h" 18 #include "cc/resources/transferable_resource.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 56
56 struct PrewalkResult { 57 struct PrewalkResult {
57 PrewalkResult(); 58 PrewalkResult();
58 ~PrewalkResult(); 59 ~PrewalkResult();
59 // This is the set of Surfaces that were referenced by another Surface, but 60 // This is the set of Surfaces that were referenced by another Surface, but
60 // not included in a SurfaceDrawQuad. 61 // not included in a SurfaceDrawQuad.
61 std::set<SurfaceId> undrawn_surfaces; 62 std::set<SurfaceId> undrawn_surfaces;
62 bool may_contain_video = false; 63 bool may_contain_video = false;
63 }; 64 };
64 65
66 struct RenderPassInfo {
67 RenderPassId id;
danakj 2016/12/02 21:55:16 This can use some comments. The key already has an
68 // This is true if the pass was used in the last aggregated frame.
69 bool in_use = true;
70 };
71
65 ClipData CalculateClipRect(const ClipData& surface_clip, 72 ClipData CalculateClipRect(const ClipData& surface_clip,
66 const ClipData& quad_clip, 73 const ClipData& quad_clip,
67 const gfx::Transform& target_transform); 74 const gfx::Transform& target_transform);
68 75
69 RenderPassId RemapPassId(RenderPassId surface_local_pass_id, 76 RenderPassId RemapPassId(RenderPassId surface_local_pass_id,
70 const SurfaceId& surface_id); 77 const SurfaceId& surface_id);
71 78
72 void HandleSurfaceQuad(const SurfaceDrawQuad* surface_quad, 79 void HandleSurfaceQuad(const SurfaceDrawQuad* surface_quad,
73 const gfx::Transform& target_transform, 80 const gfx::Transform& target_transform,
74 const ClipData& clip_rect, 81 const ClipData& clip_rect,
(...skipping 26 matching lines...) Expand all
101 void PropagateCopyRequestPasses(); 108 void PropagateCopyRequestPasses();
102 109
103 int ChildIdForSurface(Surface* surface); 110 int ChildIdForSurface(Surface* surface);
104 gfx::Rect DamageRectForSurface(const Surface* surface, 111 gfx::Rect DamageRectForSurface(const Surface* surface,
105 const RenderPass& source, 112 const RenderPass& source,
106 const gfx::Rect& full_rect) const; 113 const gfx::Rect& full_rect) const;
107 114
108 SurfaceManager* manager_; 115 SurfaceManager* manager_;
109 ResourceProvider* provider_; 116 ResourceProvider* provider_;
110 117
111 class RenderPassIdAllocator;
112 using RenderPassIdAllocatorMap = 118 using RenderPassIdAllocatorMap =
113 std::unordered_map<SurfaceId, 119 std::map<std::pair<SurfaceId, RenderPassId>, RenderPassInfo>;
danakj 2016/12/02 21:55:16 Same.. comments pls
114 std::unique_ptr<RenderPassIdAllocator>,
115 SurfaceIdHash>;
116 RenderPassIdAllocatorMap render_pass_allocator_map_; 120 RenderPassIdAllocatorMap render_pass_allocator_map_;
117 int next_render_pass_id_; 121 int next_render_pass_id_;
118 const bool aggregate_only_damaged_; 122 const bool aggregate_only_damaged_;
119 bool output_is_secure_; 123 bool output_is_secure_;
120 124
121 using SurfaceToResourceChildIdMap = 125 using SurfaceToResourceChildIdMap =
122 std::unordered_map<SurfaceId, int, SurfaceIdHash>; 126 std::unordered_map<SurfaceId, int, SurfaceIdHash>;
123 SurfaceToResourceChildIdMap surface_id_to_resource_child_id_; 127 SurfaceToResourceChildIdMap surface_id_to_resource_child_id_;
124 128
125 // The following state is only valid for the duration of one Aggregate call 129 // The following state is only valid for the duration of one Aggregate call
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 TransferableResourceArray* dest_resource_list_; 172 TransferableResourceArray* dest_resource_list_;
169 173
170 base::WeakPtrFactory<SurfaceAggregator> weak_factory_; 174 base::WeakPtrFactory<SurfaceAggregator> weak_factory_;
171 175
172 DISALLOW_COPY_AND_ASSIGN(SurfaceAggregator); 176 DISALLOW_COPY_AND_ASSIGN(SurfaceAggregator);
173 }; 177 };
174 178
175 } // namespace cc 179 } // namespace cc
176 180
177 #endif // CC_SURFACES_SURFACE_AGGREGATOR_H_ 181 #endif // CC_SURFACES_SURFACE_AGGREGATOR_H_
OLDNEW
« no previous file with comments | « no previous file | cc/surfaces/surface_aggregator.cc » ('j') | cc/surfaces/surface_aggregator_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698