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

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

Issue 2873593002: Force use of and cache render surface. (Closed)
Patch Set: Fix for patch 1. Created 3 years, 7 months 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 <memory> 8 #include <memory>
9 #include <unordered_map> 9 #include <unordered_map>
10 10
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 void CopyUndrawnSurfaces(PrewalkResult* prewalk); 123 void CopyUndrawnSurfaces(PrewalkResult* prewalk);
124 void CopyPasses(const CompositorFrame& frame, Surface* surface); 124 void CopyPasses(const CompositorFrame& frame, Surface* surface);
125 void AddColorConversionPass(); 125 void AddColorConversionPass();
126 126
127 // Remove Surfaces that were referenced before but aren't currently 127 // Remove Surfaces that were referenced before but aren't currently
128 // referenced from the ResourceProvider. 128 // referenced from the ResourceProvider.
129 // Also notifies SurfaceAggregatorClient of newly added and removed 129 // Also notifies SurfaceAggregatorClient of newly added and removed
130 // child surfaces. 130 // child surfaces.
131 void ProcessAddedAndRemovedSurfaces(); 131 void ProcessAddedAndRemovedSurfaces();
132 132
133 void PropagateCopyRequestPasses(); 133 void PropagatePasses(base::flat_set<int>* passes);
134 134
135 int ChildIdForSurface(Surface* surface); 135 int ChildIdForSurface(Surface* surface);
136 gfx::Rect DamageRectForSurface(const Surface* surface, 136 gfx::Rect DamageRectForSurface(const Surface* surface,
137 const RenderPass& source, 137 const RenderPass& source,
138 const gfx::Rect& full_rect) const; 138 const gfx::Rect& full_rect) const;
139 139
140 SurfaceManager* manager_; 140 SurfaceManager* manager_;
141 ResourceProvider* provider_; 141 ResourceProvider* provider_;
142 142
143 // Every Surface has its own RenderPass ID namespace. This structure maps 143 // Every Surface has its own RenderPass ID namespace. This structure maps
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 RenderPassList* dest_pass_list_; 182 RenderPassList* dest_pass_list_;
183 183
184 // This is the set of aggregated pass ids that are affected by filters that 184 // This is the set of aggregated pass ids that are affected by filters that
185 // move pixels. 185 // move pixels.
186 base::flat_set<int> moved_pixel_passes_; 186 base::flat_set<int> moved_pixel_passes_;
187 187
188 // This is the set of aggregated pass ids that are drawn by copy requests, so 188 // This is the set of aggregated pass ids that are drawn by copy requests, so
189 // should not have their damage rects clipped to the root damage rect. 189 // should not have their damage rects clipped to the root damage rect.
190 base::flat_set<int> copy_request_passes_; 190 base::flat_set<int> copy_request_passes_;
191 191
192 // This is the set of aggregated pass ids that are drawn by force render
193 // surface, so should not have their damage rects clipped to the root damage
194 // rect.
195 base::flat_set<int> force_render_surface_passes_;
196
192 // This maps each aggregated pass id to the set of (aggregated) pass ids 197 // This maps each aggregated pass id to the set of (aggregated) pass ids
193 // that its RenderPassDrawQuads depend on 198 // that its RenderPassDrawQuads depend on
194 base::flat_map<int, base::flat_set<int>> render_pass_dependencies_; 199 base::flat_map<int, base::flat_set<int>> render_pass_dependencies_;
195 200
196 // The root damage rect of the currently-aggregating frame. 201 // The root damage rect of the currently-aggregating frame.
197 gfx::Rect root_damage_rect_; 202 gfx::Rect root_damage_rect_;
198 203
199 // True if the frame that's currently being aggregated has copy requests. 204 // True if the frame that's currently being aggregated has copy requests.
200 // This is valid during Aggregate after PrewalkTree is called. 205 // This is valid during Aggregate after PrewalkTree is called.
201 bool has_copy_requests_; 206 bool has_copy_requests_;
202 207
208 // True if the frame that's currently being aggregated has force render
209 // surface. This is valid during Aggregate after PrewalkTree is called.
210 bool has_force_render_surfaces_;
211
203 // Tracks UMA stats for SurfaceDrawQuads during a call to Aggregate(). 212 // Tracks UMA stats for SurfaceDrawQuads during a call to Aggregate().
204 SurfaceDrawQuadUmaStats uma_stats_; 213 SurfaceDrawQuadUmaStats uma_stats_;
205 214
206 base::WeakPtrFactory<SurfaceAggregator> weak_factory_; 215 base::WeakPtrFactory<SurfaceAggregator> weak_factory_;
207 216
208 DISALLOW_COPY_AND_ASSIGN(SurfaceAggregator); 217 DISALLOW_COPY_AND_ASSIGN(SurfaceAggregator);
209 }; 218 };
210 219
211 } // namespace cc 220 } // namespace cc
212 221
213 #endif // CC_SURFACES_SURFACE_AGGREGATOR_H_ 222 #endif // CC_SURFACES_SURFACE_AGGREGATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698