OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/one_copy_tile_task_worker_pool.h" | 5 #include "cc/resources/one_copy_tile_task_worker_pool.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 // The number of busy resources in the pool reflects the number of issued | 460 // The number of busy resources in the pool reflects the number of issued |
461 // copy operations that have not yet completed. | 461 // copy operations that have not yet completed. |
462 issued_copy_operation_count_ = resource_pool_->busy_resource_count(); | 462 issued_copy_operation_count_ = resource_pool_->busy_resource_count(); |
463 | 463 |
464 // There may be work blocked on too many in-flight copy operations, so wake | 464 // There may be work blocked on too many in-flight copy operations, so wake |
465 // up a worker thread. | 465 // up a worker thread. |
466 copy_operation_count_cv_.Signal(); | 466 copy_operation_count_cv_.Signal(); |
467 } | 467 } |
468 } | 468 } |
469 | 469 |
470 scoped_refptr<base::debug::ConvertableToTraceFormat> | 470 scoped_refptr<base::trace_event::ConvertableToTraceFormat> |
471 OneCopyTileTaskWorkerPool::StateAsValue() const { | 471 OneCopyTileTaskWorkerPool::StateAsValue() const { |
472 scoped_refptr<base::debug::TracedValue> state = | 472 scoped_refptr<base::trace_event::TracedValue> state = |
473 new base::debug::TracedValue(); | 473 new base::trace_event::TracedValue(); |
474 | 474 |
475 state->BeginArray("tasks_pending"); | 475 state->BeginArray("tasks_pending"); |
476 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set) | 476 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set) |
477 state->AppendBoolean(tasks_pending_[task_set]); | 477 state->AppendBoolean(tasks_pending_[task_set]); |
478 state->EndArray(); | 478 state->EndArray(); |
479 state->BeginDictionary("staging_state"); | 479 state->BeginDictionary("staging_state"); |
480 StagingStateAsValueInto(state.get()); | 480 StagingStateAsValueInto(state.get()); |
481 state->EndDictionary(); | 481 state->EndDictionary(); |
482 | 482 |
483 return state; | 483 return state; |
484 } | 484 } |
485 | 485 |
486 void OneCopyTileTaskWorkerPool::StagingStateAsValueInto( | 486 void OneCopyTileTaskWorkerPool::StagingStateAsValueInto( |
487 base::debug::TracedValue* staging_state) const { | 487 base::trace_event::TracedValue* staging_state) const { |
488 staging_state->SetInteger("staging_resource_count", | 488 staging_state->SetInteger("staging_resource_count", |
489 resource_pool_->total_resource_count()); | 489 resource_pool_->total_resource_count()); |
490 staging_state->SetInteger("bytes_used_for_staging_resources", | 490 staging_state->SetInteger("bytes_used_for_staging_resources", |
491 resource_pool_->total_memory_usage_bytes()); | 491 resource_pool_->total_memory_usage_bytes()); |
492 staging_state->SetInteger("pending_copy_count", | 492 staging_state->SetInteger("pending_copy_count", |
493 resource_pool_->total_resource_count() - | 493 resource_pool_->total_resource_count() - |
494 resource_pool_->acquired_resource_count()); | 494 resource_pool_->acquired_resource_count()); |
495 staging_state->SetInteger("bytes_pending_copy", | 495 staging_state->SetInteger("bytes_pending_copy", |
496 resource_pool_->total_memory_usage_bytes() - | 496 resource_pool_->total_memory_usage_bytes() - |
497 resource_pool_->acquired_memory_usage_bytes()); | 497 resource_pool_->acquired_memory_usage_bytes()); |
498 } | 498 } |
499 | 499 |
500 } // namespace cc | 500 } // namespace cc |
OLD | NEW |