OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/tiles/tile_task_manager.h" | 5 #include "cc/tiles/tile_task_manager.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
9 | 9 |
10 namespace cc { | 10 namespace cc { |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 void TileTaskManagerImpl::CheckForCompletedTasks() { | 40 void TileTaskManagerImpl::CheckForCompletedTasks() { |
41 TRACE_EVENT0("cc", "TileTaskManagerImpl::CheckForCompletedTasks"); | 41 TRACE_EVENT0("cc", "TileTaskManagerImpl::CheckForCompletedTasks"); |
42 Task::Vector completed_tasks; | 42 Task::Vector completed_tasks; |
43 task_graph_runner_->CollectCompletedTasks(namespace_token_, &completed_tasks); | 43 task_graph_runner_->CollectCompletedTasks(namespace_token_, &completed_tasks); |
44 | 44 |
45 for (auto& task : completed_tasks) { | 45 for (auto& task : completed_tasks) { |
46 DCHECK(task->state().IsFinished() || task->state().IsCanceled()); | 46 DCHECK(task->state().IsFinished() || task->state().IsCanceled()); |
47 TileTask* tile_task = static_cast<TileTask*>(task.get()); | 47 TileTask* tile_task = static_cast<TileTask*>(task.get()); |
48 tile_task->OnTaskCompleted(); | 48 tile_task->OnTaskCompleted(); |
| 49 tile_task->DidComplete(); |
49 } | 50 } |
50 } | 51 } |
51 | 52 |
52 void TileTaskManagerImpl::Shutdown() { | 53 void TileTaskManagerImpl::Shutdown() { |
53 TRACE_EVENT0("cc", "TileTaskManagerImpl::Shutdown"); | 54 TRACE_EVENT0("cc", "TileTaskManagerImpl::Shutdown"); |
54 | 55 |
55 // Cancel non-scheduled tasks and wait for running tasks to finish. | 56 // Cancel non-scheduled tasks and wait for running tasks to finish. |
56 TaskGraph empty; | 57 TaskGraph empty; |
57 task_graph_runner_->ScheduleTasks(namespace_token_, &empty); | 58 task_graph_runner_->ScheduleTasks(namespace_token_, &empty); |
58 task_graph_runner_->WaitForTasksToFinishRunning(namespace_token_); | 59 task_graph_runner_->WaitForTasksToFinishRunning(namespace_token_); |
59 | 60 |
60 raster_buffer_provider_->Shutdown(); | 61 raster_buffer_provider_->Shutdown(); |
61 } | 62 } |
62 | 63 |
63 RasterBufferProvider* TileTaskManagerImpl::GetRasterBufferProvider() const { | 64 RasterBufferProvider* TileTaskManagerImpl::GetRasterBufferProvider() const { |
64 return raster_buffer_provider_.get(); | 65 return raster_buffer_provider_.get(); |
65 } | 66 } |
66 | 67 |
67 } // namespace cc | 68 } // namespace cc |
OLD | NEW |