| Index: cc/resources/pixel_buffer_raster_worker_pool.cc
|
| diff --git a/cc/resources/pixel_buffer_raster_worker_pool.cc b/cc/resources/pixel_buffer_raster_worker_pool.cc
|
| index 48e6f9a114b58e34743c5396e66b16b91602a081..a7d9b31e1ec573b7140f14b836e9cae4905b0820 100644
|
| --- a/cc/resources/pixel_buffer_raster_worker_pool.cc
|
| +++ b/cc/resources/pixel_buffer_raster_worker_pool.cc
|
| @@ -148,6 +148,8 @@ void PixelBufferRasterWorkerPool::ScheduleTasks(RasterTask::Queue* queue) {
|
| should_notify_client_if_no_tasks_are_pending_ = true;
|
| should_notify_client_if_no_tasks_required_for_activation_are_pending_ = true;
|
|
|
| + tasks_required_for_activation_.clear();
|
| +
|
| // Build new pixel buffer task set.
|
| TaskMap new_pixel_buffer_tasks;
|
| for (RasterTaskVector::const_iterator it = raster_tasks().begin();
|
| @@ -156,15 +158,11 @@ void PixelBufferRasterWorkerPool::ScheduleTasks(RasterTask::Queue* queue) {
|
| DCHECK(new_pixel_buffer_tasks.find(task) == new_pixel_buffer_tasks.end());
|
| DCHECK(!task->HasCompleted());
|
|
|
| - // Use existing pixel buffer task if available.
|
| - TaskMap::iterator pixel_buffer_it = pixel_buffer_tasks_.find(task);
|
| - if (pixel_buffer_it == pixel_buffer_tasks_.end()) {
|
| - new_pixel_buffer_tasks[task] = NULL;
|
| - continue;
|
| - }
|
| -
|
| - new_pixel_buffer_tasks[task] = pixel_buffer_it->second;
|
| + new_pixel_buffer_tasks[task] = pixel_buffer_tasks_[task];
|
| pixel_buffer_tasks_.erase(task);
|
| +
|
| + if (IsRasterTaskRequiredForActivation(task))
|
| + tasks_required_for_activation_.insert(task);
|
| }
|
|
|
| // Transfer remaining pixel buffer tasks to |new_pixel_buffer_tasks|
|
| @@ -184,22 +182,17 @@ void PixelBufferRasterWorkerPool::ScheduleTasks(RasterTask::Queue* queue) {
|
| completed_tasks_.end(),
|
| task) == completed_tasks_.end());
|
| completed_tasks_.push_back(task);
|
| - }
|
| - }
|
| -
|
| - tasks_required_for_activation_.clear();
|
| - for (TaskMap::iterator it = new_pixel_buffer_tasks.begin();
|
| - it != new_pixel_buffer_tasks.end(); ++it) {
|
| - internal::RasterWorkerPoolTask* task = it->first;
|
| - if (IsRasterTaskRequiredForActivation(task))
|
| + } else if (IsRasterTaskRequiredForActivation(task)) {
|
| tasks_required_for_activation_.insert(task);
|
| + }
|
| }
|
|
|
| // |tasks_required_for_activation_| contains all tasks that need to
|
| // complete before we can send a "ready to activate" signal. Tasks
|
| // that have already completed should not be part of this set.
|
| for (TaskDeque::const_iterator it = completed_tasks_.begin();
|
| - it != completed_tasks_.end(); ++it) {
|
| + it != completed_tasks_.end() && !tasks_required_for_activation_.empty();
|
| + ++it) {
|
| tasks_required_for_activation_.erase(*it);
|
| }
|
|
|
|
|