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

Unified Diff: cc/scheduler/scheduler_state_machine.cc

Issue 462803002: Fix failing (flaky) LayerTreeHostTestLCDNotification test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: flakylcd: reordertests Created 6 years, 4 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/scheduler/scheduler_state_machine.h ('k') | cc/test/fake_proxy.h » ('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 723c40c80c276d42ce3d1e2df2c58f51dfad5742..c66b650d96afa624fb2ab8a93dda14a7e366f3be 100644
--- a/cc/scheduler/scheduler_state_machine.cc
+++ b/cc/scheduler/scheduler_state_machine.cc
@@ -418,10 +418,21 @@ bool SchedulerStateMachine::ShouldAnimate() const {
return needs_redraw_ || needs_animate_;
}
-bool SchedulerStateMachine::ShouldSendBeginMainFrame() const {
+bool SchedulerStateMachine::CouldSendBeginMainFrame() const {
if (!needs_commit_)
return false;
+ // We can not perform commits if we are not visible.
+ if (!visible_)
+ return false;
+
+ return true;
+}
+
+bool SchedulerStateMachine::ShouldSendBeginMainFrame() const {
+ if (!CouldSendBeginMainFrame())
+ return false;
+
// Only send BeginMainFrame when there isn't another commit pending already.
if (commit_state_ != COMMIT_STATE_IDLE)
return false;
@@ -433,10 +444,6 @@ bool SchedulerStateMachine::ShouldSendBeginMainFrame() const {
return false;
}
- // We do not need commits if we are not visible.
- if (!visible_)
- return false;
-
// We want to start the first commit after we get a new output surface ASAP.
if (output_surface_state_ == OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT)
return true;
« no previous file with comments | « cc/scheduler/scheduler_state_machine.h ('k') | cc/test/fake_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698