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

Side by Side Diff: cc/raster/task_graph_runner_perftest.cc

Issue 1521423003: Revert of TaskGraphRunner Group support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor
Patch Set: Created 5 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
« no previous file with comments | « cc/raster/task_graph_runner.h ('k') | cc/raster/task_graph_work_queue.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <vector> 5 #include <vector>
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "cc/base/completion_event.h" 9 #include "cc/base/completion_event.h"
10 #include "cc/debug/lap_timer.h" 10 #include "cc/debug/lap_timer.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 void BuildTaskGraph(const PerfTaskImpl::Vector& top_level_tasks, 223 void BuildTaskGraph(const PerfTaskImpl::Vector& top_level_tasks,
224 const PerfTaskImpl::Vector& tasks, 224 const PerfTaskImpl::Vector& tasks,
225 const PerfTaskImpl::Vector& leaf_tasks, 225 const PerfTaskImpl::Vector& leaf_tasks,
226 TaskGraph* graph) { 226 TaskGraph* graph) {
227 DCHECK(graph->nodes.empty()); 227 DCHECK(graph->nodes.empty());
228 DCHECK(graph->edges.empty()); 228 DCHECK(graph->edges.empty());
229 229
230 for (PerfTaskImpl::Vector::const_iterator it = leaf_tasks.begin(); 230 for (PerfTaskImpl::Vector::const_iterator it = leaf_tasks.begin();
231 it != leaf_tasks.end(); 231 it != leaf_tasks.end();
232 ++it) { 232 ++it) {
233 graph->nodes.push_back(TaskGraph::Node(it->get(), 0u, 0u, 0u)); 233 graph->nodes.push_back(TaskGraph::Node(it->get(), 0u, 0u));
234 } 234 }
235 235
236 for (PerfTaskImpl::Vector::const_iterator it = tasks.begin(); 236 for (PerfTaskImpl::Vector::const_iterator it = tasks.begin();
237 it != tasks.end(); ++it) { 237 it != tasks.end();
238 graph->nodes.push_back( 238 ++it) {
239 TaskGraph::Node(it->get(), 0u, 0u, leaf_tasks.size())); 239 graph->nodes.push_back(TaskGraph::Node(it->get(), 0u, leaf_tasks.size()));
240 240
241 for (PerfTaskImpl::Vector::const_iterator leaf_it = leaf_tasks.begin(); 241 for (PerfTaskImpl::Vector::const_iterator leaf_it = leaf_tasks.begin();
242 leaf_it != leaf_tasks.end(); 242 leaf_it != leaf_tasks.end();
243 ++leaf_it) { 243 ++leaf_it) {
244 graph->edges.push_back(TaskGraph::Edge(leaf_it->get(), it->get())); 244 graph->edges.push_back(TaskGraph::Edge(leaf_it->get(), it->get()));
245 } 245 }
246 246
247 for (PerfTaskImpl::Vector::const_iterator top_level_it = 247 for (PerfTaskImpl::Vector::const_iterator top_level_it =
248 top_level_tasks.begin(); 248 top_level_tasks.begin();
249 top_level_it != top_level_tasks.end(); 249 top_level_it != top_level_tasks.end();
250 ++top_level_it) { 250 ++top_level_it) {
251 graph->edges.push_back(TaskGraph::Edge(it->get(), top_level_it->get())); 251 graph->edges.push_back(TaskGraph::Edge(it->get(), top_level_it->get()));
252 } 252 }
253 } 253 }
254 254
255 for (PerfTaskImpl::Vector::const_iterator it = top_level_tasks.begin(); 255 for (PerfTaskImpl::Vector::const_iterator it = top_level_tasks.begin();
256 it != top_level_tasks.end(); 256 it != top_level_tasks.end();
257 ++it) { 257 ++it) {
258 graph->nodes.push_back(TaskGraph::Node(it->get(), 0u, 0u, tasks.size())); 258 graph->nodes.push_back(TaskGraph::Node(it->get(), 0u, tasks.size()));
259 } 259 }
260 } 260 }
261 261
262 size_t CollectCompletedTasks(Task::Vector* completed_tasks) { 262 size_t CollectCompletedTasks(Task::Vector* completed_tasks) {
263 DCHECK(completed_tasks->empty()); 263 DCHECK(completed_tasks->empty());
264 task_graph_runner_->CollectCompletedTasks(namespace_token_, 264 task_graph_runner_->CollectCompletedTasks(namespace_token_,
265 completed_tasks); 265 completed_tasks);
266 return completed_tasks->size(); 266 return completed_tasks->size();
267 } 267 }
268 268
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 RunScheduleAndExecuteTasksTest("0_1_0", 0, 1, 0); 304 RunScheduleAndExecuteTasksTest("0_1_0", 0, 1, 0);
305 RunScheduleAndExecuteTasksTest("0_32_0", 0, 32, 0); 305 RunScheduleAndExecuteTasksTest("0_32_0", 0, 32, 0);
306 RunScheduleAndExecuteTasksTest("2_1_0", 2, 1, 0); 306 RunScheduleAndExecuteTasksTest("2_1_0", 2, 1, 0);
307 RunScheduleAndExecuteTasksTest("2_32_0", 2, 32, 0); 307 RunScheduleAndExecuteTasksTest("2_32_0", 2, 32, 0);
308 RunScheduleAndExecuteTasksTest("2_1_1", 2, 1, 1); 308 RunScheduleAndExecuteTasksTest("2_1_1", 2, 1, 1);
309 RunScheduleAndExecuteTasksTest("2_32_1", 2, 32, 1); 309 RunScheduleAndExecuteTasksTest("2_32_1", 2, 32, 1);
310 } 310 }
311 311
312 } // namespace 312 } // namespace
313 } // namespace cc 313 } // namespace cc
OLDNEW
« no previous file with comments | « cc/raster/task_graph_runner.h ('k') | cc/raster/task_graph_work_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698