OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/pixel_buffer_raster_worker_pool.h" | 5 #include "cc/resources/pixel_buffer_raster_worker_pool.h" |
6 | 6 |
7 #include "base/containers/stack_container.h" | 7 #include "base/containers/stack_container.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "cc/debug/traced_value.h" | 10 #include "cc/debug/traced_value.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 147 |
148 tasks_required_for_activation_.clear(); | 148 tasks_required_for_activation_.clear(); |
149 | 149 |
150 // Build new pixel buffer task set. | 150 // Build new pixel buffer task set. |
151 TaskMap new_pixel_buffer_tasks; | 151 TaskMap new_pixel_buffer_tasks; |
152 for (RasterTaskVector::const_iterator it = raster_tasks().begin(); | 152 for (RasterTaskVector::const_iterator it = raster_tasks().begin(); |
153 it != raster_tasks().end(); ++it) { | 153 it != raster_tasks().end(); ++it) { |
154 internal::RasterWorkerPoolTask* task = it->get(); | 154 internal::RasterWorkerPoolTask* task = it->get(); |
155 DCHECK(new_pixel_buffer_tasks.find(task) == new_pixel_buffer_tasks.end()); | 155 DCHECK(new_pixel_buffer_tasks.find(task) == new_pixel_buffer_tasks.end()); |
156 DCHECK(!task->HasCompleted()); | 156 DCHECK(!task->HasCompleted()); |
| 157 DCHECK(!task->WasCanceled()); |
157 | 158 |
158 new_pixel_buffer_tasks[task] = pixel_buffer_tasks_[task]; | 159 new_pixel_buffer_tasks[task] = pixel_buffer_tasks_[task]; |
159 pixel_buffer_tasks_.erase(task); | 160 pixel_buffer_tasks_.erase(task); |
160 | 161 |
161 if (IsRasterTaskRequiredForActivation(task)) | 162 if (IsRasterTaskRequiredForActivation(task)) |
162 tasks_required_for_activation_.insert(task); | 163 tasks_required_for_activation_.insert(task); |
163 } | 164 } |
164 | 165 |
165 // Transfer remaining pixel buffer tasks to |new_pixel_buffer_tasks| | 166 // Transfer remaining pixel buffer tasks to |new_pixel_buffer_tasks| |
166 // and cancel all remaining inactive tasks. | 167 // and cancel all remaining inactive tasks. |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 | 664 |
664 throttle_state->SetInteger("bytes_available_for_upload", | 665 throttle_state->SetInteger("bytes_available_for_upload", |
665 max_bytes_pending_upload_ - bytes_pending_upload_); | 666 max_bytes_pending_upload_ - bytes_pending_upload_); |
666 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_); | 667 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_); |
667 throttle_state->SetInteger("scheduled_raster_task_count", | 668 throttle_state->SetInteger("scheduled_raster_task_count", |
668 scheduled_raster_task_count_); | 669 scheduled_raster_task_count_); |
669 return throttle_state.PassAs<base::Value>(); | 670 return throttle_state.PassAs<base::Value>(); |
670 } | 671 } |
671 | 672 |
672 } // namespace cc | 673 } // namespace cc |
OLD | NEW |