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

Unified Diff: cc/resources/raster_worker_pool_perftest.cc

Issue 154003006: cc: Switch to vector based TaskGraph implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build fix Created 6 years, 10 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 | « cc/resources/raster_worker_pool.cc ('k') | cc/resources/task_graph_runner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/raster_worker_pool_perftest.cc
diff --git a/cc/resources/raster_worker_pool_perftest.cc b/cc/resources/raster_worker_pool_perftest.cc
index 6a170d593c10681f1415dfcdbf2a56ce33d25d71..274bfd0aa5e9c360bc4cd24c3701396da873ded9 100644
--- a/cc/resources/raster_worker_pool_perftest.cc
+++ b/cc/resources/raster_worker_pool_perftest.cc
@@ -79,40 +79,43 @@ class PerfRasterWorkerPool : public RasterWorkerPool {
}
void BuildTaskGraph() {
- unsigned priority = 0;
- TaskGraph graph;
+ unsigned priority = 2u;
+ internal::TaskGraph graph;
scoped_refptr<internal::WorkerPoolTask>
raster_required_for_activation_finished_task(
CreateRasterRequiredForActivationFinishedTask(
raster_tasks_required_for_activation().size()));
- internal::GraphNode* raster_required_for_activation_finished_node =
- CreateGraphNodeForTask(
- raster_required_for_activation_finished_task.get(),
- priority++,
- &graph);
-
scoped_refptr<internal::WorkerPoolTask> raster_finished_task(
CreateRasterFinishedTask());
- internal::GraphNode* raster_finished_node =
- CreateGraphNodeForTask(raster_finished_task.get(), priority++, &graph);
+
+ size_t raster_required_for_activation_finished_dependencies = 0u;
+ size_t raster_finished_dependencies = 0u;
for (RasterTaskVector::const_iterator it = raster_tasks().begin();
it != raster_tasks().end();
++it) {
internal::RasterWorkerPoolTask* task = it->get();
- internal::GraphNode* node = CreateGraphNodeForRasterTask(
- task, task->dependencies(), priority++, &graph);
-
if (IsRasterTaskRequiredForActivation(task)) {
- raster_required_for_activation_finished_node->add_dependency();
- node->add_dependent(raster_required_for_activation_finished_node);
+ raster_required_for_activation_finished_dependencies++;
+ graph.edges.push_back(internal::TaskGraph::Edge(
+ task, raster_required_for_activation_finished_task.get()));
}
- raster_finished_node->add_dependency();
- node->add_dependent(raster_finished_node);
+ InsertNodeForRasterTask(&graph, task, task->dependencies(), priority++);
+
+ raster_finished_dependencies++;
+ graph.edges.push_back(
+ internal::TaskGraph::Edge(task, raster_finished_task.get()));
}
+
+ InsertNodeForTask(&graph,
+ raster_required_for_activation_finished_task.get(),
+ 0u,
+ raster_required_for_activation_finished_dependencies);
+ InsertNodeForTask(
+ &graph, raster_finished_task.get(), 1u, raster_finished_dependencies);
}
private:
« no previous file with comments | « cc/resources/raster_worker_pool.cc ('k') | cc/resources/task_graph_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698