Index: cc/raster/task_graph_runner_perftest.cc |
diff --git a/cc/raster/task_graph_runner_perftest.cc b/cc/raster/task_graph_runner_perftest.cc |
index 56540f1c41f1ff90aa4deafa6b41d48503730b44..a825f1b373ab7fd3d33d318462f0911857041908 100644 |
--- a/cc/raster/task_graph_runner_perftest.cc |
+++ b/cc/raster/task_graph_runner_perftest.cc |
@@ -33,7 +33,7 @@ class PerfTaskImpl : public Task { |
// Overridden from Task: |
void RunOnWorkerThread() override {} |
- void Reset() { did_run_ = false; } |
+ void Reset() { state().Reset(); } |
private: |
~PerfTaskImpl() override {} |
@@ -145,11 +145,15 @@ class TaskGraphRunnerPerfTest : public testing::Test { |
size_t count = 0; |
timer_.Reset(); |
do { |
+ size_t current_version = count % kNumVersions; |
graph.Reset(); |
- BuildTaskGraph(top_level_tasks[count % kNumVersions], |
- tasks[count % kNumVersions], |
- leaf_tasks[count % kNumVersions], |
- &graph); |
+ // Reset tasks as we are not letting them execute, they get cancelled |
+ // when next ScheduleTasks() happens. |
+ ResetTasks(&top_level_tasks[current_version]); |
+ ResetTasks(&tasks[current_version]); |
+ ResetTasks(&leaf_tasks[current_version]); |
+ BuildTaskGraph(top_level_tasks[current_version], tasks[current_version], |
+ leaf_tasks[current_version], &graph); |
task_graph_runner_->ScheduleTasks(namespace_token_, &graph); |
CollectCompletedTasks(&completed_tasks); |
completed_tasks.clear(); |