Commit 79a18a95 authored by Sadrul Habib Chowdhury's avatar Sadrul Habib Chowdhury Committed by Commit Bot

[cleanup] cc: Remove a state from the state-machine.

To track the state of a BeginMainFrame, SENT and STARTED serve the same
purpose: they indicate that a BeginMainFrame has been issued to the
main-thread, and the main-thread has not responded to that yet. So
remove STARTED state, and use only SENT instead.

Document these states, and also ForcedRedrawOnTimeoutState.

BUG=none

Change-Id: I200337cfe0a8ec7544961b01abf22fbc56eea5d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1709153
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: default avatarSunny Sachanandani <sunnyps@chromium.org>
Cr-Commit-Position: refs/heads/master@{#678945}
parent 889e0ce7
...@@ -222,7 +222,6 @@ void Scheduler::DidCreateAndInitializeLayerTreeFrameSink() { ...@@ -222,7 +222,6 @@ void Scheduler::DidCreateAndInitializeLayerTreeFrameSink() {
void Scheduler::NotifyBeginMainFrameStarted( void Scheduler::NotifyBeginMainFrameStarted(
base::TimeTicks main_thread_start_time) { base::TimeTicks main_thread_start_time) {
TRACE_EVENT0("cc", "Scheduler::NotifyBeginMainFrameStarted"); TRACE_EVENT0("cc", "Scheduler::NotifyBeginMainFrameStarted");
state_machine_.NotifyBeginMainFrameStarted();
compositor_timing_history_->BeginMainFrameStarted(main_thread_start_time); compositor_timing_history_->BeginMainFrameStarted(main_thread_start_time);
} }
...@@ -1011,11 +1010,9 @@ bool Scheduler::CanBeginMainFrameAndActivateBeforeDeadline( ...@@ -1011,11 +1010,9 @@ bool Scheduler::CanBeginMainFrameAndActivateBeforeDeadline(
return estimated_draw_time < args.deadline; return estimated_draw_time < args.deadline;
} }
bool Scheduler::IsBeginMainFrameSentOrStarted() const { bool Scheduler::IsBeginMainFrameSent() const {
return (state_machine_.begin_main_frame_state() == return state_machine_.begin_main_frame_state() ==
SchedulerStateMachine::BeginMainFrameState::SENT || SchedulerStateMachine::BeginMainFrameState::SENT;
state_machine_.begin_main_frame_state() ==
SchedulerStateMachine::BeginMainFrameState::STARTED);
} }
viz::BeginFrameAck Scheduler::CurrentBeginFrameAckForActiveTree() const { viz::BeginFrameAck Scheduler::CurrentBeginFrameAckForActiveTree() const {
......
...@@ -240,7 +240,7 @@ class CC_EXPORT Scheduler : public viz::BeginFrameObserverBase { ...@@ -240,7 +240,7 @@ class CC_EXPORT Scheduler : public viz::BeginFrameObserverBase {
void ClearHistory(); void ClearHistory();
bool IsBeginMainFrameSentOrStarted() const; bool IsBeginMainFrameSent() const;
protected: protected:
// Virtual for testing. // Virtual for testing.
......
...@@ -79,8 +79,6 @@ const char* SchedulerStateMachine::BeginMainFrameStateToString( ...@@ -79,8 +79,6 @@ const char* SchedulerStateMachine::BeginMainFrameStateToString(
return "BeginMainFrameState::IDLE"; return "BeginMainFrameState::IDLE";
case BeginMainFrameState::SENT: case BeginMainFrameState::SENT:
return "BeginMainFrameState::SENT"; return "BeginMainFrameState::SENT";
case BeginMainFrameState::STARTED:
return "BeginMainFrameState::STARTED";
case BeginMainFrameState::READY_TO_COMMIT: case BeginMainFrameState::READY_TO_COMMIT:
return "BeginMainFrameState::READY_TO_COMMIT"; return "BeginMainFrameState::READY_TO_COMMIT";
} }
...@@ -719,8 +717,7 @@ bool SchedulerStateMachine::ShouldDeferInvalidatingForMainFrame() const { ...@@ -719,8 +717,7 @@ bool SchedulerStateMachine::ShouldDeferInvalidatingForMainFrame() const {
return true; return true;
// If the main frame was already sent, wait for the main thread to respond. // If the main frame was already sent, wait for the main thread to respond.
if (begin_main_frame_state_ == BeginMainFrameState::SENT || if (begin_main_frame_state_ == BeginMainFrameState::SENT)
begin_main_frame_state_ == BeginMainFrameState::STARTED)
return true; return true;
// If the main thread committed during the last frame, i.e. it was not // If the main thread committed during the last frame, i.e. it was not
...@@ -1147,8 +1144,7 @@ void SchedulerStateMachine::OnBeginImplFrameIdle() { ...@@ -1147,8 +1144,7 @@ void SchedulerStateMachine::OnBeginImplFrameIdle() {
main_thread_missed_last_deadline_ = main_thread_missed_last_deadline_ =
CommitPending() || has_pending_tree_ || active_tree_needs_first_draw_; CommitPending() || has_pending_tree_ || active_tree_needs_first_draw_;
main_thread_failed_to_respond_last_deadline_ = main_thread_failed_to_respond_last_deadline_ =
begin_main_frame_state_ == BeginMainFrameState::SENT || begin_main_frame_state_ == BeginMainFrameState::SENT;
begin_main_frame_state_ == BeginMainFrameState::STARTED;
// If we're entering a state where we won't get BeginFrames set all the // 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. // funnels so that we don't perform any actions that we shouldn't.
...@@ -1377,7 +1373,7 @@ void SchedulerStateMachine::SetNeedsOneBeginImplFrame() { ...@@ -1377,7 +1373,7 @@ void SchedulerStateMachine::SetNeedsOneBeginImplFrame() {
} }
void SchedulerStateMachine::NotifyReadyToCommit() { void SchedulerStateMachine::NotifyReadyToCommit() {
DCHECK_EQ(begin_main_frame_state_, BeginMainFrameState::STARTED) DCHECK_EQ(begin_main_frame_state_, BeginMainFrameState::SENT)
<< AsValue()->ToString(); << AsValue()->ToString();
begin_main_frame_state_ = BeginMainFrameState::READY_TO_COMMIT; begin_main_frame_state_ = BeginMainFrameState::READY_TO_COMMIT;
// In commit_to_active_tree mode, commit should happen right after BeginFrame, // In commit_to_active_tree mode, commit should happen right after BeginFrame,
...@@ -1387,7 +1383,7 @@ void SchedulerStateMachine::NotifyReadyToCommit() { ...@@ -1387,7 +1383,7 @@ void SchedulerStateMachine::NotifyReadyToCommit() {
} }
void SchedulerStateMachine::BeginMainFrameAborted(CommitEarlyOutReason reason) { void SchedulerStateMachine::BeginMainFrameAborted(CommitEarlyOutReason reason) {
DCHECK_EQ(begin_main_frame_state_, BeginMainFrameState::STARTED); DCHECK_EQ(begin_main_frame_state_, BeginMainFrameState::SENT);
// If the main thread aborted, it doesn't matter if the main thread missed // If the main thread aborted, it doesn't matter if the main thread missed
// the last deadline since it didn't have an update anyway. // the last deadline since it didn't have an update anyway.
...@@ -1493,11 +1489,6 @@ void SchedulerStateMachine::DidCreateAndInitializeLayerTreeFrameSink() { ...@@ -1493,11 +1489,6 @@ void SchedulerStateMachine::DidCreateAndInitializeLayerTreeFrameSink() {
main_thread_missed_last_deadline_ = false; main_thread_missed_last_deadline_ = false;
} }
void SchedulerStateMachine::NotifyBeginMainFrameStarted() {
DCHECK_EQ(begin_main_frame_state_, BeginMainFrameState::SENT);
begin_main_frame_state_ = BeginMainFrameState::STARTED;
}
bool SchedulerStateMachine::HasInitializedLayerTreeFrameSink() const { bool SchedulerStateMachine::HasInitializedLayerTreeFrameSink() const {
switch (layer_tree_frame_sink_state_) { switch (layer_tree_frame_sink_state_) {
case LayerTreeFrameSinkState::NONE: case LayerTreeFrameSinkState::NONE:
......
...@@ -88,13 +88,15 @@ class CC_EXPORT SchedulerStateMachine { ...@@ -88,13 +88,15 @@ class CC_EXPORT SchedulerStateMachine {
BeginImplFrameDeadlineMode mode); BeginImplFrameDeadlineMode mode);
enum class BeginMainFrameState { enum class BeginMainFrameState {
IDLE, IDLE, // A new BeginMainFrame can start.
SENT, SENT, // A BeginMainFrame has already been issued.
STARTED, READY_TO_COMMIT, // A previously issued BeginMainFrame has been processed,
READY_TO_COMMIT, // and is ready to commit.
}; };
static const char* BeginMainFrameStateToString(BeginMainFrameState state); static const char* BeginMainFrameStateToString(BeginMainFrameState state);
// When a redraw is forced, it goes through a complete commit -> activation ->
// draw cycle. Until a redraw has been forced, it remains in IDLE state.
enum class ForcedRedrawOnTimeoutState { enum class ForcedRedrawOnTimeoutState {
IDLE, IDLE,
WAITING_FOR_COMMIT, WAITING_FOR_COMMIT,
...@@ -109,9 +111,7 @@ class CC_EXPORT SchedulerStateMachine { ...@@ -109,9 +111,7 @@ class CC_EXPORT SchedulerStateMachine {
} }
bool CommitPending() const { bool CommitPending() const {
return begin_main_frame_state_ == BeginMainFrameState::SENT || return begin_main_frame_state_ != BeginMainFrameState::IDLE;
begin_main_frame_state_ == BeginMainFrameState::STARTED ||
begin_main_frame_state_ == BeginMainFrameState::READY_TO_COMMIT;
} }
bool NewActiveTreeLikely() const { bool NewActiveTreeLikely() const {
...@@ -271,9 +271,6 @@ class CC_EXPORT SchedulerStateMachine { ...@@ -271,9 +271,6 @@ class CC_EXPORT SchedulerStateMachine {
// frame sink is not ready to receive frames. // frame sink is not ready to receive frames.
void SetSkipDraw(bool skip); void SetSkipDraw(bool skip);
// Indicates that scheduled BeginMainFrame is started.
void NotifyBeginMainFrameStarted();
// Indicates that the pending tree is ready for activation. Returns whether // Indicates that the pending tree is ready for activation. Returns whether
// the notification received updated the state for the current pending tree, // the notification received updated the state for the current pending tree,
// if any. // if any.
...@@ -383,6 +380,9 @@ class CC_EXPORT SchedulerStateMachine { ...@@ -383,6 +380,9 @@ class CC_EXPORT SchedulerStateMachine {
LayerTreeFrameSinkState::NONE; LayerTreeFrameSinkState::NONE;
BeginImplFrameState begin_impl_frame_state_ = BeginImplFrameState::IDLE; BeginImplFrameState begin_impl_frame_state_ = BeginImplFrameState::IDLE;
BeginMainFrameState begin_main_frame_state_ = BeginMainFrameState::IDLE; BeginMainFrameState begin_main_frame_state_ = BeginMainFrameState::IDLE;
// A redraw is forced when too many checkerboarded-frames are produced during
// an animation.
ForcedRedrawOnTimeoutState forced_redraw_state_ = ForcedRedrawOnTimeoutState forced_redraw_state_ =
ForcedRedrawOnTimeoutState::IDLE; ForcedRedrawOnTimeoutState::IDLE;
......
...@@ -75,7 +75,6 @@ const SchedulerStateMachine::BeginImplFrameState all_begin_impl_frame_states[] = ...@@ -75,7 +75,6 @@ const SchedulerStateMachine::BeginImplFrameState all_begin_impl_frame_states[] =
const SchedulerStateMachine::BeginMainFrameState begin_main_frame_states[] = { const SchedulerStateMachine::BeginMainFrameState begin_main_frame_states[] = {
SchedulerStateMachine::BeginMainFrameState::IDLE, SchedulerStateMachine::BeginMainFrameState::IDLE,
SchedulerStateMachine::BeginMainFrameState::SENT, SchedulerStateMachine::BeginMainFrameState::SENT,
SchedulerStateMachine::BeginMainFrameState::STARTED,
SchedulerStateMachine::BeginMainFrameState::READY_TO_COMMIT}; SchedulerStateMachine::BeginMainFrameState::READY_TO_COMMIT};
// Exposes the protected state fields of the SchedulerStateMachine for testing // Exposes the protected state fields of the SchedulerStateMachine for testing
...@@ -451,7 +450,6 @@ TEST(SchedulerStateMachineTest, MainFrameBeforeActivationEnabled) { ...@@ -451,7 +450,6 @@ TEST(SchedulerStateMachineTest, MainFrameBeforeActivationEnabled) {
SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME); SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME);
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
...@@ -469,7 +467,6 @@ TEST(SchedulerStateMachineTest, MainFrameBeforeActivationEnabled) { ...@@ -469,7 +467,6 @@ TEST(SchedulerStateMachineTest, MainFrameBeforeActivationEnabled) {
// Verify the pending commit doesn't overwrite the pending // Verify the pending commit doesn't overwrite the pending
// tree until the pending tree has been activated. // tree until the pending tree has been activated.
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
...@@ -562,7 +559,6 @@ TEST(SchedulerStateMachineTest, FailedDrawForMissingHighResNeedsCommit) { ...@@ -562,7 +559,6 @@ TEST(SchedulerStateMachineTest, FailedDrawForMissingHighResNeedsCommit) {
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
// Finish the commit and activation. // Finish the commit and activation.
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
...@@ -611,7 +607,6 @@ TEST(SchedulerStateMachineTest, ...@@ -611,7 +607,6 @@ TEST(SchedulerStateMachineTest,
// Finish the commit. Note, we should not yet be forcing a draw, but should // Finish the commit. Note, we should not yet be forcing a draw, but should
// continue the commit as usual. // continue the commit as usual.
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
...@@ -925,7 +920,6 @@ TEST(SchedulerStateMachineTest, ...@@ -925,7 +920,6 @@ TEST(SchedulerStateMachineTest,
EXPECT_ACTION_UPDATE_STATE( EXPECT_ACTION_UPDATE_STATE(
SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME); SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME);
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
state.NotifyReadyToActivate(); state.NotifyReadyToActivate();
...@@ -954,7 +948,6 @@ TEST(SchedulerStateMachineTest, TestSetNeedsBeginMainFrameIsNotLost) { ...@@ -954,7 +948,6 @@ TEST(SchedulerStateMachineTest, TestSetNeedsBeginMainFrameIsNotLost) {
EXPECT_TRUE(state.NeedsCommit()); EXPECT_TRUE(state.NeedsCommit());
// Let the frame finish. // Let the frame finish.
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_MAIN_FRAME_STATE( EXPECT_MAIN_FRAME_STATE(
SchedulerStateMachine::BeginMainFrameState::READY_TO_COMMIT); SchedulerStateMachine::BeginMainFrameState::READY_TO_COMMIT);
...@@ -1013,7 +1006,6 @@ TEST(SchedulerStateMachineTest, TestFullCycle) { ...@@ -1013,7 +1006,6 @@ TEST(SchedulerStateMachineTest, TestFullCycle) {
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
// Tell the scheduler the frame finished. // Tell the scheduler the frame finished.
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_MAIN_FRAME_STATE( EXPECT_MAIN_FRAME_STATE(
SchedulerStateMachine::BeginMainFrameState::READY_TO_COMMIT); SchedulerStateMachine::BeginMainFrameState::READY_TO_COMMIT);
...@@ -1054,7 +1046,6 @@ TEST(SchedulerStateMachineTest, CommitWithoutDrawWithPendingTree) { ...@@ -1054,7 +1046,6 @@ TEST(SchedulerStateMachineTest, CommitWithoutDrawWithPendingTree) {
state.IssueNextBeginImplFrame(); state.IssueNextBeginImplFrame();
EXPECT_ACTION_UPDATE_STATE( EXPECT_ACTION_UPDATE_STATE(
SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME); SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME);
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
state.NotifyReadyToActivate(); state.NotifyReadyToActivate();
...@@ -1067,7 +1058,6 @@ TEST(SchedulerStateMachineTest, CommitWithoutDrawWithPendingTree) { ...@@ -1067,7 +1058,6 @@ TEST(SchedulerStateMachineTest, CommitWithoutDrawWithPendingTree) {
state.IssueNextBeginImplFrame(); state.IssueNextBeginImplFrame();
EXPECT_ACTION_UPDATE_STATE( EXPECT_ACTION_UPDATE_STATE(
SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME); SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME);
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
} }
...@@ -1086,7 +1076,6 @@ TEST(SchedulerStateMachineTest, DontCommitWithoutDrawWithoutPendingTree) { ...@@ -1086,7 +1076,6 @@ TEST(SchedulerStateMachineTest, DontCommitWithoutDrawWithoutPendingTree) {
state.OnBeginImplFrame(0, 10, kAnimateOnly); state.OnBeginImplFrame(0, 10, kAnimateOnly);
EXPECT_ACTION_UPDATE_STATE( EXPECT_ACTION_UPDATE_STATE(
SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME); SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME);
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
state.NotifyReadyToActivate(); state.NotifyReadyToActivate();
...@@ -1111,7 +1100,6 @@ TEST(SchedulerStateMachineTest, AbortedMainFrameDoesNotResetPendingTree) { ...@@ -1111,7 +1100,6 @@ TEST(SchedulerStateMachineTest, AbortedMainFrameDoesNotResetPendingTree) {
EXPECT_ACTION_UPDATE_STATE( EXPECT_ACTION_UPDATE_STATE(
SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME); SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME);
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
...@@ -1127,7 +1115,6 @@ TEST(SchedulerStateMachineTest, AbortedMainFrameDoesNotResetPendingTree) { ...@@ -1127,7 +1115,6 @@ TEST(SchedulerStateMachineTest, AbortedMainFrameDoesNotResetPendingTree) {
SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME); SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME);
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
EXPECT_TRUE(state.has_pending_tree()); EXPECT_TRUE(state.has_pending_tree());
state.NotifyBeginMainFrameStarted();
state.BeginMainFrameAborted(CommitEarlyOutReason::FINISHED_NO_UPDATES); state.BeginMainFrameAborted(CommitEarlyOutReason::FINISHED_NO_UPDATES);
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
EXPECT_TRUE(state.has_pending_tree()); EXPECT_TRUE(state.has_pending_tree());
...@@ -1140,7 +1127,6 @@ TEST(SchedulerStateMachineTest, AbortedMainFrameDoesNotResetPendingTree) { ...@@ -1140,7 +1127,6 @@ TEST(SchedulerStateMachineTest, AbortedMainFrameDoesNotResetPendingTree) {
EXPECT_ACTION_UPDATE_STATE( EXPECT_ACTION_UPDATE_STATE(
SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME); SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME);
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
EXPECT_TRUE(state.has_pending_tree()); EXPECT_TRUE(state.has_pending_tree());
...@@ -1173,7 +1159,6 @@ TEST(SchedulerStateMachineTest, TestFullCycleWithCommitToActive) { ...@@ -1173,7 +1159,6 @@ TEST(SchedulerStateMachineTest, TestFullCycleWithCommitToActive) {
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
// Tell the scheduler the frame finished. // Tell the scheduler the frame finished.
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_MAIN_FRAME_STATE( EXPECT_MAIN_FRAME_STATE(
SchedulerStateMachine::BeginMainFrameState::READY_TO_COMMIT); SchedulerStateMachine::BeginMainFrameState::READY_TO_COMMIT);
...@@ -1212,7 +1197,6 @@ TEST(SchedulerStateMachineTest, TestFullCycleWithCommitToActive) { ...@@ -1212,7 +1197,6 @@ TEST(SchedulerStateMachineTest, TestFullCycleWithCommitToActive) {
state.DidReceiveCompositorFrameAck(); state.DidReceiveCompositorFrameAck();
EXPECT_ACTION_UPDATE_STATE( EXPECT_ACTION_UPDATE_STATE(
SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME); SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME);
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
state.NotifyReadyToActivate(); state.NotifyReadyToActivate();
...@@ -1253,7 +1237,6 @@ TEST(SchedulerStateMachineTest, TestFullCycleWithCommitRequestInbetween) { ...@@ -1253,7 +1237,6 @@ TEST(SchedulerStateMachineTest, TestFullCycleWithCommitRequestInbetween) {
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
// Tell the scheduler the frame finished. // Tell the scheduler the frame finished.
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_MAIN_FRAME_STATE( EXPECT_MAIN_FRAME_STATE(
SchedulerStateMachine::BeginMainFrameState::READY_TO_COMMIT); SchedulerStateMachine::BeginMainFrameState::READY_TO_COMMIT);
...@@ -1352,7 +1335,6 @@ TEST(SchedulerStateMachineTest, TestAbortBeginMainFrameBecauseInvisible) { ...@@ -1352,7 +1335,6 @@ TEST(SchedulerStateMachineTest, TestAbortBeginMainFrameBecauseInvisible) {
// Become invisible and abort BeginMainFrame. // Become invisible and abort BeginMainFrame.
state.SetVisible(false); state.SetVisible(false);
state.NotifyBeginMainFrameStarted();
state.BeginMainFrameAborted(CommitEarlyOutReason::ABORTED_NOT_VISIBLE); state.BeginMainFrameAborted(CommitEarlyOutReason::ABORTED_NOT_VISIBLE);
// NeedsCommit should now be true again because we never actually did a // NeedsCommit should now be true again because we never actually did a
...@@ -1408,7 +1390,6 @@ TEST(SchedulerStateMachineTest, TestAbortBeginMainFrameBecauseCommitNotNeeded) { ...@@ -1408,7 +1390,6 @@ TEST(SchedulerStateMachineTest, TestAbortBeginMainFrameBecauseCommitNotNeeded) {
// Abort the commit, true means that the BeginMainFrame was sent but there // Abort the commit, true means that the BeginMainFrame was sent but there
// was no work to do on the main thread. // was no work to do on the main thread.
state.NotifyBeginMainFrameStarted();
state.BeginMainFrameAborted(CommitEarlyOutReason::FINISHED_NO_UPDATES); state.BeginMainFrameAborted(CommitEarlyOutReason::FINISHED_NO_UPDATES);
// NeedsCommit should now be false because the commit was actually handled. // NeedsCommit should now be false because the commit was actually handled.
...@@ -1536,7 +1517,6 @@ TEST(SchedulerStateMachineTest, ...@@ -1536,7 +1517,6 @@ TEST(SchedulerStateMachineTest,
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
// Finish the commit, which should make the surface active. // Finish the commit, which should make the surface active.
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
EXPECT_EQ(state.layer_tree_frame_sink_state(), EXPECT_EQ(state.layer_tree_frame_sink_state(),
...@@ -1586,7 +1566,6 @@ TEST(SchedulerStateMachineTest, ...@@ -1586,7 +1566,6 @@ TEST(SchedulerStateMachineTest,
SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME); SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME);
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
// Activate so we need the first draw // Activate so we need the first draw
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
state.NotifyReadyToActivate(); state.NotifyReadyToActivate();
...@@ -1632,7 +1611,6 @@ TEST(SchedulerStateMachineTest, TestContextLostWhileCommitInProgress) { ...@@ -1632,7 +1611,6 @@ TEST(SchedulerStateMachineTest, TestContextLostWhileCommitInProgress) {
EXPECT_ACTION(SchedulerStateMachine::Action::NONE); EXPECT_ACTION(SchedulerStateMachine::Action::NONE);
// Finish the frame, commit and activate. // Finish the frame, commit and activate.
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
state.NotifyReadyToActivate(); state.NotifyReadyToActivate();
...@@ -1690,7 +1668,6 @@ TEST(SchedulerStateMachineTest, ...@@ -1690,7 +1668,6 @@ TEST(SchedulerStateMachineTest,
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
// Finish the frame, and commit and activate. // Finish the frame, and commit and activate.
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
state.NotifyReadyToActivate(); state.NotifyReadyToActivate();
...@@ -1725,7 +1702,6 @@ TEST(SchedulerStateMachineTest, ...@@ -1725,7 +1702,6 @@ TEST(SchedulerStateMachineTest,
EXPECT_ACTION_UPDATE_STATE( EXPECT_ACTION_UPDATE_STATE(
SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME); SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME);
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
...@@ -1771,7 +1747,6 @@ TEST(SchedulerStateMachineTest, ...@@ -1771,7 +1747,6 @@ TEST(SchedulerStateMachineTest,
// Cause a lost context. // Cause a lost context.
state.DidLoseLayerTreeFrameSink(); state.DidLoseLayerTreeFrameSink();
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
...@@ -1838,7 +1813,6 @@ TEST(SchedulerStateMachineTest, TestFinishCommitWhenCommitInProgress) { ...@@ -1838,7 +1813,6 @@ TEST(SchedulerStateMachineTest, TestFinishCommitWhenCommitInProgress) {
// After the commit completes, activation and draw happen immediately // After the commit completes, activation and draw happen immediately
// because we are not visible. // because we are not visible.
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::ACTIVATE_SYNC_TREE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::ACTIVATE_SYNC_TREE);
...@@ -1863,7 +1837,6 @@ TEST(SchedulerStateMachineTest, ...@@ -1863,7 +1837,6 @@ TEST(SchedulerStateMachineTest,
// After the commit completes, activation and draw happen immediately // After the commit completes, activation and draw happen immediately
// because we are not visible. // because we are not visible.
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_TRUE(state.ShouldAbortCurrentFrame()); EXPECT_TRUE(state.ShouldAbortCurrentFrame());
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
...@@ -1996,7 +1969,6 @@ TEST(SchedulerStateMachineTest, ...@@ -1996,7 +1969,6 @@ TEST(SchedulerStateMachineTest,
// Since only the scroll offset changed, the main thread will abort the // Since only the scroll offset changed, the main thread will abort the
// commit. // commit.
state.NotifyBeginMainFrameStarted();
state.BeginMainFrameAborted(CommitEarlyOutReason::FINISHED_NO_UPDATES); state.BeginMainFrameAborted(CommitEarlyOutReason::FINISHED_NO_UPDATES);
// Since the commit was aborted, we should draw right away instead of waiting // Since the commit was aborted, we should draw right away instead of waiting
...@@ -2009,7 +1981,6 @@ void FinishPreviousCommitAndDrawWithoutExitingDeadline( ...@@ -2009,7 +1981,6 @@ void FinishPreviousCommitAndDrawWithoutExitingDeadline(
// Gross, but allows us to use macros below. // Gross, but allows us to use macros below.
StateMachine& state = *state_ptr; StateMachine& state = *state_ptr;
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
...@@ -2202,7 +2173,6 @@ TEST(SchedulerStateMachineTest, ...@@ -2202,7 +2173,6 @@ TEST(SchedulerStateMachineTest,
// Abort the commit, since that is what we expect the main thread to do if the // Abort the commit, since that is what we expect the main thread to do if the
// LayerTreeFrameSink was lost due to a synchronous call from the main thread // LayerTreeFrameSink was lost due to a synchronous call from the main thread
// to release the LayerTreeFrameSink. // to release the LayerTreeFrameSink.
state.NotifyBeginMainFrameStarted();
state.BeginMainFrameAborted( state.BeginMainFrameAborted(
CommitEarlyOutReason::ABORTED_LAYER_TREE_FRAME_SINK_LOST); CommitEarlyOutReason::ABORTED_LAYER_TREE_FRAME_SINK_LOST);
...@@ -2284,7 +2254,6 @@ TEST(SchedulerStateMachineTest, ...@@ -2284,7 +2254,6 @@ TEST(SchedulerStateMachineTest,
state.IssueNextBeginImplFrame(); state.IssueNextBeginImplFrame();
EXPECT_ACTION_UPDATE_STATE( EXPECT_ACTION_UPDATE_STATE(
SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME); SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME);
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
state.NotifyReadyToActivate(); state.NotifyReadyToActivate();
...@@ -2312,7 +2281,6 @@ TEST(SchedulerStateMachineTest, ...@@ -2312,7 +2281,6 @@ TEST(SchedulerStateMachineTest,
state.IssueNextBeginImplFrame(); state.IssueNextBeginImplFrame();
EXPECT_ACTION_UPDATE_STATE( EXPECT_ACTION_UPDATE_STATE(
SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME); SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME);
state.NotifyBeginMainFrameStarted();
state.BeginMainFrameAborted(CommitEarlyOutReason::FINISHED_NO_UPDATES); state.BeginMainFrameAborted(CommitEarlyOutReason::FINISHED_NO_UPDATES);
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
state.OnBeginImplFrameDeadline(); state.OnBeginImplFrameDeadline();
...@@ -2374,7 +2342,6 @@ TEST(SchedulerStateMachineTest, NoImplSideInvalidationUntilFrameSinkActive) { ...@@ -2374,7 +2342,6 @@ TEST(SchedulerStateMachineTest, NoImplSideInvalidationUntilFrameSinkActive) {
// No impl side invalidation because we're still waiting for first commit. // No impl side invalidation because we're still waiting for first commit.
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
...@@ -2417,7 +2384,6 @@ TEST(SchedulerStateMachineTest, ImplSideInvalidationWhenPendingTreeExists) { ...@@ -2417,7 +2384,6 @@ TEST(SchedulerStateMachineTest, ImplSideInvalidationWhenPendingTreeExists) {
state.IssueNextBeginImplFrame(); state.IssueNextBeginImplFrame();
EXPECT_ACTION_UPDATE_STATE( EXPECT_ACTION_UPDATE_STATE(
SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME); SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME);
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
...@@ -2457,7 +2423,6 @@ TEST(SchedulerStateMachineTest, ImplSideInvalidationWhileReadyToCommit) { ...@@ -2457,7 +2423,6 @@ TEST(SchedulerStateMachineTest, ImplSideInvalidationWhileReadyToCommit) {
EXPECT_ACTION_UPDATE_STATE( EXPECT_ACTION_UPDATE_STATE(
SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME); SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME);
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
// Request an impl-side invalidation after we are ready to commit. The // Request an impl-side invalidation after we are ready to commit. The
...@@ -2514,7 +2479,6 @@ TEST(SchedulerStateMachineTest, ImplSideInvalidationsThrottledOnDraw) { ...@@ -2514,7 +2479,6 @@ TEST(SchedulerStateMachineTest, ImplSideInvalidationsThrottledOnDraw) {
state.IssueNextBeginImplFrame(); state.IssueNextBeginImplFrame();
EXPECT_ACTION_UPDATE_STATE( EXPECT_ACTION_UPDATE_STATE(
SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME); SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME);
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
state.NotifyReadyToActivate(); state.NotifyReadyToActivate();
...@@ -2596,7 +2560,6 @@ TEST(SchedulerStateMachineTest, TestFullPipelineMode) { ...@@ -2596,7 +2560,6 @@ TEST(SchedulerStateMachineTest, TestFullPipelineMode) {
state.CurrentBeginImplFrameDeadlineMode()); state.CurrentBeginImplFrameDeadlineMode());
// Tell the scheduler the frame finished. // Tell the scheduler the frame finished.
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_MAIN_FRAME_STATE( EXPECT_MAIN_FRAME_STATE(
SchedulerStateMachine::BeginMainFrameState::READY_TO_COMMIT); SchedulerStateMachine::BeginMainFrameState::READY_TO_COMMIT);
...@@ -2687,7 +2650,6 @@ TEST(SchedulerStateMachineTest, TestFullPipelineMode) { ...@@ -2687,7 +2650,6 @@ TEST(SchedulerStateMachineTest, TestFullPipelineMode) {
state.CurrentBeginImplFrameDeadlineMode()); state.CurrentBeginImplFrameDeadlineMode());
// Abort commit and ensure that we don't block anymore. // Abort commit and ensure that we don't block anymore.
state.NotifyBeginMainFrameStarted();
state.BeginMainFrameAborted(CommitEarlyOutReason::FINISHED_NO_UPDATES); state.BeginMainFrameAborted(CommitEarlyOutReason::FINISHED_NO_UPDATES);
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
EXPECT_MAIN_FRAME_STATE(SchedulerStateMachine::BeginMainFrameState::IDLE); EXPECT_MAIN_FRAME_STATE(SchedulerStateMachine::BeginMainFrameState::IDLE);
...@@ -2717,7 +2679,6 @@ TEST(SchedulerStateMachineTest, AllowSkippingActiveTreeFirstDraws) { ...@@ -2717,7 +2679,6 @@ TEST(SchedulerStateMachineTest, AllowSkippingActiveTreeFirstDraws) {
state.OnBeginImplFrame(0, 2, kAnimateOnly); state.OnBeginImplFrame(0, 2, kAnimateOnly);
EXPECT_ACTION_UPDATE_STATE( EXPECT_ACTION_UPDATE_STATE(
SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME); SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME);
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
...@@ -2737,7 +2698,6 @@ TEST(SchedulerStateMachineTest, DelayDrawIfAnimationWorkletsPending) { ...@@ -2737,7 +2698,6 @@ TEST(SchedulerStateMachineTest, DelayDrawIfAnimationWorkletsPending) {
state.OnBeginImplFrame(0, 10, kAnimateOnly); state.OnBeginImplFrame(0, 10, kAnimateOnly);
EXPECT_ACTION_UPDATE_STATE( EXPECT_ACTION_UPDATE_STATE(
SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME); SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME);
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
state.NotifyReadyToActivate(); state.NotifyReadyToActivate();
...@@ -2802,7 +2762,6 @@ TEST(SchedulerStateMachineTest, BlockActivationIfAnimationWorkletsPending) { ...@@ -2802,7 +2762,6 @@ TEST(SchedulerStateMachineTest, BlockActivationIfAnimationWorkletsPending) {
state.OnBeginImplFrame(0, 10, kAnimateOnly); state.OnBeginImplFrame(0, 10, kAnimateOnly);
EXPECT_ACTION_UPDATE_STATE( EXPECT_ACTION_UPDATE_STATE(
SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME); SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME);
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
state.NotifyAnimationWorkletStateChange( state.NotifyAnimationWorkletStateChange(
...@@ -2825,7 +2784,6 @@ TEST(SchedulerStateMachineTest, BlockActivationIfPaintWorkletsPending) { ...@@ -2825,7 +2784,6 @@ TEST(SchedulerStateMachineTest, BlockActivationIfPaintWorkletsPending) {
state.OnBeginImplFrame(0, 10, kAnimateOnly); state.OnBeginImplFrame(0, 10, kAnimateOnly);
EXPECT_ACTION_UPDATE_STATE( EXPECT_ACTION_UPDATE_STATE(
SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME); SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME);
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
...@@ -2853,7 +2811,6 @@ TEST(SchedulerStateMachineTest, ...@@ -2853,7 +2811,6 @@ TEST(SchedulerStateMachineTest,
state.OnBeginImplFrame(0, 10, kAnimateOnly); state.OnBeginImplFrame(0, 10, kAnimateOnly);
EXPECT_ACTION_UPDATE_STATE( EXPECT_ACTION_UPDATE_STATE(
SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME); SchedulerStateMachine::Action::SEND_BEGIN_MAIN_FRAME);
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::COMMIT);
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::Action::NONE);
......
...@@ -395,7 +395,7 @@ bool ProxyImpl::IsBeginMainFrameExpected() { ...@@ -395,7 +395,7 @@ bool ProxyImpl::IsBeginMainFrameExpected() {
// not responded to a previously dispatched BeginMainFrame, then assume that // not responded to a previously dispatched BeginMainFrame, then assume that
// main-thread would want to produce an update for the current frame too. // main-thread would want to produce an update for the current frame too.
return scheduler_->needs_begin_main_frame() || return scheduler_->needs_begin_main_frame() ||
scheduler_->IsBeginMainFrameSentOrStarted(); scheduler_->IsBeginMainFrameSent();
} }
void ProxyImpl::RenewTreePriority() { void ProxyImpl::RenewTreePriority() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment