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

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

Issue 448303002: Use custom ListContainer to allocate DrawQuads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@perftest
Patch Set: fix rebase Created 6 years, 3 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 #include "cc/surfaces/surface_aggregator.h" 5 #include "cc/surfaces/surface_aggregator.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/containers/hash_tables.h" 8 #include "base/containers/hash_tables.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 bool invalid_frame = false; 113 bool invalid_frame = false;
114 DrawQuad::ResourceIteratorCallback remap = 114 DrawQuad::ResourceIteratorCallback remap =
115 base::Bind(&ResourceRemapHelper, 115 base::Bind(&ResourceRemapHelper,
116 &invalid_frame, 116 &invalid_frame,
117 provider_->GetChildToParentMap(child_id), 117 provider_->GetChildToParentMap(child_id),
118 &referenced_resources); 118 &referenced_resources);
119 for (RenderPassList::iterator it = render_pass_list->begin(); 119 for (RenderPassList::iterator it = render_pass_list->begin();
120 it != render_pass_list->end(); 120 it != render_pass_list->end();
121 ++it) { 121 ++it) {
122 QuadList& quad_list = (*it)->quad_list; 122 QuadList& quad_list = (*it)->quad_list;
123 for (QuadList::iterator quad_it = quad_list.begin(); 123 for (QuadList::Iterator quad_it = quad_list.begin();
124 quad_it != quad_list.end(); 124 quad_it != quad_list.end();
125 ++quad_it) { 125 ++quad_it) {
126 (*quad_it)->IterateResources(remap); 126 quad_it->IterateResources(remap);
127 } 127 }
128 } 128 }
129 if (!invalid_frame) 129 if (!invalid_frame)
130 provider_->DeclareUsedResourcesFromChild(child_id, referenced_resources); 130 provider_->DeclareUsedResourcesFromChild(child_id, referenced_resources);
131 131
132 return invalid_frame; 132 return invalid_frame;
133 } 133 }
134 134
135 gfx::Rect SurfaceAggregator::DamageRectForSurface(const Surface* surface, 135 gfx::Rect SurfaceAggregator::DamageRectForSurface(const Surface* surface,
136 const RenderPass& source) { 136 const RenderPass& source) {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 } 241 }
242 242
243 void SurfaceAggregator::CopyQuadsToPass( 243 void SurfaceAggregator::CopyQuadsToPass(
244 const QuadList& source_quad_list, 244 const QuadList& source_quad_list,
245 const SharedQuadStateList& source_shared_quad_state_list, 245 const SharedQuadStateList& source_shared_quad_state_list,
246 const gfx::Transform& content_to_target_transform, 246 const gfx::Transform& content_to_target_transform,
247 RenderPass* dest_pass, 247 RenderPass* dest_pass,
248 SurfaceId surface_id) { 248 SurfaceId surface_id) {
249 const SharedQuadState* last_copied_source_shared_quad_state = NULL; 249 const SharedQuadState* last_copied_source_shared_quad_state = NULL;
250 250
251 for (size_t i = 0, sqs_i = 0; i < source_quad_list.size(); ++i) { 251 size_t sqs_i = 0;
252 DrawQuad* quad = source_quad_list[i]; 252 for (QuadList::ConstIterator iter = source_quad_list.begin();
253 iter != source_quad_list.end();
254 ++iter) {
255 const DrawQuad* quad = &*iter;
253 while (quad->shared_quad_state != source_shared_quad_state_list[sqs_i]) { 256 while (quad->shared_quad_state != source_shared_quad_state_list[sqs_i]) {
254 ++sqs_i; 257 ++sqs_i;
255 DCHECK_LT(sqs_i, source_shared_quad_state_list.size()); 258 DCHECK_LT(sqs_i, source_shared_quad_state_list.size());
256 } 259 }
257 DCHECK_EQ(quad->shared_quad_state, source_shared_quad_state_list[sqs_i]); 260 DCHECK_EQ(quad->shared_quad_state, source_shared_quad_state_list[sqs_i]);
258 261
259 if (quad->material == DrawQuad::SURFACE_CONTENT) { 262 if (quad->material == DrawQuad::SURFACE_CONTENT) {
260 const SurfaceDrawQuad* surface_quad = SurfaceDrawQuad::MaterialCast(quad); 263 const SurfaceDrawQuad* surface_quad = SurfaceDrawQuad::MaterialCast(quad);
261 HandleSurfaceQuad(surface_quad, dest_pass); 264 HandleSurfaceQuad(surface_quad, dest_pass);
262 } else { 265 } else {
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 surface->TakeLatencyInfo(&frame->metadata.latency_info); 357 surface->TakeLatencyInfo(&frame->metadata.latency_info);
355 } 358 }
356 359
357 // TODO(jamesr): Aggregate all resource references into the returned frame's 360 // TODO(jamesr): Aggregate all resource references into the returned frame's
358 // resource list. 361 // resource list.
359 362
360 return frame.Pass(); 363 return frame.Pass();
361 } 364 }
362 365
363 } // namespace cc 366 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698