| 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_tile_task_worker_pool.h" | 5 #include "cc/resources/pixel_buffer_tile_task_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/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 resource_provider_->BeginSetPixels(raster_task->resource()->id()); | 694 resource_provider_->BeginSetPixels(raster_task->resource()->id()); |
| 695 has_performed_uploads_since_last_flush_ = true; | 695 has_performed_uploads_since_last_flush_ = true; |
| 696 | 696 |
| 697 bytes_pending_upload_ += raster_task->resource()->bytes(); | 697 bytes_pending_upload_ += raster_task->resource()->bytes(); |
| 698 raster_tasks_with_pending_upload_.push_back(raster_task); | 698 raster_tasks_with_pending_upload_.push_back(raster_task); |
| 699 state.type = RasterTaskState::UPLOADING; | 699 state.type = RasterTaskState::UPLOADING; |
| 700 } | 700 } |
| 701 completed_tasks_.clear(); | 701 completed_tasks_.clear(); |
| 702 } | 702 } |
| 703 | 703 |
| 704 scoped_refptr<base::debug::ConvertableToTraceFormat> | 704 scoped_refptr<base::trace_event::ConvertableToTraceFormat> |
| 705 PixelBufferTileTaskWorkerPool::StateAsValue() const { | 705 PixelBufferTileTaskWorkerPool::StateAsValue() const { |
| 706 scoped_refptr<base::debug::TracedValue> state = | 706 scoped_refptr<base::trace_event::TracedValue> state = |
| 707 new base::debug::TracedValue(); | 707 new base::trace_event::TracedValue(); |
| 708 state->SetInteger("completed_count", completed_raster_tasks_.size()); | 708 state->SetInteger("completed_count", completed_raster_tasks_.size()); |
| 709 state->BeginArray("pending_count"); | 709 state->BeginArray("pending_count"); |
| 710 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set) | 710 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set) |
| 711 state->AppendInteger(task_counts_[task_set]); | 711 state->AppendInteger(task_counts_[task_set]); |
| 712 state->EndArray(); | 712 state->EndArray(); |
| 713 state->SetInteger("pending_upload_count", | 713 state->SetInteger("pending_upload_count", |
| 714 raster_tasks_with_pending_upload_.size()); | 714 raster_tasks_with_pending_upload_.size()); |
| 715 state->BeginDictionary("throttle_state"); | 715 state->BeginDictionary("throttle_state"); |
| 716 ThrottleStateAsValueInto(state.get()); | 716 ThrottleStateAsValueInto(state.get()); |
| 717 state->EndDictionary(); | 717 state->EndDictionary(); |
| 718 return state; | 718 return state; |
| 719 } | 719 } |
| 720 | 720 |
| 721 void PixelBufferTileTaskWorkerPool::ThrottleStateAsValueInto( | 721 void PixelBufferTileTaskWorkerPool::ThrottleStateAsValueInto( |
| 722 base::debug::TracedValue* throttle_state) const { | 722 base::trace_event::TracedValue* throttle_state) const { |
| 723 throttle_state->SetInteger("bytes_available_for_upload", | 723 throttle_state->SetInteger("bytes_available_for_upload", |
| 724 max_bytes_pending_upload_ - bytes_pending_upload_); | 724 max_bytes_pending_upload_ - bytes_pending_upload_); |
| 725 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_); | 725 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_); |
| 726 throttle_state->SetInteger("scheduled_raster_task_count", | 726 throttle_state->SetInteger("scheduled_raster_task_count", |
| 727 scheduled_raster_task_count_); | 727 scheduled_raster_task_count_); |
| 728 } | 728 } |
| 729 | 729 |
| 730 } // namespace cc | 730 } // namespace cc |
| OLD | NEW |