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

Unified Diff: cc/raster/task_graph_runner_perftest.cc

Issue 1903733003: cc: Implement states for Task for stricter control. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@land_merge_tile_task_runner
Patch Set: feedback Created 4 years, 8 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/raster/task.cc ('k') | cc/raster/task_graph_work_queue.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « cc/raster/task.cc ('k') | cc/raster/task_graph_work_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698