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 "base/containers/stack_container.h" | 7 #include "base/containers/stack_container.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "cc/debug/traced_value.h" | 10 #include "cc/debug/traced_value.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 // Only used as std::find_if predicate for DCHECKs. | 85 // Only used as std::find_if predicate for DCHECKs. |
86 bool WasCanceled(const internal::RasterWorkerPoolTask* task) { | 86 bool WasCanceled(const internal::RasterWorkerPoolTask* task) { |
87 return task->WasCanceled(); | 87 return task->WasCanceled(); |
88 } | 88 } |
89 | 89 |
90 } // namespace | 90 } // namespace |
91 | 91 |
92 PixelBufferRasterWorkerPool::PixelBufferRasterWorkerPool( | 92 PixelBufferRasterWorkerPool::PixelBufferRasterWorkerPool( |
93 ResourceProvider* resource_provider, | 93 ResourceProvider* resource_provider, |
94 ContextProvider* context_provider, | 94 ContextProvider* context_provider, |
95 size_t num_threads, | |
96 size_t max_transfer_buffer_usage_bytes) | 95 size_t max_transfer_buffer_usage_bytes) |
97 : RasterWorkerPool(resource_provider, context_provider, num_threads), | 96 : RasterWorkerPool(resource_provider, context_provider), |
98 shutdown_(false), | 97 shutdown_(false), |
99 scheduled_raster_task_count_(0), | 98 scheduled_raster_task_count_(0), |
100 bytes_pending_upload_(0), | 99 bytes_pending_upload_(0), |
101 max_bytes_pending_upload_(max_transfer_buffer_usage_bytes), | 100 max_bytes_pending_upload_(max_transfer_buffer_usage_bytes), |
102 has_performed_uploads_since_last_flush_(false), | 101 has_performed_uploads_since_last_flush_(false), |
103 check_for_completed_raster_tasks_pending_(false), | 102 check_for_completed_raster_tasks_pending_(false), |
104 should_notify_client_if_no_tasks_are_pending_(false), | 103 should_notify_client_if_no_tasks_are_pending_(false), |
105 should_notify_client_if_no_tasks_required_for_activation_are_pending_( | 104 should_notify_client_if_no_tasks_required_for_activation_are_pending_( |
106 false), | 105 false), |
107 raster_finished_task_pending_(false), | 106 raster_finished_task_pending_(false), |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 | 691 |
693 throttle_state->SetInteger("bytes_available_for_upload", | 692 throttle_state->SetInteger("bytes_available_for_upload", |
694 max_bytes_pending_upload_ - bytes_pending_upload_); | 693 max_bytes_pending_upload_ - bytes_pending_upload_); |
695 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_); | 694 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_); |
696 throttle_state->SetInteger("scheduled_raster_task_count", | 695 throttle_state->SetInteger("scheduled_raster_task_count", |
697 scheduled_raster_task_count_); | 696 scheduled_raster_task_count_); |
698 return throttle_state.PassAs<base::Value>(); | 697 return throttle_state.PassAs<base::Value>(); |
699 } | 698 } |
700 | 699 |
701 } // namespace cc | 700 } // namespace cc |
OLD | NEW |