| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/containers/stack_container.h" | 9 #include "base/containers/stack_container.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 172 |
| 173 // All unscheduled tasks need to be canceled. | 173 // All unscheduled tasks need to be canceled. |
| 174 if (state.type == RasterTaskState::UNSCHEDULED) { | 174 if (state.type == RasterTaskState::UNSCHEDULED) { |
| 175 completed_raster_tasks_.push_back(state.task); | 175 completed_raster_tasks_.push_back(state.task); |
| 176 state.type = RasterTaskState::COMPLETED; | 176 state.type = RasterTaskState::COMPLETED; |
| 177 } | 177 } |
| 178 } | 178 } |
| 179 DCHECK_EQ(completed_raster_tasks_.size(), raster_task_states_.size()); | 179 DCHECK_EQ(completed_raster_tasks_.size(), raster_task_states_.size()); |
| 180 } | 180 } |
| 181 | 181 |
| 182 void PixelBufferRasterWorkerPool::RunTasks(RasterTaskQueue* queue) { |
| 183 NOTIMPLEMENTED(); |
| 184 } |
| 185 |
| 182 void PixelBufferRasterWorkerPool::ScheduleTasks(RasterTaskQueue* queue) { | 186 void PixelBufferRasterWorkerPool::ScheduleTasks(RasterTaskQueue* queue) { |
| 183 TRACE_EVENT0("cc", "PixelBufferRasterWorkerPool::ScheduleTasks"); | 187 TRACE_EVENT0("cc", "PixelBufferRasterWorkerPool::ScheduleTasks"); |
| 184 | 188 |
| 185 if (should_notify_client_if_no_tasks_are_pending_.none()) | 189 if (should_notify_client_if_no_tasks_are_pending_.none()) |
| 186 TRACE_EVENT_ASYNC_BEGIN0("cc", "ScheduledTasks", this); | 190 TRACE_EVENT_ASYNC_BEGIN0("cc", "ScheduledTasks", this); |
| 187 | 191 |
| 188 should_notify_client_if_no_tasks_are_pending_.set(); | 192 should_notify_client_if_no_tasks_are_pending_.set(); |
| 189 std::fill(task_counts_, task_counts_ + kNumberOfTaskSets, 0); | 193 std::fill(task_counts_, task_counts_ + kNumberOfTaskSets, 0); |
| 190 | 194 |
| 191 // Update raster task state and remove items from old queue. | 195 // Update raster task state and remove items from old queue. |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 void PixelBufferRasterWorkerPool::ThrottleStateAsValueInto( | 744 void PixelBufferRasterWorkerPool::ThrottleStateAsValueInto( |
| 741 base::debug::TracedValue* throttle_state) const { | 745 base::debug::TracedValue* throttle_state) const { |
| 742 throttle_state->SetInteger("bytes_available_for_upload", | 746 throttle_state->SetInteger("bytes_available_for_upload", |
| 743 max_bytes_pending_upload_ - bytes_pending_upload_); | 747 max_bytes_pending_upload_ - bytes_pending_upload_); |
| 744 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_); | 748 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_); |
| 745 throttle_state->SetInteger("scheduled_raster_task_count", | 749 throttle_state->SetInteger("scheduled_raster_task_count", |
| 746 scheduled_raster_task_count_); | 750 scheduled_raster_task_count_); |
| 747 } | 751 } |
| 748 | 752 |
| 749 } // namespace cc | 753 } // namespace cc |
| OLD | NEW |