Stacy Gaikovaia would like Jonathan Ross to review this change.
[cleanup] Express CommitPending in terms of BMFIdle
This makes it slightly easier to see all the uses of
begin_main_frame_state_ inside the state machine.
R=jonross
diff --git a/cc/scheduler/scheduler_state_machine.cc b/cc/scheduler/scheduler_state_machine.cc
index 3f9bd040..60dfcb2 100644
--- a/cc/scheduler/scheduler_state_machine.cc
+++ b/cc/scheduler/scheduler_state_machine.cc
@@ -1002,7 +1002,7 @@
// OnBeginImplFrameIdle for cases where the scheduler aborts draws outside
// of the deadline.
main_thread_missed_last_deadline_ =
- CommitPending() ||
+ !BeginMainFrameStateIdle(begin_main_frame_state_) ||
(has_pending_tree_ && !current_pending_tree_is_impl_side_);
// We need to reset needs_redraw_ before we draw since the
@@ -1304,7 +1304,8 @@
// If a new or undrawn active tree is pending after the deadline,
// then the main thread is in a high latency mode.
main_thread_missed_last_deadline_ =
- CommitPending() || has_pending_tree_ || active_tree_needs_first_draw_;
+ !BeginMainFrameStateIdle(begin_main_frame_state_) || has_pending_tree_ ||
+ active_tree_needs_first_draw_;
// If we're entering a state where we won't get BeginFrames set all the
// funnels so that we don't perform any actions that we shouldn't.
@@ -1388,7 +1389,8 @@
// We did not send a BeginMainFrame() and main is not busy, we can trigger the
// deadline immediately.
- bool wait_for_main = CommitPending() || has_pending_tree_;
+ bool wait_for_main =
+ !BeginMainFrameStateIdle(begin_main_frame_state_) || has_pending_tree_;
if (last_begin_impl_frame_time_ != last_sent_begin_main_frame_time_ &&
!wait_for_main) {
TRACE_EVENT_INSTANT("cc", "TriggerDeadlineDueToThrottling");
diff --git a/cc/scheduler/scheduler_state_machine.h b/cc/scheduler/scheduler_state_machine.h
index 94e7845..f12f36c 100644
--- a/cc/scheduler/scheduler_state_machine.h
+++ b/cc/scheduler/scheduler_state_machine.h
@@ -122,7 +122,7 @@
}
bool CommitPending() const {
- return begin_main_frame_state_ != BeginMainFrameState::IDLE;
+ return !BeginMainFrameStateIdle(begin_main_frame_state_);
}
bool NewActiveTreeLikely() const {
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
bool CommitPending() const {Do we need this anymore if we are updating the callsites too?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |