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

Unified Diff: cc/tiles/tile_task_manager.cc

Issue 1866043006: cc: Remove ScheduleOnOriginThread() and CompleteOnOriginThread(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 7 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/tiles/tile_task_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/tile_task_manager.cc
diff --git a/cc/tiles/tile_task_manager.cc b/cc/tiles/tile_task_manager.cc
index 9f78d388eb4d22808abc89635e94cae88bb49883..7293aa99d7486d83923b3e51747f263c29c12283 100644
--- a/cc/tiles/tile_task_manager.cc
+++ b/cc/tiles/tile_task_manager.cc
@@ -28,44 +28,25 @@ TileTaskManagerImpl::TileTaskManagerImpl(
task_graph_runner_(task_graph_runner),
namespace_token_(task_graph_runner->GetNamespaceToken()) {}
-TileTaskManagerImpl::~TileTaskManagerImpl() {
- DCHECK_EQ(0u, completed_tasks_.size());
-}
+TileTaskManagerImpl::~TileTaskManagerImpl() {}
void TileTaskManagerImpl::ScheduleTasks(TaskGraph* graph) {
TRACE_EVENT0("cc", "TileTaskManagerImpl::ScheduleTasks");
- for (TaskGraph::Node::Vector::iterator it = graph->nodes.begin();
- it != graph->nodes.end(); ++it) {
- TaskGraph::Node& node = *it;
- TileTask* task = static_cast<TileTask*>(node.task);
-
- if (!task->HasBeenScheduled()) {
- task->WillSchedule();
- task->ScheduleOnOriginThread(raster_buffer_provider_.get());
- task->DidSchedule();
- }
- }
-
raster_buffer_provider_->OrderingBarrier();
-
task_graph_runner_->ScheduleTasks(namespace_token_, graph);
}
void TileTaskManagerImpl::CheckForCompletedTasks() {
TRACE_EVENT0("cc", "TileTaskManagerImpl::CheckForCompletedTasks");
+ Task::Vector completed_tasks;
+ task_graph_runner_->CollectCompletedTasks(namespace_token_, &completed_tasks);
- task_graph_runner_->CollectCompletedTasks(namespace_token_,
- &completed_tasks_);
- for (Task::Vector::const_iterator it = completed_tasks_.begin();
- it != completed_tasks_.end(); ++it) {
- TileTask* task = static_cast<TileTask*>(it->get());
-
- task->WillComplete();
- task->CompleteOnOriginThread(raster_buffer_provider_.get());
- task->DidComplete();
+ for (auto& task : completed_tasks) {
+ DCHECK(task->state().IsFinished() || task->state().IsCanceled());
+ TileTask* tile_task = static_cast<TileTask*>(task.get());
+ tile_task->OnTaskCompleted();
}
- completed_tasks_.clear();
}
void TileTaskManagerImpl::Shutdown() {
« no previous file with comments | « cc/tiles/tile_task_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698