summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwittman@chromium.org <wittman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-10 22:47:54 +0000
committerwittman@chromium.org <wittman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-10 22:47:54 +0000
commitd76d706344eddc60fe0bdc373a42f36d80174aa8 (patch)
treef417beac29cd572d7936fe8e35015a00df8e355f
parent8b3d240ac8514045f28d8595cbed4832d09bd942 (diff)
downloadchromium_src-d76d706344eddc60fe0bdc373a42f36d80174aa8.zip
chromium_src-d76d706344eddc60fe0bdc373a42f36d80174aa8.tar.gz
chromium_src-d76d706344eddc60fe0bdc373a42f36d80174aa8.tar.bz2
Revert 276130 "cc: Don't swap throttle BeginMainFrame within dea..."
Appears to be causing hang on Linux in WebRtcBrowserTests/WebRtcBrowserTest.EstablishAudioVideoCallAndVerifyMutingWorks. http://build.chromium.org/p/chromium.linux/builders/Linux%20Tests/builds/11520/steps/content_browsertests/logs/EstablishAudioVideoCallAndVerifyMutingWorks_1 > cc: Don't swap throttle BeginMainFrame within deadline > > This will better reflect behavior prior to the > OutputSurface+Scheduler refactor and will > prevent us from skipping BeginMainFrames that > the scheduler only meant to defer. > > BUG=381346 > > Review URL: https://codereview.chromium.org/311353003 TBR=brianderson@chromium.org Review URL: https://codereview.chromium.org/327963003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276185 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--cc/scheduler/scheduler_state_machine.cc3
-rw-r--r--cc/scheduler/scheduler_state_machine_unittest.cc45
2 files changed, 4 insertions, 44 deletions
diff --git a/cc/scheduler/scheduler_state_machine.cc b/cc/scheduler/scheduler_state_machine.cc
index 87ec784..f7919a6 100644
--- a/cc/scheduler/scheduler_state_machine.cc
+++ b/cc/scheduler/scheduler_state_machine.cc
@@ -466,8 +466,7 @@ bool SchedulerStateMachine::ShouldSendBeginMainFrame() const {
// SwapAck throttle the BeginMainFrames
// TODO(brianderson): Remove this restriction to improve throughput.
- if (pending_swaps_ >= max_pending_swaps_ &&
- begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE)
+ if (pending_swaps_ >= max_pending_swaps_)
return false;
if (skip_begin_main_frame_to_reduce_latency_)
diff --git a/cc/scheduler/scheduler_state_machine_unittest.cc b/cc/scheduler/scheduler_state_machine_unittest.cc
index 6dc1c82..f862baf 100644
--- a/cc/scheduler/scheduler_state_machine_unittest.cc
+++ b/cc/scheduler/scheduler_state_machine_unittest.cc
@@ -1723,7 +1723,7 @@ TEST(SchedulerStateMachineTest, TestTriggerDeadlineEarlyAfterAbortedCommit) {
EXPECT_TRUE(state.ShouldTriggerBeginImplFrameDeadlineEarly());
}
-TEST(SchedulerStateMachineTest, TestSmoothnessTakesPriority) {
+TEST(SchedulerStateMachineTest, TestTriggerDeadlineEarlyForSmoothness) {
SchedulerSettings settings;
settings.impl_side_painting = true;
StateMachine state(settings);
@@ -1735,57 +1735,18 @@ TEST(SchedulerStateMachineTest, TestSmoothnessTakesPriority) {
// This test ensures that impl-draws are prioritized over main thread updates
// in prefer smoothness mode.
+ state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
state.SetNeedsRedraw(true);
state.SetNeedsCommit();
- state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
EXPECT_ACTION_UPDATE_STATE(
SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
- // Verify the deadline is not triggered early until we enter
- // prefer smoothness mode.
+ // The deadline is not triggered early until we enter prefer smoothness mode.
EXPECT_FALSE(state.ShouldTriggerBeginImplFrameDeadlineEarly());
state.SetSmoothnessTakesPriority(true);
EXPECT_TRUE(state.ShouldTriggerBeginImplFrameDeadlineEarly());
-
- // Trigger the deadline.
- state.OnBeginImplFrameDeadline();
- EXPECT_ACTION_UPDATE_STATE(
- SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE);
- state.DidSwapBuffers();
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
- state.DidSwapBuffersComplete();
-
- // Finish the previous commit and initiate another one.
- state.SetNeedsCommit();
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
- state.NotifyBeginMainFrameStarted();
- state.NotifyReadyToCommit();
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
- state.NotifyReadyToActivate();
- EXPECT_ACTION_UPDATE_STATE(
- SchedulerStateMachine::ACTION_ACTIVATE_PENDING_TREE);
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
-
- // Trigger another BeginFrame.
- // Since we are in prefer smoothness mode, we do not start the next
- // BeginMainFrame until after we draw.
- state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
-
- // Trigger the deadline and verify we send the BeginMainFrame after we
- // draw, even if we are swap throttled.
- EXPECT_TRUE(state.ShouldTriggerBeginImplFrameDeadlineEarly());
- state.OnBeginImplFrameDeadline();
- EXPECT_ACTION_UPDATE_STATE(
- SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE);
- state.DidSwapBuffers();
- EXPECT_ACTION_UPDATE_STATE(
- SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
}
TEST(SchedulerStateMachineTest, TestTriggerDeadlineEarlyOnLostOutputSurface) {