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

Unified Diff: cc/surfaces/surface_aggregator.cc

Issue 1080243002: Avoid copying ChildToParentMap in SurfaceAggregator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@surfaceperftest
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_aggregator.cc
diff --git a/cc/surfaces/surface_aggregator.cc b/cc/surfaces/surface_aggregator.cc
index 4a7d9524f2532bcb2a419b116ec0a4034ed7fa1e..4b1df3e0f221629cb82f7298718aaffb7168e9c6 100644
--- a/cc/surfaces/surface_aggregator.cc
+++ b/cc/surfaces/surface_aggregator.cc
@@ -169,9 +169,10 @@ bool SurfaceAggregator::ValidateResources(
IdArray referenced_resources;
bool invalid_frame = false;
- DrawQuad::ResourceIteratorCallback remap = base::Bind(
- &ValidateResourceHelper, &invalid_frame,
- provider_->GetChildToParentMap(child_id), &referenced_resources);
+ DrawQuad::ResourceIteratorCallback remap =
+ base::Bind(&ValidateResourceHelper, &invalid_frame,
+ base::ConstRef(provider_->GetChildToParentMap(child_id)),
+ &referenced_resources);
for (const auto& render_pass : frame_data->render_pass_list) {
for (const auto& quad : render_pass->quad_list)
quad->IterateResources(remap);
@@ -234,8 +235,9 @@ void SurfaceAggregator::HandleSurfaceQuad(
DrawQuad::ResourceIteratorCallback remap;
if (provider_) {
int child_id = ChildIdForSurface(surface);
- remap = base::Bind(&ResourceRemapHelper,
- provider_->GetChildToParentMap(child_id));
+ remap =
+ base::Bind(&ResourceRemapHelper,
+ base::ConstRef(provider_->GetChildToParentMap(child_id)));
}
bool merge_pass = surface_quad->opacity() == 1.f && copy_requests.empty();
@@ -431,8 +433,9 @@ void SurfaceAggregator::CopyPasses(const DelegatedFrameData* frame_data,
DrawQuad::ResourceIteratorCallback remap;
if (provider_) {
int child_id = ChildIdForSurface(surface);
- remap = base::Bind(&ResourceRemapHelper,
- provider_->GetChildToParentMap(child_id));
+ remap =
+ base::Bind(&ResourceRemapHelper,
+ base::ConstRef(provider_->GetChildToParentMap(child_id)));
}
for (size_t i = 0; i < source_pass_list.size(); ++i) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698