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

Side by Side Diff: cc/resources/one_copy_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/one_copy_tile_task_worker_pool.h" 5 #include "cc/resources/one_copy_tile_task_worker_pool.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set) { 209 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set) {
210 if (!item.task_sets[task_set]) 210 if (!item.task_sets[task_set])
211 continue; 211 continue;
212 212
213 ++task_count[task_set]; 213 ++task_count[task_set];
214 214
215 graph_.edges.push_back( 215 graph_.edges.push_back(
216 TaskGraph::Edge(task, new_task_set_finished_tasks[task_set].get())); 216 TaskGraph::Edge(task, new_task_set_finished_tasks[task_set].get()));
217 } 217 }
218 218
219 InsertNodesForRasterTask(&graph_, task, task->dependencies(), priority++); 219 InsertNodesForRasterTask(&graph_, task, task->dependencies(), priority++,
220 kDefaultSubNamespace, kDefaultMaxConcurrentTasks);
220 } 221 }
221 222
222 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set) { 223 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set) {
223 InsertNodeForTask(&graph_, new_task_set_finished_tasks[task_set].get(), 224 InsertNodeForTask(&graph_, new_task_set_finished_tasks[task_set].get(),
224 kTaskSetFinishedTaskPriorityBase + task_set, 225 kTaskSetFinishedTaskPriorityBase + task_set,
225 task_count[task_set]); 226 task_count[task_set], kDefaultSubNamespace,
227 kDefaultMaxConcurrentTasks);
226 } 228 }
227 229
228 ScheduleTasksOnOriginThread(this, &graph_); 230 ScheduleTasksOnOriginThread(this, &graph_);
229 task_graph_runner_->ScheduleTasks(namespace_token_, &graph_); 231 task_graph_runner_->ScheduleTasks(namespace_token_, &graph_);
230 232
231 std::copy(new_task_set_finished_tasks, 233 std::copy(new_task_set_finished_tasks,
232 new_task_set_finished_tasks + kNumberOfTaskSets, 234 new_task_set_finished_tasks + kNumberOfTaskSets,
233 task_set_finished_tasks_); 235 task_set_finished_tasks_);
234 236
235 resource_pool_->ReduceResourceUsage(); 237 resource_pool_->ReduceResourceUsage();
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 resource_pool_->total_memory_usage_bytes()); 500 resource_pool_->total_memory_usage_bytes());
499 staging_state->SetInteger("pending_copy_count", 501 staging_state->SetInteger("pending_copy_count",
500 resource_pool_->total_resource_count() - 502 resource_pool_->total_resource_count() -
501 resource_pool_->acquired_resource_count()); 503 resource_pool_->acquired_resource_count());
502 staging_state->SetInteger("bytes_pending_copy", 504 staging_state->SetInteger("bytes_pending_copy",
503 resource_pool_->total_memory_usage_bytes() - 505 resource_pool_->total_memory_usage_bytes() -
504 resource_pool_->acquired_memory_usage_bytes()); 506 resource_pool_->acquired_memory_usage_bytes());
505 } 507 }
506 508
507 } // namespace cc 509 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698