| 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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 raster_finished_task_pending_ = false; | 283 raster_finished_task_pending_ = false; |
| 284 | 284 |
| 285 // Call CheckForCompletedRasterTasks() when we've finished running all | 285 // Call CheckForCompletedRasterTasks() when we've finished running all |
| 286 // raster tasks needed since last time ScheduleTasks() was called. | 286 // raster tasks needed since last time ScheduleTasks() was called. |
| 287 // This reduces latency between the time when all tasks have finished | 287 // This reduces latency between the time when all tasks have finished |
| 288 // running and the time when the client is notified. | 288 // running and the time when the client is notified. |
| 289 CheckForCompletedRasterTasks(); | 289 CheckForCompletedRasterTasks(); |
| 290 } | 290 } |
| 291 | 291 |
| 292 void PixelBufferRasterWorkerPool::OnRasterRequiredForActivationFinished() { | 292 void PixelBufferRasterWorkerPool::OnRasterRequiredForActivationFinished() { |
| 293 TRACE_EVENT0( | 293 TRACE_EVENT1( |
| 294 "cc", | 294 "cc", |
| 295 "PixelBufferRasterWorkerPool::OnRasterRequiredForActivationFinished"); | 295 "PixelBufferRasterWorkerPool::OnRasterRequiredForActivationFinished", |
| 296 "should_notify_client_if_no_tasks_required_for_activation_are_pending", |
| 297 should_notify_client_if_no_tasks_required_for_activation_are_pending_); |
| 296 | 298 |
| 297 // Analogous to OnRasterTasksFinished(), there's no need to call | 299 // Analogous to OnRasterTasksFinished(), there's no need to call |
| 298 // CheckForCompletedRasterTasks() if the client has already been notified. | 300 // CheckForCompletedRasterTasks() if the client has already been notified. |
| 299 if (!should_notify_client_if_no_tasks_required_for_activation_are_pending_) | 301 if (!should_notify_client_if_no_tasks_required_for_activation_are_pending_) |
| 300 return; | 302 return; |
| 301 raster_required_for_activation_finished_task_pending_ = false; | 303 raster_required_for_activation_finished_task_pending_ = false; |
| 302 | 304 |
| 303 // This reduces latency between the time when all tasks required for | 305 // This reduces latency between the time when all tasks required for |
| 304 // activation have finished running and the time when the client is | 306 // activation have finished running and the time when the client is |
| 305 // notified. | 307 // notified. |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 void PixelBufferRasterWorkerPool::ThrottleStateAsValueInto( | 737 void PixelBufferRasterWorkerPool::ThrottleStateAsValueInto( |
| 736 base::debug::TracedValue* throttle_state) const { | 738 base::debug::TracedValue* throttle_state) const { |
| 737 throttle_state->SetInteger("bytes_available_for_upload", | 739 throttle_state->SetInteger("bytes_available_for_upload", |
| 738 max_bytes_pending_upload_ - bytes_pending_upload_); | 740 max_bytes_pending_upload_ - bytes_pending_upload_); |
| 739 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_); | 741 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_); |
| 740 throttle_state->SetInteger("scheduled_raster_task_count", | 742 throttle_state->SetInteger("scheduled_raster_task_count", |
| 741 scheduled_raster_task_count_); | 743 scheduled_raster_task_count_); |
| 742 } | 744 } |
| 743 | 745 |
| 744 } // namespace cc | 746 } // namespace cc |
| OLD | NEW |