cc: SwapAck throttle Swap without throttling MainFrames

This should improve main thread throughput in cases
where we are deferring the BeginMainFrame, but don't
really need to because the swap ack will come back
before the impl thread needs to draw anyway.

BUG=311213

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266685 0039d316-1c4b-4281-b951-d872f2087c98
parent 60cf50e0
...@@ -502,11 +502,6 @@ bool SchedulerStateMachine::ShouldSendBeginMainFrame() const { ...@@ -502,11 +502,6 @@ bool SchedulerStateMachine::ShouldSendBeginMainFrame() const {
if (!HasInitializedOutputSurface()) if (!HasInitializedOutputSurface())
return false; return false;
// SwapAck throttle the BeginMainFrames
// TODO(brianderson): Remove this restriction to improve throughput.
if (pending_swaps_ >= max_pending_swaps_)
return false;
if (skip_begin_main_frame_to_reduce_latency_) if (skip_begin_main_frame_to_reduce_latency_)
return false; return false;
......
...@@ -1266,10 +1266,11 @@ TEST(SchedulerTest, BeginRetroFrame_SwapThrottled) { ...@@ -1266,10 +1266,11 @@ TEST(SchedulerTest, BeginRetroFrame_SwapThrottled) {
client.Reset(); client.Reset();
// While swap throttled, BeginRetroFrames should trigger BeginImplFrames // While swap throttled, BeginRetroFrames should trigger BeginImplFrames
// but not a BeginMainFrame or draw. // and BeginMainFrames, but not draw.
scheduler->SetNeedsCommit(); scheduler->SetNeedsCommit();
client.task_runner().RunPendingTasks(); // Run posted BeginRetroFrame. client.task_runner().RunPendingTasks(); // Run posted BeginRetroFrame.
EXPECT_ACTION("WillBeginImplFrame", client, 0, 1); EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 1, 2);
EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
EXPECT_TRUE(client.needs_begin_frame()); EXPECT_TRUE(client.needs_begin_frame());
client.Reset(); client.Reset();
...@@ -1284,7 +1285,7 @@ TEST(SchedulerTest, BeginRetroFrame_SwapThrottled) { ...@@ -1284,7 +1285,7 @@ TEST(SchedulerTest, BeginRetroFrame_SwapThrottled) {
// Take us out of a swap throttled state. // Take us out of a swap throttled state.
scheduler->DidSwapBuffersComplete(); scheduler->DidSwapBuffersComplete();
EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 0, 1); EXPECT_EQ(0, client.num_actions_());
EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
EXPECT_TRUE(client.needs_begin_frame()); EXPECT_TRUE(client.needs_begin_frame());
client.Reset(); client.Reset();
...@@ -1441,18 +1442,19 @@ void BeginFramesNotFromClient_SwapThrottled(bool begin_frame_scheduling_enabled, ...@@ -1441,18 +1442,19 @@ void BeginFramesNotFromClient_SwapThrottled(bool begin_frame_scheduling_enabled,
EXPECT_FALSE(client.needs_begin_frame()); EXPECT_FALSE(client.needs_begin_frame());
client.Reset(); client.Reset();
// While swap throttled, BeginFrames should trigger BeginImplFrames, // While swap throttled, BeginFrames should trigger BeginImplFrame and
// but not a BeginMainFrame or draw. // BeginMainFrame, but not draw.
scheduler->SetNeedsCommit(); scheduler->SetNeedsCommit();
client.task_runner().RunPendingTasks(); // Run posted BeginFrame. client.task_runner().RunPendingTasks(); // Run posted BeginFrame.
EXPECT_ACTION("WillBeginImplFrame", client, 0, 1); EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 1, 2);
EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
EXPECT_FALSE(client.needs_begin_frame()); EXPECT_FALSE(client.needs_begin_frame());
client.Reset(); client.Reset();
// Take us out of a swap throttled state. // Take us out of a swap throttled state.
scheduler->DidSwapBuffersComplete(); scheduler->DidSwapBuffersComplete();
EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 0, 1); EXPECT_EQ(0, client.num_actions_());
EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
EXPECT_FALSE(client.needs_begin_frame()); EXPECT_FALSE(client.needs_begin_frame());
client.Reset(); client.Reset();
......
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