cc: Rename FinishCommit to NotifyReadyToCommit

FinishCommit() is used to inform that painting is complete and we can
ready to commit to scheduler.
So, NotifyReadyToCommit() is more suitable for its role.

R=brianderson@chromium.org
BUG=349889
TEST=None (No functional change)

Review URL: https://codereview.chromium.org/191293004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255895 0039d316-1c4b-4281-b951-d872f2087c98
parent 298287da
...@@ -91,9 +91,9 @@ void Scheduler::SetMainThreadNeedsLayerTextures() { ...@@ -91,9 +91,9 @@ void Scheduler::SetMainThreadNeedsLayerTextures() {
ProcessScheduledActions(); ProcessScheduledActions();
} }
void Scheduler::FinishCommit() { void Scheduler::NotifyReadyToCommit() {
TRACE_EVENT0("cc", "Scheduler::FinishCommit"); TRACE_EVENT0("cc", "Scheduler::NotifyReadyToCommit");
state_machine_.FinishCommit(); state_machine_.NotifyReadyToCommit();
ProcessScheduledActions(); ProcessScheduledActions();
} }
......
...@@ -81,7 +81,7 @@ class CC_EXPORT Scheduler { ...@@ -81,7 +81,7 @@ class CC_EXPORT Scheduler {
void SetSmoothnessTakesPriority(bool smoothness_takes_priority); void SetSmoothnessTakesPriority(bool smoothness_takes_priority);
void FinishCommit(); void NotifyReadyToCommit();
void BeginMainFrameAborted(bool did_handle); void BeginMainFrameAborted(bool did_handle);
void DidManageTiles(); void DidManageTiles();
......
...@@ -1104,7 +1104,7 @@ void SchedulerStateMachine::SetNeedsForcedCommitForReadback() { ...@@ -1104,7 +1104,7 @@ void SchedulerStateMachine::SetNeedsForcedCommitForReadback() {
} }
} }
void SchedulerStateMachine::FinishCommit() { void SchedulerStateMachine::NotifyReadyToCommit() {
DCHECK(commit_state_ == COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED) << *AsValue(); DCHECK(commit_state_ == COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED) << *AsValue();
commit_state_ = COMMIT_STATE_READY_TO_COMMIT; commit_state_ = COMMIT_STATE_READY_TO_COMMIT;
} }
......
...@@ -199,7 +199,7 @@ class CC_EXPORT SchedulerStateMachine { ...@@ -199,7 +199,7 @@ class CC_EXPORT SchedulerStateMachine {
// Call this only in response to receiving an ACTION_SEND_BEGIN_MAIN_FRAME // Call this only in response to receiving an ACTION_SEND_BEGIN_MAIN_FRAME
// from NextAction. // from NextAction.
// Indicates that all painting is complete. // Indicates that all painting is complete.
void FinishCommit(); void NotifyReadyToCommit();
// Call this only in response to receiving an ACTION_SEND_BEGIN_MAIN_FRAME // Call this only in response to receiving an ACTION_SEND_BEGIN_MAIN_FRAME
// from NextAction if the client rejects the BeginMainFrame message. // from NextAction if the client rejects the BeginMainFrame message.
......
...@@ -326,7 +326,7 @@ TEST(SchedulerStateMachineTest, ...@@ -326,7 +326,7 @@ 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.NotifyBeginMainFrameStarted();
state.FinishCommit(); 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);
EXPECT_TRUE(state.RedrawPending()); EXPECT_TRUE(state.RedrawPending());
...@@ -382,7 +382,7 @@ TEST(SchedulerStateMachineTest, TestFailedDrawsDoNotRestartForcedDraw) { ...@@ -382,7 +382,7 @@ TEST(SchedulerStateMachineTest, TestFailedDrawsDoNotRestartForcedDraw) {
SchedulerStateMachine::FORCED_REDRAW_STATE_WAITING_FOR_COMMIT); SchedulerStateMachine::FORCED_REDRAW_STATE_WAITING_FOR_COMMIT);
state.NotifyBeginMainFrameStarted(); state.NotifyBeginMainFrameStarted();
state.FinishCommit(); 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);
EXPECT_TRUE(state.RedrawPending()); EXPECT_TRUE(state.RedrawPending());
...@@ -656,7 +656,7 @@ TEST(SchedulerStateMachineTest, ...@@ -656,7 +656,7 @@ 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);
state.NotifyBeginMainFrameStarted(); state.NotifyBeginMainFrameStarted();
state.FinishCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
state.OnBeginImplFrameDeadline(); state.OnBeginImplFrameDeadline();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_AND_SWAP_ABORT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_AND_SWAP_ABORT);
...@@ -688,7 +688,7 @@ TEST(SchedulerStateMachineTest, TestsetNeedsCommitIsNotLost) { ...@@ -688,7 +688,7 @@ TEST(SchedulerStateMachineTest, TestsetNeedsCommitIsNotLost) {
// Let the frame finish. // Let the frame finish.
state.NotifyBeginMainFrameStarted(); state.NotifyBeginMainFrameStarted();
state.FinishCommit(); state.NotifyReadyToCommit();
EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_READY_TO_COMMIT, EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_READY_TO_COMMIT,
state.CommitState()); state.CommitState());
...@@ -756,7 +756,7 @@ TEST(SchedulerStateMachineTest, TestFullCycle) { ...@@ -756,7 +756,7 @@ TEST(SchedulerStateMachineTest, TestFullCycle) {
// Tell the scheduler the frame finished. // Tell the scheduler the frame finished.
state.NotifyBeginMainFrameStarted(); state.NotifyBeginMainFrameStarted();
state.FinishCommit(); state.NotifyReadyToCommit();
EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_READY_TO_COMMIT, EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_READY_TO_COMMIT,
state.CommitState()); state.CommitState());
...@@ -808,7 +808,7 @@ TEST(SchedulerStateMachineTest, TestFullCycleWithCommitRequestInbetween) { ...@@ -808,7 +808,7 @@ TEST(SchedulerStateMachineTest, TestFullCycleWithCommitRequestInbetween) {
// Tell the scheduler the frame finished. // Tell the scheduler the frame finished.
state.NotifyBeginMainFrameStarted(); state.NotifyBeginMainFrameStarted();
state.FinishCommit(); state.NotifyReadyToCommit();
EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_READY_TO_COMMIT, EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_READY_TO_COMMIT,
state.CommitState()); state.CommitState());
...@@ -1046,7 +1046,7 @@ TEST(SchedulerStateMachineTest, ...@@ -1046,7 +1046,7 @@ TEST(SchedulerStateMachineTest,
state.CommitState()); state.CommitState());
state.NotifyBeginMainFrameStarted(); state.NotifyBeginMainFrameStarted();
state.FinishCommit(); 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);
// Finishing the first commit after initializing an output surface should // Finishing the first commit after initializing an output surface should
...@@ -1100,7 +1100,7 @@ TEST(SchedulerStateMachineTest, TestContextLostWhileCommitInProgress) { ...@@ -1100,7 +1100,7 @@ TEST(SchedulerStateMachineTest, TestContextLostWhileCommitInProgress) {
// Finish the frame, and commit. // Finish the frame, and commit.
state.NotifyBeginMainFrameStarted(); state.NotifyBeginMainFrameStarted();
state.FinishCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
// We will abort the draw when the output surface is lost if we are // We will abort the draw when the output surface is lost if we are
...@@ -1166,7 +1166,7 @@ TEST(SchedulerStateMachineTest, ...@@ -1166,7 +1166,7 @@ TEST(SchedulerStateMachineTest,
// Finish the frame, and commit. // Finish the frame, and commit.
state.NotifyBeginMainFrameStarted(); state.NotifyBeginMainFrameStarted();
state.FinishCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW, EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW,
state.CommitState()); state.CommitState());
...@@ -1206,7 +1206,7 @@ TEST(SchedulerStateMachineTest, ...@@ -1206,7 +1206,7 @@ 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);
state.NotifyBeginMainFrameStarted(); state.NotifyBeginMainFrameStarted();
state.FinishCommit(); 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);
state.OnBeginImplFrameDeadline(); state.OnBeginImplFrameDeadline();
...@@ -1240,7 +1240,7 @@ TEST(SchedulerStateMachineTest, TestFinishAllRenderingWhileContextLost) { ...@@ -1240,7 +1240,7 @@ TEST(SchedulerStateMachineTest, TestFinishAllRenderingWhileContextLost) {
EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT, EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT,
state.CommitState()); state.CommitState());
state.NotifyBeginMainFrameStarted(); state.NotifyBeginMainFrameStarted();
state.FinishCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
// We don't yet have an output surface, so we the draw and swap should abort. // We don't yet have an output surface, so we the draw and swap should abort.
...@@ -1306,7 +1306,7 @@ TEST(SchedulerStateMachineTest, ...@@ -1306,7 +1306,7 @@ TEST(SchedulerStateMachineTest,
state.DidLoseOutputSurface(); state.DidLoseOutputSurface();
state.NotifyBeginMainFrameStarted(); state.NotifyBeginMainFrameStarted();
state.FinishCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
EXPECT_TRUE(state.PendingActivationsShouldBeForced()); EXPECT_TRUE(state.PendingActivationsShouldBeForced());
...@@ -1360,7 +1360,7 @@ TEST(SchedulerStateMachineTest, DontMakeNewCommitAfterDrawingReplaceCommit) { ...@@ -1360,7 +1360,7 @@ TEST(SchedulerStateMachineTest, DontMakeNewCommitAfterDrawingReplaceCommit) {
state.SetNeedsForcedCommitForReadback(); state.SetNeedsForcedCommitForReadback();
state.NotifyBeginMainFrameStarted(); state.NotifyBeginMainFrameStarted();
state.FinishCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_AND_READBACK, EXPECT_EQ(SchedulerStateMachine::ACTION_DRAW_AND_READBACK,
state.NextAction()); state.NextAction());
...@@ -1373,7 +1373,7 @@ TEST(SchedulerStateMachineTest, DontMakeNewCommitAfterDrawingReplaceCommit) { ...@@ -1373,7 +1373,7 @@ TEST(SchedulerStateMachineTest, DontMakeNewCommitAfterDrawingReplaceCommit) {
// Finish the replacement commit. // Finish the replacement commit.
state.NotifyBeginMainFrameStarted(); state.NotifyBeginMainFrameStarted();
state.FinishCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting()); state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
...@@ -1397,7 +1397,7 @@ TEST(SchedulerStateMachineTest, TestFinishCommitWhenCommitInProgress) { ...@@ -1397,7 +1397,7 @@ TEST(SchedulerStateMachineTest, TestFinishCommitWhenCommitInProgress) {
state.SetNeedsCommit(); state.SetNeedsCommit();
state.NotifyBeginMainFrameStarted(); state.NotifyBeginMainFrameStarted();
state.FinishCommit(); state.NotifyReadyToCommit();
EXPECT_EQ(SchedulerStateMachine::ACTION_COMMIT, state.NextAction()); EXPECT_EQ(SchedulerStateMachine::ACTION_COMMIT, state.NextAction());
state.UpdateState(state.NextAction()); state.UpdateState(state.NextAction());
...@@ -1419,7 +1419,7 @@ TEST(SchedulerStateMachineTest, TestFinishCommitWhenForcedCommitInProgress) { ...@@ -1419,7 +1419,7 @@ TEST(SchedulerStateMachineTest, TestFinishCommitWhenForcedCommitInProgress) {
// The commit for readback interupts the normal commit. // The commit for readback interupts the normal commit.
state.NotifyBeginMainFrameStarted(); state.NotifyBeginMainFrameStarted();
state.FinishCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW, EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW,
...@@ -1433,7 +1433,7 @@ TEST(SchedulerStateMachineTest, TestFinishCommitWhenForcedCommitInProgress) { ...@@ -1433,7 +1433,7 @@ TEST(SchedulerStateMachineTest, TestFinishCommitWhenForcedCommitInProgress) {
// The normal commit can then proceed. // The normal commit can then proceed.
state.NotifyBeginMainFrameStarted(); state.NotifyBeginMainFrameStarted();
state.FinishCommit(); state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
} }
...@@ -1488,7 +1488,7 @@ TEST(SchedulerStateMachineTest, TestImmediateFinishCommit) { ...@@ -1488,7 +1488,7 @@ TEST(SchedulerStateMachineTest, TestImmediateFinishCommit) {
SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME); SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
state.NotifyBeginMainFrameStarted(); state.NotifyBeginMainFrameStarted();
state.FinishCommit(); state.NotifyReadyToCommit();
EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_READY_TO_COMMIT, EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_READY_TO_COMMIT,
state.CommitState()); state.CommitState());
...@@ -1526,7 +1526,7 @@ TEST(SchedulerStateMachineTest, TestImmediateFinishCommitDuringCommit) { ...@@ -1526,7 +1526,7 @@ TEST(SchedulerStateMachineTest, TestImmediateFinishCommitDuringCommit) {
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.NotifyBeginMainFrameStarted();
state.FinishCommit(); state.NotifyReadyToCommit();
EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_READY_TO_COMMIT, EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_READY_TO_COMMIT,
state.CommitState()); state.CommitState());
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT); EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
...@@ -1560,7 +1560,7 @@ TEST(SchedulerStateMachineTest, ImmediateBeginMainFrameAbortedWhileInvisible) { ...@@ -1560,7 +1560,7 @@ TEST(SchedulerStateMachineTest, ImmediateBeginMainFrameAbortedWhileInvisible) {
EXPECT_ACTION_UPDATE_STATE( EXPECT_ACTION_UPDATE_STATE(
SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME); SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
state.NotifyBeginMainFrameStarted(); state.NotifyBeginMainFrameStarted();
state.FinishCommit(); state.NotifyReadyToCommit();
EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_READY_TO_COMMIT, EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_READY_TO_COMMIT,
state.CommitState()); state.CommitState());
...@@ -1602,7 +1602,7 @@ TEST(SchedulerStateMachineTest, ImmediateFinishCommitWhileCantDraw) { ...@@ -1602,7 +1602,7 @@ TEST(SchedulerStateMachineTest, ImmediateFinishCommitWhileCantDraw) {
state.SetNeedsForcedCommitForReadback(); state.SetNeedsForcedCommitForReadback();
state.UpdateState(state.NextAction()); state.UpdateState(state.NextAction());
state.NotifyBeginMainFrameStarted(); state.NotifyBeginMainFrameStarted();
state.FinishCommit(); state.NotifyReadyToCommit();
EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_READY_TO_COMMIT, EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_READY_TO_COMMIT,
state.CommitState()); state.CommitState());
...@@ -1668,7 +1668,7 @@ TEST(SchedulerStateMachineTest, ReportIfNotDrawingFromAcquiredTextures) { ...@@ -1668,7 +1668,7 @@ TEST(SchedulerStateMachineTest, ReportIfNotDrawingFromAcquiredTextures) {
EXPECT_EQ(SchedulerStateMachine::ACTION_NONE, state.NextAction()); EXPECT_EQ(SchedulerStateMachine::ACTION_NONE, state.NextAction());
state.NotifyBeginMainFrameStarted(); state.NotifyBeginMainFrameStarted();
state.FinishCommit(); state.NotifyReadyToCommit();
EXPECT_TRUE(state.PendingDrawsShouldBeAborted()); EXPECT_TRUE(state.PendingDrawsShouldBeAborted());
EXPECT_EQ(SchedulerStateMachine::ACTION_COMMIT, state.NextAction()); EXPECT_EQ(SchedulerStateMachine::ACTION_COMMIT, state.NextAction());
......
...@@ -35,7 +35,7 @@ void InitializeOutputSurfaceAndFirstCommit(Scheduler* scheduler) { ...@@ -35,7 +35,7 @@ void InitializeOutputSurfaceAndFirstCommit(Scheduler* scheduler) {
scheduler->DidCreateAndInitializeOutputSurface(); scheduler->DidCreateAndInitializeOutputSurface();
scheduler->SetNeedsCommit(); scheduler->SetNeedsCommit();
scheduler->NotifyBeginMainFrameStarted(); scheduler->NotifyBeginMainFrameStarted();
scheduler->FinishCommit(); scheduler->NotifyReadyToCommit();
// Go through the motions to draw the commit. // Go through the motions to draw the commit.
scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
scheduler->OnBeginImplFrameDeadline(); scheduler->OnBeginImplFrameDeadline();
...@@ -238,9 +238,9 @@ TEST(SchedulerTest, RequestCommit) { ...@@ -238,9 +238,9 @@ TEST(SchedulerTest, RequestCommit) {
EXPECT_TRUE(client.needs_begin_impl_frame()); EXPECT_TRUE(client.needs_begin_impl_frame());
client.Reset(); client.Reset();
// FinishCommit should commit // NotifyReadyToCommit should trigger the commit.
scheduler->NotifyBeginMainFrameStarted(); scheduler->NotifyBeginMainFrameStarted();
scheduler->FinishCommit(); scheduler->NotifyReadyToCommit();
EXPECT_SINGLE_ACTION("ScheduledActionCommit", client); EXPECT_SINGLE_ACTION("ScheduledActionCommit", client);
EXPECT_TRUE(client.needs_begin_impl_frame()); EXPECT_TRUE(client.needs_begin_impl_frame());
client.Reset(); client.Reset();
...@@ -302,7 +302,7 @@ TEST(SchedulerTest, RequestCommitAfterBeginMainFrameSent) { ...@@ -302,7 +302,7 @@ TEST(SchedulerTest, RequestCommitAfterBeginMainFrameSent) {
// Finish the first commit. // Finish the first commit.
scheduler->NotifyBeginMainFrameStarted(); scheduler->NotifyBeginMainFrameStarted();
scheduler->FinishCommit(); scheduler->NotifyReadyToCommit();
EXPECT_ACTION("ScheduledActionCommit", client, 0, 2); EXPECT_ACTION("ScheduledActionCommit", client, 0, 2);
EXPECT_ACTION("PostBeginImplFrameDeadlineTask", client, 1, 2); EXPECT_ACTION("PostBeginImplFrameDeadlineTask", client, 1, 2);
client.Reset(); client.Reset();
...@@ -326,7 +326,7 @@ TEST(SchedulerTest, RequestCommitAfterBeginMainFrameSent) { ...@@ -326,7 +326,7 @@ TEST(SchedulerTest, RequestCommitAfterBeginMainFrameSent) {
// Finishing the commit before the deadline should post a new deadline task // Finishing the commit before the deadline should post a new deadline task
// to trigger the deadline early. // to trigger the deadline early.
scheduler->NotifyBeginMainFrameStarted(); scheduler->NotifyBeginMainFrameStarted();
scheduler->FinishCommit(); scheduler->NotifyReadyToCommit();
EXPECT_ACTION("ScheduledActionCommit", client, 0, 2); EXPECT_ACTION("ScheduledActionCommit", client, 0, 2);
EXPECT_ACTION("PostBeginImplFrameDeadlineTask", client, 1, 2); EXPECT_ACTION("PostBeginImplFrameDeadlineTask", client, 1, 2);
client.Reset(); client.Reset();
...@@ -413,7 +413,7 @@ TEST(SchedulerTest, TextureAcquisitionCausesCommitInsteadOfDraw) { ...@@ -413,7 +413,7 @@ TEST(SchedulerTest, TextureAcquisitionCausesCommitInsteadOfDraw) {
// Commit will release the texture. // Commit will release the texture.
client.Reset(); client.Reset();
scheduler->NotifyBeginMainFrameStarted(); scheduler->NotifyBeginMainFrameStarted();
scheduler->FinishCommit(); scheduler->NotifyReadyToCommit();
EXPECT_ACTION("ScheduledActionCommit", client, 0, 2); EXPECT_ACTION("ScheduledActionCommit", client, 0, 2);
EXPECT_ACTION("PostBeginImplFrameDeadlineTask", client, 1, 2); EXPECT_ACTION("PostBeginImplFrameDeadlineTask", client, 1, 2);
EXPECT_TRUE(scheduler->RedrawPending()); EXPECT_TRUE(scheduler->RedrawPending());
...@@ -470,9 +470,9 @@ TEST(SchedulerTest, TextureAcquisitionCollision) { ...@@ -470,9 +470,9 @@ TEST(SchedulerTest, TextureAcquisitionCollision) {
// the unlock. // the unlock.
EXPECT_TRUE(client.needs_begin_impl_frame()); EXPECT_TRUE(client.needs_begin_impl_frame());
// Trigger the commit // Trigger the commit.
scheduler->NotifyBeginMainFrameStarted(); scheduler->NotifyBeginMainFrameStarted();
scheduler->FinishCommit(); scheduler->NotifyReadyToCommit();
EXPECT_TRUE(client.needs_begin_impl_frame()); EXPECT_TRUE(client.needs_begin_impl_frame());
// Between commit and draw, texture acquisition for main thread delayed, // Between commit and draw, texture acquisition for main thread delayed,
...@@ -519,7 +519,7 @@ TEST(SchedulerTest, TextureAcquisitionCollision) { ...@@ -519,7 +519,7 @@ TEST(SchedulerTest, TextureAcquisitionCollision) {
// Trigger the commit, which will trigger the deadline task early. // Trigger the commit, which will trigger the deadline task early.
scheduler->NotifyBeginMainFrameStarted(); scheduler->NotifyBeginMainFrameStarted();
scheduler->FinishCommit(); scheduler->NotifyReadyToCommit();
EXPECT_ACTION("ScheduledActionCommit", client, 0, 2); EXPECT_ACTION("ScheduledActionCommit", client, 0, 2);
EXPECT_ACTION("PostBeginImplFrameDeadlineTask", client, 1, 2); EXPECT_ACTION("PostBeginImplFrameDeadlineTask", client, 1, 2);
EXPECT_TRUE(client.needs_begin_impl_frame()); EXPECT_TRUE(client.needs_begin_impl_frame());
...@@ -549,7 +549,7 @@ TEST(SchedulerTest, VisibilitySwitchWithTextureAcquisition) { ...@@ -549,7 +549,7 @@ TEST(SchedulerTest, VisibilitySwitchWithTextureAcquisition) {
scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
scheduler->OnBeginImplFrameDeadline(); scheduler->OnBeginImplFrameDeadline();
scheduler->NotifyBeginMainFrameStarted(); scheduler->NotifyBeginMainFrameStarted();
scheduler->FinishCommit(); scheduler->NotifyReadyToCommit();
scheduler->SetMainThreadNeedsLayerTextures(); scheduler->SetMainThreadNeedsLayerTextures();
scheduler->SetNeedsCommit(); scheduler->SetNeedsCommit();
client.Reset(); client.Reset();
...@@ -744,7 +744,7 @@ TEST(SchedulerTest, RequestCommitInsideDraw) { ...@@ -744,7 +744,7 @@ TEST(SchedulerTest, RequestCommitInsideDraw) {
EXPECT_TRUE(scheduler->CommitPending()); EXPECT_TRUE(scheduler->CommitPending());
EXPECT_TRUE(client.needs_begin_impl_frame()); EXPECT_TRUE(client.needs_begin_impl_frame());
scheduler->NotifyBeginMainFrameStarted(); scheduler->NotifyBeginMainFrameStarted();
scheduler->FinishCommit(); scheduler->NotifyReadyToCommit();
scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
scheduler->OnBeginImplFrameDeadline(); scheduler->OnBeginImplFrameDeadline();
...@@ -858,7 +858,7 @@ TEST(SchedulerTest, NoSwapWhenSwapFailsDuringForcedCommit) { ...@@ -858,7 +858,7 @@ TEST(SchedulerTest, NoSwapWhenSwapFailsDuringForcedCommit) {
scheduler->SetNeedsRedraw(); scheduler->SetNeedsRedraw();
scheduler->SetNeedsForcedCommitForReadback(); scheduler->SetNeedsForcedCommitForReadback();
scheduler->NotifyBeginMainFrameStarted(); scheduler->NotifyBeginMainFrameStarted();
scheduler->FinishCommit(); scheduler->NotifyReadyToCommit();
EXPECT_TRUE(client.HasAction("ScheduledActionDrawAndReadback")); EXPECT_TRUE(client.HasAction("ScheduledActionDrawAndReadback"));
} }
...@@ -875,19 +875,19 @@ TEST(SchedulerTest, BackToBackReadbackAllowed) { ...@@ -875,19 +875,19 @@ TEST(SchedulerTest, BackToBackReadbackAllowed) {
scheduler->SetNeedsRedraw(); scheduler->SetNeedsRedraw();
scheduler->SetNeedsForcedCommitForReadback(); scheduler->SetNeedsForcedCommitForReadback();
scheduler->NotifyBeginMainFrameStarted(); scheduler->NotifyBeginMainFrameStarted();
scheduler->FinishCommit(); scheduler->NotifyReadyToCommit();
EXPECT_TRUE(client.HasAction("ScheduledActionDrawAndReadback")); EXPECT_TRUE(client.HasAction("ScheduledActionDrawAndReadback"));
client.Reset(); client.Reset();
scheduler->SetNeedsForcedCommitForReadback(); scheduler->SetNeedsForcedCommitForReadback();
scheduler->NotifyBeginMainFrameStarted(); scheduler->NotifyBeginMainFrameStarted();
scheduler->FinishCommit(); scheduler->NotifyReadyToCommit();
EXPECT_TRUE(client.HasAction("ScheduledActionDrawAndReadback")); EXPECT_TRUE(client.HasAction("ScheduledActionDrawAndReadback"));
// The replacement commit comes in after 2 readbacks. // The replacement commit comes in after 2 readbacks.
client.Reset(); client.Reset();
scheduler->NotifyBeginMainFrameStarted(); scheduler->NotifyBeginMainFrameStarted();
scheduler->FinishCommit(); scheduler->NotifyReadyToCommit();
} }
...@@ -1152,7 +1152,7 @@ void MainFrameInHighLatencyMode(int64 begin_main_frame_to_commit_estimate_in_ms, ...@@ -1152,7 +1152,7 @@ void MainFrameInHighLatencyMode(int64 begin_main_frame_to_commit_estimate_in_ms,
scheduler->OnBeginImplFrameDeadline(); scheduler->OnBeginImplFrameDeadline();
EXPECT_TRUE(scheduler->MainThreadIsInHighLatencyMode()); EXPECT_TRUE(scheduler->MainThreadIsInHighLatencyMode());
scheduler->NotifyBeginMainFrameStarted(); scheduler->NotifyBeginMainFrameStarted();
scheduler->FinishCommit(); scheduler->NotifyReadyToCommit();
EXPECT_TRUE(scheduler->MainThreadIsInHighLatencyMode()); EXPECT_TRUE(scheduler->MainThreadIsInHighLatencyMode());
EXPECT_TRUE(client.HasAction("ScheduledActionSendBeginMainFrame")); EXPECT_TRUE(client.HasAction("ScheduledActionSendBeginMainFrame"));
...@@ -1211,7 +1211,7 @@ TEST(SchedulerTest, PollForCommitCompletion) { ...@@ -1211,7 +1211,7 @@ TEST(SchedulerTest, PollForCommitCompletion) {
scheduler->SetNeedsCommit(); scheduler->SetNeedsCommit();
EXPECT_TRUE(scheduler->CommitPending()); EXPECT_TRUE(scheduler->CommitPending());
scheduler->NotifyBeginMainFrameStarted(); scheduler->NotifyBeginMainFrameStarted();
scheduler->FinishCommit(); scheduler->NotifyReadyToCommit();
scheduler->SetNeedsRedraw(); scheduler->SetNeedsRedraw();
BeginFrameArgs impl_frame_args = BeginFrameArgs::CreateForTesting(); BeginFrameArgs impl_frame_args = BeginFrameArgs::CreateForTesting();
const int interval = 1; const int interval = 1;
...@@ -1220,7 +1220,7 @@ TEST(SchedulerTest, PollForCommitCompletion) { ...@@ -1220,7 +1220,7 @@ TEST(SchedulerTest, PollForCommitCompletion) {
scheduler->OnBeginImplFrameDeadline(); scheduler->OnBeginImplFrameDeadline();
// At this point, we've drawn a frame. Start another commit, but hold off on // At this point, we've drawn a frame. Start another commit, but hold off on
// the FinishCommit for now. // the NotifyReadyToCommit for now.
EXPECT_FALSE(scheduler->CommitPending()); EXPECT_FALSE(scheduler->CommitPending());
scheduler->SetNeedsCommit(); scheduler->SetNeedsCommit();
EXPECT_TRUE(scheduler->CommitPending()); EXPECT_TRUE(scheduler->CommitPending());
......
...@@ -1403,7 +1403,7 @@ void ThreadProxy::DidBeginImplFrameDeadline() { ...@@ -1403,7 +1403,7 @@ void ThreadProxy::DidBeginImplFrameDeadline() {
void ThreadProxy::ReadyToFinalizeTextureUpdates() { void ThreadProxy::ReadyToFinalizeTextureUpdates() {
DCHECK(IsImplThread()); DCHECK(IsImplThread());
impl().scheduler->FinishCommit(); impl().scheduler->NotifyReadyToCommit();
} }
void ThreadProxy::DidCommitAndDrawFrame() { void ThreadProxy::DidCommitAndDrawFrame() {
......
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