OLD | NEW |
---|---|
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/gpu_raster_worker_pool.h" | 5 #include "cc/resources/gpu_raster_worker_pool.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "cc/output/context_provider.h" | 10 #include "cc/output/context_provider.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
176 ScheduleTasksOnOriginThread(this, &graph_); | 176 ScheduleTasksOnOriginThread(this, &graph_); |
177 task_graph_runner_->ScheduleTasks(namespace_token_, &graph_); | 177 task_graph_runner_->ScheduleTasks(namespace_token_, &graph_); |
178 | 178 |
179 ScheduleRunTasksOnOriginThread(); | 179 ScheduleRunTasksOnOriginThread(); |
180 | 180 |
181 std::copy(new_raster_finished_tasks, | 181 std::copy(new_raster_finished_tasks, |
182 new_raster_finished_tasks + kNumberOfTaskSets, | 182 new_raster_finished_tasks + kNumberOfTaskSets, |
183 raster_finished_tasks_); | 183 raster_finished_tasks_); |
184 } | 184 } |
185 | 185 |
186 void GpuRasterWorkerPool::WaitForTasksToFinishRunning() { | |
187 task_graph_runner_->WaitForTasksToFinishRunning(namespace_token_); | |
reveman
2014/10/27 19:15:49
This doesn't really make sense. It will block on c
enne (OOO)
2014/10/27 20:23:24
I'm happy to change this if this is not right, but
| |
188 } | |
189 | |
186 void GpuRasterWorkerPool::CheckForCompletedTasks() { | 190 void GpuRasterWorkerPool::CheckForCompletedTasks() { |
187 TRACE_EVENT0("cc", "GpuRasterWorkerPool::CheckForCompletedTasks"); | 191 TRACE_EVENT0("cc", "GpuRasterWorkerPool::CheckForCompletedTasks"); |
188 | 192 |
189 task_graph_runner_->CollectCompletedTasks(namespace_token_, | 193 task_graph_runner_->CollectCompletedTasks(namespace_token_, |
190 &completed_tasks_); | 194 &completed_tasks_); |
191 for (Task::Vector::const_iterator it = completed_tasks_.begin(); | 195 for (Task::Vector::const_iterator it = completed_tasks_.begin(); |
192 it != completed_tasks_.end(); | 196 it != completed_tasks_.end(); |
193 ++it) { | 197 ++it) { |
194 RasterizerTask* task = static_cast<RasterizerTask*>(it->get()); | 198 RasterizerTask* task = static_cast<RasterizerTask*>(it->get()); |
195 | 199 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
244 | 248 |
245 ScopedGpuRaster gpu_raster(context_provider_); | 249 ScopedGpuRaster gpu_raster(context_provider_); |
246 task_graph_runner_->RunUntilIdle(); | 250 task_graph_runner_->RunUntilIdle(); |
247 | 251 |
248 // Draw each all of the pictures that were collected. This will also clear | 252 // Draw each all of the pictures that were collected. This will also clear |
249 // the pictures and canvases added to |multi_picture_draw_| | 253 // the pictures and canvases added to |multi_picture_draw_| |
250 multi_picture_draw_.draw(); | 254 multi_picture_draw_.draw(); |
251 } | 255 } |
252 | 256 |
253 } // namespace cc | 257 } // namespace cc |
OLD | NEW |