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

Unified Diff: cc/resources/pixel_buffer_raster_worker_pool.cc

Issue 99873007: cc: Simplify raster task completion notification logic (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Split off the bugfix. 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 | « cc/resources/pixel_buffer_raster_worker_pool.h ('k') | no next file » | 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 8685af0ff097abf29161d63a2f339e492de5b7f7..294eebceeaf2e85ca7e02b20db57b15aa14f8dbb 100644
--- a/cc/resources/pixel_buffer_raster_worker_pool.cc
+++ b/cc/resources/pixel_buffer_raster_worker_pool.cc
@@ -102,7 +102,9 @@ PixelBufferRasterWorkerPool::PixelBufferRasterWorkerPool(
check_for_completed_raster_tasks_pending_(false),
should_notify_client_if_no_tasks_are_pending_(false),
should_notify_client_if_no_tasks_required_for_activation_are_pending_(
- false) {
+ false),
+ raster_finished_task_pending_(false),
+ raster_required_for_activation_finished_task_pending_(false) {
}
PixelBufferRasterWorkerPool::~PixelBufferRasterWorkerPool() {
@@ -255,6 +257,7 @@ void PixelBufferRasterWorkerPool::OnRasterTasksFinished() {
// perform another check in that case as we've already notified the client.
if (!should_notify_client_if_no_tasks_are_pending_)
return;
+ raster_finished_task_pending_ = false;
// Call CheckForCompletedRasterTasks() when we've finished running all
// raster tasks needed since last time ScheduleTasks() was called.
@@ -268,6 +271,7 @@ void PixelBufferRasterWorkerPool::OnRasterTasksRequiredForActivationFinished() {
// CheckForCompletedRasterTasks() if the client has already been notified.
if (!should_notify_client_if_no_tasks_required_for_activation_are_pending_)
return;
+ raster_required_for_activation_finished_task_pending_ = false;
// This reduces latency between the time when all tasks required for
// activation have finished running and the time when the client is
@@ -386,9 +390,11 @@ void PixelBufferRasterWorkerPool::CheckForCompletedRasterTasks() {
// Determine what client notifications to generate.
bool will_notify_client_that_no_tasks_required_for_activation_are_pending =
(should_notify_client_if_no_tasks_required_for_activation_are_pending_ &&
+ !raster_required_for_activation_finished_task_pending_ &&
!HasPendingTasksRequiredForActivation());
bool will_notify_client_that_no_tasks_are_pending =
(should_notify_client_if_no_tasks_are_pending_ &&
+ !raster_finished_task_pending_ &&
!HasPendingTasks());
// Adjust the need to generate notifications before scheduling more tasks.
@@ -539,6 +545,7 @@ void PixelBufferRasterWorkerPool::ScheduleMoreTasks() {
should_notify_client_if_no_tasks_required_for_activation_are_pending_) {
new_raster_required_for_activation_finished_task =
CreateRasterRequiredForActivationFinishedTask();
+ raster_required_for_activation_finished_task_pending_ = true;
internal::GraphNode* raster_required_for_activation_finished_node =
CreateGraphNodeForTask(
new_raster_required_for_activation_finished_task.get(),
@@ -560,6 +567,7 @@ void PixelBufferRasterWorkerPool::ScheduleMoreTasks() {
if (!did_throttle_raster_tasks &&
should_notify_client_if_no_tasks_are_pending_) {
new_raster_finished_task = CreateRasterFinishedTask();
+ raster_finished_task_pending_ = true;
internal::GraphNode* raster_finished_node =
CreateGraphNodeForTask(new_raster_finished_task.get(),
1u, // Priority 1
« no previous file with comments | « cc/resources/pixel_buffer_raster_worker_pool.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698