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

Unified Diff: cc/scheduler/scheduler_state_machine.cc

Issue 605823002: cc: Activate when going invisible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 6 years, 3 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/scheduler/scheduler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/scheduler_state_machine.cc
diff --git a/cc/scheduler/scheduler_state_machine.cc b/cc/scheduler/scheduler_state_machine.cc
index 8f38a33d7e31f7299dac0afa87a939b61ce86b8b..5f96faf499574ff7abfaea0e2c674d8a5db7387b 100644
--- a/cc/scheduler/scheduler_state_machine.cc
+++ b/cc/scheduler/scheduler_state_machine.cc
@@ -282,23 +282,28 @@ bool SchedulerStateMachine::PendingDrawsShouldBeAborted() const {
return true;
// Additional states where we should abort draws.
- // Note: We don't force activation in these cases because doing so would
- // result in checkerboarding on resize, becoming visible, etc.
if (!can_draw_)
brianderson 2014/09/25 20:07:42 Do we also set the high res required to draw flag
danakj 2014/09/25 20:16:07 That's a good question. We recently had to add a S
return true;
- if (!visible_)
- return true;
return false;
}
bool SchedulerStateMachine::PendingActivationsShouldBeForced() const {
- // These are all the cases where, if we do not force activations to make
- // forward progress, we might deadlock with the main thread.
-
// There is no output surface to trigger our activations.
+ // If we do not force activations to make forward progress, we might deadlock
+ // with the main thread.
if (output_surface_state_ == OUTPUT_SURFACE_LOST)
return true;
+ // If we're not visible, we should force activation.
+ // Since we set RequiresHighResToDraw when becoming visible, we ensure that we
+ // don't checkerboard until all visible resources are done. Furthermore, if we
+ // do keep the pending tree around, when becoming visible we might activate
+ // prematurely causing RequiresHighResToDraw flag to be reset. In all cases,
+ // we can simply activate on becoming invisible since we don't need to draw
+ // the active tree when we're in this state.
+ if (!visible_)
+ return true;
+
return false;
}
« no previous file with comments | « no previous file | cc/scheduler/scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698