Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Unified Diff: cc/resources/pixel_buffer_raster_worker_pool.cc

Issue 131763003: cc: Fix logic for detecting when raster tasks were throttled (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/resources/raster_worker_pool_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/pixel_buffer_raster_worker_pool.cc
diff --git a/cc/resources/pixel_buffer_raster_worker_pool.cc b/cc/resources/pixel_buffer_raster_worker_pool.cc
index 3c30d9de08543aa1da446d93ff997b41ad38f6bd..b9f657883e79e898fa4e748e0939c4509bda7439 100644
--- a/cc/resources/pixel_buffer_raster_worker_pool.cc
+++ b/cc/resources/pixel_buffer_raster_worker_pool.cc
@@ -447,6 +447,7 @@ void PixelBufferRasterWorkerPool::ScheduleMoreTasks() {
TaskGraph graph;
size_t bytes_pending_upload = bytes_pending_upload_;
+ bool did_throttle_raster_tasks = false;
for (RasterTaskVector::const_iterator it = raster_tasks().begin();
it != raster_tasks().end(); ++it) {
@@ -468,8 +469,10 @@ void PixelBufferRasterWorkerPool::ScheduleMoreTasks() {
// All raster tasks need to be throttled by bytes of pending uploads.
size_t new_bytes_pending_upload = bytes_pending_upload;
new_bytes_pending_upload += task->resource()->bytes();
- if (new_bytes_pending_upload > max_bytes_pending_upload_)
+ if (new_bytes_pending_upload > max_bytes_pending_upload_) {
+ did_throttle_raster_tasks = true;
break;
+ }
internal::WorkerPoolTask* pixel_buffer_task = pixel_buffer_it->second.get();
@@ -483,8 +486,10 @@ void PixelBufferRasterWorkerPool::ScheduleMoreTasks() {
size_t scheduled_raster_task_count =
tasks[PREPAINT_TYPE].container().size() +
tasks[REQUIRED_FOR_ACTIVATION_TYPE].container().size();
- if (scheduled_raster_task_count >= kMaxScheduledRasterTasks)
+ if (scheduled_raster_task_count >= kMaxScheduledRasterTasks) {
+ did_throttle_raster_tasks = true;
break;
+ }
// Update |bytes_pending_upload| now that task has cleared all
// throttling limits.
@@ -561,7 +566,7 @@ void PixelBufferRasterWorkerPool::ScheduleMoreTasks() {
DCHECK_LE(scheduled_raster_task_count, PendingRasterTaskCount());
// Schedule OnRasterTasksFinished call only when notification is pending
// and throttling is not preventing all pending tasks from being scheduled.
- if (scheduled_raster_task_count == PendingRasterTaskCount() &&
+ if (!did_throttle_raster_tasks &&
should_notify_client_if_no_tasks_are_pending_) {
new_raster_finished_task = CreateRasterFinishedTask();
internal::GraphNode* raster_finished_node =
« no previous file with comments | « no previous file | cc/resources/raster_worker_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698