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

Side by Side Diff: cc/resources/bitmap_tile_task_worker_pool.cc

Issue 943813002: cc: Add TaskGraphRunner sub-namespaces with task concurrency limits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 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/resources/bitmap_tile_task_worker_pool.h" 5 #include "cc/resources/bitmap_tile_task_worker_pool.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set) { 116 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set) {
117 if (!item.task_sets[task_set]) 117 if (!item.task_sets[task_set])
118 continue; 118 continue;
119 119
120 ++task_count[task_set]; 120 ++task_count[task_set];
121 121
122 graph_.edges.push_back( 122 graph_.edges.push_back(
123 TaskGraph::Edge(task, new_task_set_finished_tasks[task_set].get())); 123 TaskGraph::Edge(task, new_task_set_finished_tasks[task_set].get()));
124 } 124 }
125 125
126 InsertNodesForRasterTask(&graph_, task, task->dependencies(), priority++); 126 InsertNodesForRasterTask(&graph_, task, task->dependencies(), priority++,
127 kDefaultSubNamespace, kDefaultMaxConcurrentTasks);
127 } 128 }
128 129
129 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set) { 130 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set) {
130 InsertNodeForTask(&graph_, new_task_set_finished_tasks[task_set].get(), 131 InsertNodeForTask(&graph_, new_task_set_finished_tasks[task_set].get(),
131 kTaskSetFinishedTaskPriorityBase + task_set, 132 kTaskSetFinishedTaskPriorityBase + task_set,
132 task_count[task_set]); 133 task_count[task_set], kDefaultSubNamespace,
134 kDefaultMaxConcurrentTasks);
133 } 135 }
134 136
135 ScheduleTasksOnOriginThread(this, &graph_); 137 ScheduleTasksOnOriginThread(this, &graph_);
136 task_graph_runner_->ScheduleTasks(namespace_token_, &graph_); 138 task_graph_runner_->ScheduleTasks(namespace_token_, &graph_);
137 139
138 std::copy(new_task_set_finished_tasks, 140 std::copy(new_task_set_finished_tasks,
139 new_task_set_finished_tasks + kNumberOfTaskSets, 141 new_task_set_finished_tasks + kNumberOfTaskSets,
140 task_set_finished_tasks_); 142 task_set_finished_tasks_);
141 143
142 TRACE_EVENT_ASYNC_STEP_INTO1("cc", "ScheduledTasks", this, "running", "state", 144 TRACE_EVENT_ASYNC_STEP_INTO1("cc", "ScheduledTasks", this, "running", "state",
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 new base::trace_event::TracedValue(); 199 new base::trace_event::TracedValue();
198 200
199 state->BeginArray("tasks_pending"); 201 state->BeginArray("tasks_pending");
200 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set) 202 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set)
201 state->AppendBoolean(tasks_pending_[task_set]); 203 state->AppendBoolean(tasks_pending_[task_set]);
202 state->EndArray(); 204 state->EndArray();
203 return state; 205 return state;
204 } 206 }
205 207
206 } // namespace cc 208 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/resources/gpu_tile_task_worker_pool.h » ('j') | cc/resources/task_graph_runner.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698