| 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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 RasterTaskState::TaskComparator(task)); | 442 RasterTaskState::TaskComparator(task)); |
| 443 DCHECK(state_it != raster_task_states_.end()); | 443 DCHECK(state_it != raster_task_states_.end()); |
| 444 RasterTaskState& state = *state_it; | 444 RasterTaskState& state = *state_it; |
| 445 | 445 |
| 446 bytes_pending_upload_ -= task->resource()->bytes(); | 446 bytes_pending_upload_ -= task->resource()->bytes(); |
| 447 | 447 |
| 448 task->WillComplete(); | 448 task->WillComplete(); |
| 449 task->CompleteOnOriginThread(this); | 449 task->CompleteOnOriginThread(this); |
| 450 task->DidComplete(); | 450 task->DidComplete(); |
| 451 | 451 |
| 452 // Async set pixels commands are not necessarily processed in-sequence with | |
| 453 // drawing commands. Read lock fences are required to ensure that async | |
| 454 // commands don't access the resource while used for drawing. | |
| 455 resource_provider_->EnableReadLockFences(task->resource()->id()); | |
| 456 | |
| 457 DCHECK(std::find(completed_raster_tasks_.begin(), | 452 DCHECK(std::find(completed_raster_tasks_.begin(), |
| 458 completed_raster_tasks_.end(), | 453 completed_raster_tasks_.end(), |
| 459 task) == completed_raster_tasks_.end()); | 454 task) == completed_raster_tasks_.end()); |
| 460 completed_raster_tasks_.push_back(task); | 455 completed_raster_tasks_.push_back(task); |
| 461 state.type = RasterTaskState::COMPLETED; | 456 state.type = RasterTaskState::COMPLETED; |
| 462 // Triggers if the current task belongs to a set that should be empty. | 457 // Triggers if the current task belongs to a set that should be empty. |
| 463 DCHECK((state.task_sets & ~NonEmptyTaskSetsFromTaskCounts(task_counts_)) | 458 DCHECK((state.task_sets & ~NonEmptyTaskSetsFromTaskCounts(task_counts_)) |
| 464 .none()); | 459 .none()); |
| 465 RemoveTaskSetsFromTaskCounts(task_counts_, state.task_sets); | 460 RemoveTaskSetsFromTaskCounts(task_counts_, state.task_sets); |
| 466 } | 461 } |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 void PixelBufferRasterWorkerPool::ThrottleStateAsValueInto( | 747 void PixelBufferRasterWorkerPool::ThrottleStateAsValueInto( |
| 753 base::debug::TracedValue* throttle_state) const { | 748 base::debug::TracedValue* throttle_state) const { |
| 754 throttle_state->SetInteger("bytes_available_for_upload", | 749 throttle_state->SetInteger("bytes_available_for_upload", |
| 755 max_bytes_pending_upload_ - bytes_pending_upload_); | 750 max_bytes_pending_upload_ - bytes_pending_upload_); |
| 756 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_); | 751 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_); |
| 757 throttle_state->SetInteger("scheduled_raster_task_count", | 752 throttle_state->SetInteger("scheduled_raster_task_count", |
| 758 scheduled_raster_task_count_); | 753 scheduled_raster_task_count_); |
| 759 } | 754 } |
| 760 | 755 |
| 761 } // namespace cc | 756 } // namespace cc |
| OLD | NEW |