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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 DCHECK_EQ(RasterTaskState::COMPLETED, state_it->type); | 254 DCHECK_EQ(RasterTaskState::COMPLETED, state_it->type); |
255 | 255 |
256 std::swap(*state_it, raster_task_states_.back()); | 256 std::swap(*state_it, raster_task_states_.back()); |
257 raster_task_states_.pop_back(); | 257 raster_task_states_.pop_back(); |
258 | 258 |
259 task->RunReplyOnOriginThread(); | 259 task->RunReplyOnOriginThread(); |
260 } | 260 } |
261 completed_raster_tasks_.clear(); | 261 completed_raster_tasks_.clear(); |
262 } | 262 } |
263 | 263 |
264 SkCanvas* PixelBufferRasterWorkerPool::AcquireCanvasForRaster( | 264 RasterCanvas* PixelBufferRasterWorkerPool::AcquireCanvasForRaster( |
265 RasterTask* task) { | 265 RasterTask* task) { |
266 DCHECK(std::find_if(raster_task_states_.begin(), | 266 DCHECK(std::find_if(raster_task_states_.begin(), |
267 raster_task_states_.end(), | 267 raster_task_states_.end(), |
268 RasterTaskState::TaskComparator(task)) != | 268 RasterTaskState::TaskComparator(task)) != |
269 raster_task_states_.end()); | 269 raster_task_states_.end()); |
270 resource_provider_->AcquirePixelRasterBuffer(task->resource()->id()); | 270 resource_provider_->AcquirePixelRasterBuffer(task->resource()->id()); |
271 return resource_provider_->MapPixelRasterBuffer(task->resource()->id()); | 271 return resource_provider_->MapPixelRasterBuffer(task->resource()->id()); |
272 } | 272 } |
273 | 273 |
274 void PixelBufferRasterWorkerPool::ReleaseCanvasForRaster(RasterTask* task) { | 274 void PixelBufferRasterWorkerPool::ReleaseCanvasForRaster(RasterTask* task) { |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 void PixelBufferRasterWorkerPool::ThrottleStateAsValueInto( | 752 void PixelBufferRasterWorkerPool::ThrottleStateAsValueInto( |
753 base::debug::TracedValue* throttle_state) const { | 753 base::debug::TracedValue* throttle_state) const { |
754 throttle_state->SetInteger("bytes_available_for_upload", | 754 throttle_state->SetInteger("bytes_available_for_upload", |
755 max_bytes_pending_upload_ - bytes_pending_upload_); | 755 max_bytes_pending_upload_ - bytes_pending_upload_); |
756 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_); | 756 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_); |
757 throttle_state->SetInteger("scheduled_raster_task_count", | 757 throttle_state->SetInteger("scheduled_raster_task_count", |
758 scheduled_raster_task_count_); | 758 scheduled_raster_task_count_); |
759 } | 759 } |
760 | 760 |
761 } // namespace cc | 761 } // namespace cc |
OLD | NEW |