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

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

Issue 822713002: Update from https://crrev.com/309415 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 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 #include "cc/surfaces/surface_aggregator.h" 5 #include "cc/surfaces/surface_aggregator.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 } 146 }
147 147
148 bool SurfaceAggregator::TakeResources(Surface* surface, 148 bool SurfaceAggregator::TakeResources(Surface* surface,
149 const DelegatedFrameData* frame_data, 149 const DelegatedFrameData* frame_data,
150 RenderPassList* render_pass_list) { 150 RenderPassList* render_pass_list) {
151 RenderPass::CopyAll(frame_data->render_pass_list, render_pass_list); 151 RenderPass::CopyAll(frame_data->render_pass_list, render_pass_list);
152 if (!provider_) // TODO(jamesr): hack for unit tests that don't set up rp 152 if (!provider_) // TODO(jamesr): hack for unit tests that don't set up rp
153 return false; 153 return false;
154 154
155 int child_id = ChildIdForSurface(surface); 155 int child_id = ChildIdForSurface(surface);
156 provider_->ReceiveFromChild(child_id, frame_data->resource_list);
157 if (surface->factory()) 156 if (surface->factory())
158 surface->factory()->RefResources(frame_data->resource_list); 157 surface->factory()->RefResources(frame_data->resource_list);
158 provider_->ReceiveFromChild(child_id, frame_data->resource_list);
159 159
160 typedef ResourceProvider::ResourceIdArray IdArray; 160 typedef ResourceProvider::ResourceIdArray IdArray;
161 IdArray referenced_resources; 161 IdArray referenced_resources;
162 162
163 bool invalid_frame = false; 163 bool invalid_frame = false;
164 DrawQuad::ResourceIteratorCallback remap = 164 DrawQuad::ResourceIteratorCallback remap =
165 base::Bind(&ResourceRemapHelper, 165 base::Bind(&ResourceRemapHelper,
166 &invalid_frame, 166 &invalid_frame,
167 provider_->GetChildToParentMap(child_id), 167 provider_->GetChildToParentMap(child_id),
168 &referenced_resources); 168 &referenced_resources);
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 void SurfaceAggregator::ReleaseResources(SurfaceId surface_id) { 486 void SurfaceAggregator::ReleaseResources(SurfaceId surface_id) {
487 SurfaceToResourceChildIdMap::iterator it = 487 SurfaceToResourceChildIdMap::iterator it =
488 surface_id_to_resource_child_id_.find(surface_id); 488 surface_id_to_resource_child_id_.find(surface_id);
489 if (it != surface_id_to_resource_child_id_.end()) { 489 if (it != surface_id_to_resource_child_id_.end()) {
490 provider_->DestroyChild(it->second); 490 provider_->DestroyChild(it->second);
491 surface_id_to_resource_child_id_.erase(it); 491 surface_id_to_resource_child_id_.erase(it);
492 } 492 }
493 } 493 }
494 494
495 } // namespace cc 495 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698