summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkochi@chromium.org <kochi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-12 08:29:43 +0000
committerkochi@chromium.org <kochi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-12 08:29:43 +0000
commit585fa72fe0792a5a8f3d8e428046c1c40257854f (patch)
treec6932269fd96cc345a2a7604576833c75722c9c2
parentb027bb7ba4d6a8f8b42ea3848d4efd64218675ad (diff)
downloadchromium_src-585fa72fe0792a5a8f3d8e428046c1c40257854f.zip
chromium_src-585fa72fe0792a5a8f3d8e428046c1c40257854f.tar.gz
chromium_src-585fa72fe0792a5a8f3d8e428046c1c40257854f.tar.bz2
Revert 256454 "cc: Allow sending BeginMainFrame before draw or a..."
Speculatively reverting this, which caused Android cc_unittests crash on LayerTreeHostAnimationTestCancelAnimateCommit. RunMultiThread_DirectRenderer_MainThreadPaint BUG=351638 > cc: Allow sending BeginMainFrame before draw or activation > > BeginMainFrame before draw: > Enabled by default because of concurrency benefits. > When main thread painting, this will block the main thread from > finishing the commit until the active tree has been drawn. > When impl side painting, this does not block the main thread. > > The following flag will disable sending BeginMainFrame to the > main thread before we draw the previous commit: > --disable-main-frame-before-draw > > BeginMainFrame before activation: > Disabled by default because of latency concerns. > This applies only when impl-side-painting is enabled and will > cause the main thread to block finishing the commit until the > pending tree is activated. > > The following flags control whether BeginMainFrame is sent to > the main thread before or after the previous commit has > activated: > --enable-main-frame-before-activation > --disable-main-frame-before-activation > > BUG=293941 > > Review URL: https://codereview.chromium.org/23907006 TBR=brianderson@chromium.org Review URL: https://codereview.chromium.org/196893002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256480 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--cc/base/switches.cc13
-rw-r--r--cc/base/switches.h3
-rw-r--r--cc/scheduler/scheduler.cc3
-rw-r--r--cc/scheduler/scheduler_settings.cc4
-rw-r--r--cc/scheduler/scheduler_settings.h2
-rw-r--r--cc/scheduler/scheduler_state_machine.cc78
-rw-r--r--cc/scheduler/scheduler_state_machine.h7
-rw-r--r--cc/scheduler/scheduler_state_machine_unittest.cc268
-rw-r--r--cc/trees/layer_tree_host_unittest_animation.cc20
-rw-r--r--cc/trees/layer_tree_host_unittest_context.cc6
-rw-r--r--cc/trees/layer_tree_settings.cc2
-rw-r--r--cc/trees/layer_tree_settings.h2
-rw-r--r--cc/trees/thread_proxy.cc8
-rw-r--r--chrome/browser/chromeos/login/chrome_restart_request.cc3
-rw-r--r--content/browser/renderer_host/render_process_host_impl.cc3
-rw-r--r--content/renderer/gpu/render_widget_compositor.cc5
-rw-r--r--ui/compositor/compositor.cc2
17 files changed, 108 insertions, 321 deletions
diff --git a/cc/base/switches.cc b/cc/base/switches.cc
index 43fca91..46f4992 100644
--- a/cc/base/switches.cc
+++ b/cc/base/switches.cc
@@ -15,19 +15,6 @@ const char kDisableThreadedAnimation[] = "disable-threaded-animation";
const char kDisableCompositedAntialiasing[] =
"disable-composited-antialiasing";
-// Disables sending the next BeginMainFrame before the previous commit has
-// drawn.
-const char kDisableMainFrameBeforeDraw[] = "disable-main-frame-before-draw";
-
-// Disables sending the next BeginMainFrame before the previous commit
-// activates. Overrides the kEnableMainFrameBeforeActivation flag.
-const char kDisableMainFrameBeforeActivation[] =
- "disable-main-frame-before-activation";
-
-// Enables sending the next BeginMainFrame before the previous commit activates.
-const char kEnableMainFrameBeforeActivation[] =
- "enable-main-frame-before-activation";
-
const char kEnableTopControlsPositionCalculation[] =
"enable-top-controls-position-calculation";
diff --git a/cc/base/switches.h b/cc/base/switches.h
index 509b685..92339cb 100644
--- a/cc/base/switches.h
+++ b/cc/base/switches.h
@@ -18,9 +18,6 @@ namespace switches {
// Switches for the renderer compositor only.
CC_EXPORT extern const char kDisableThreadedAnimation[];
CC_EXPORT extern const char kDisableCompositedAntialiasing[];
-CC_EXPORT extern const char kDisableMainFrameBeforeDraw[];
-CC_EXPORT extern const char kDisableMainFrameBeforeActivation[];
-CC_EXPORT extern const char kEnableMainFrameBeforeActivation[];
CC_EXPORT extern const char kEnableTopControlsPositionCalculation[];
CC_EXPORT extern const char kJankInsteadOfCheckerboard[];
CC_EXPORT extern const char kTopControlsHeight[];
diff --git a/cc/scheduler/scheduler.cc b/cc/scheduler/scheduler.cc
index ef4ba8f..741b9c8 100644
--- a/cc/scheduler/scheduler.cc
+++ b/cc/scheduler/scheduler.cc
@@ -27,9 +27,6 @@ Scheduler::Scheduler(SchedulerClient* client,
weak_factory_(this) {
DCHECK(client_);
DCHECK(!state_machine_.BeginImplFrameNeeded());
- if (settings_.main_frame_before_activation_enabled) {
- DCHECK(settings_.main_frame_before_draw_enabled);
- }
}
Scheduler::~Scheduler() {}
diff --git a/cc/scheduler/scheduler_settings.cc b/cc/scheduler/scheduler_settings.cc
index 808a9fa..086028e 100644
--- a/cc/scheduler/scheduler_settings.cc
+++ b/cc/scheduler/scheduler_settings.cc
@@ -7,9 +7,7 @@
namespace cc {
SchedulerSettings::SchedulerSettings()
- : main_frame_before_draw_enabled(true),
- main_frame_before_activation_enabled(false),
- impl_side_painting(false),
+ : impl_side_painting(false),
timeout_and_draw_when_animation_checkerboards(true),
maximum_number_of_failed_draws_before_draw_is_forced_(3),
using_synchronous_renderer_compositor(false),
diff --git a/cc/scheduler/scheduler_settings.h b/cc/scheduler/scheduler_settings.h
index 4b2f664..66d276c 100644
--- a/cc/scheduler/scheduler_settings.h
+++ b/cc/scheduler/scheduler_settings.h
@@ -14,8 +14,6 @@ class CC_EXPORT SchedulerSettings {
SchedulerSettings();
~SchedulerSettings();
- bool main_frame_before_draw_enabled;
- bool main_frame_before_activation_enabled;
bool impl_side_painting;
bool timeout_and_draw_when_animation_checkerboards;
int maximum_number_of_failed_draws_before_draw_is_forced_;
diff --git a/cc/scheduler/scheduler_state_machine.cc b/cc/scheduler/scheduler_state_machine.cc
index 2bbf256..7577fb4 100644
--- a/cc/scheduler/scheduler_state_machine.cc
+++ b/cc/scheduler/scheduler_state_machine.cc
@@ -90,8 +90,6 @@ const char* SchedulerStateMachine::CommitStateToString(CommitState state) {
return "COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED";
case COMMIT_STATE_READY_TO_COMMIT:
return "COMMIT_STATE_READY_TO_COMMIT";
- case COMMIT_STATE_WAITING_FOR_ACTIVATION:
- return "COMMIT_STATE_WAITING_FOR_ACTIVATION";
case COMMIT_STATE_WAITING_FOR_FIRST_DRAW:
return "COMMIT_STATE_WAITING_FOR_FIRST_DRAW";
}
@@ -376,8 +374,10 @@ bool SchedulerStateMachine::ShouldDraw() const {
return false;
// Draw immediately for readbacks to unblock the main thread quickly.
- if (readback_state_ == READBACK_STATE_WAITING_FOR_DRAW_AND_READBACK)
+ if (readback_state_ == READBACK_STATE_WAITING_FOR_DRAW_AND_READBACK) {
+ DCHECK_EQ(commit_state_, COMMIT_STATE_WAITING_FOR_FIRST_DRAW);
return true;
+ }
// If we need to abort draws, we should do so ASAP since the draw could
// be blocking other important actions (like output surface initialization),
@@ -397,8 +397,10 @@ bool SchedulerStateMachine::ShouldDraw() const {
return false;
// Only handle forced redraws due to timeouts on the regular deadline.
- if (forced_redraw_state_ == FORCED_REDRAW_STATE_WAITING_FOR_DRAW)
+ if (forced_redraw_state_ == FORCED_REDRAW_STATE_WAITING_FOR_DRAW) {
+ DCHECK_EQ(commit_state_, COMMIT_STATE_WAITING_FOR_FIRST_DRAW);
return true;
+ }
return needs_redraw_;
}
@@ -463,12 +465,9 @@ bool SchedulerStateMachine::ShouldSendBeginMainFrame() const {
if (commit_state_ != COMMIT_STATE_IDLE)
return false;
- // Don't send BeginMainFrame early if we are prioritizing the active tree
- // because of smoothness_takes_priority.
- if (smoothness_takes_priority_ &&
- (has_pending_tree_ || active_tree_needs_first_draw_)) {
+ // We can't accept a commit if we have a pending tree.
+ if (has_pending_tree_)
return false;
- }
// We want to handle readback commits immediately to unblock the main thread.
// Note: This BeginMainFrame will correspond to the replacement commit that
@@ -515,20 +514,7 @@ bool SchedulerStateMachine::ShouldSendBeginMainFrame() const {
}
bool SchedulerStateMachine::ShouldCommit() const {
- if (commit_state_ != COMMIT_STATE_READY_TO_COMMIT)
- return false;
-
- // We must not finish the commit until the pending tree is free.
- if (has_pending_tree_) {
- DCHECK(settings_.main_frame_before_activation_enabled);
- return false;
- }
-
- // Prioritize drawing the previous commit before finishing the next commit.
- if (active_tree_needs_first_draw_)
- return false;
-
- return true;
+ return commit_state_ == COMMIT_STATE_READY_TO_COMMIT;
}
bool SchedulerStateMachine::ShouldManageTiles() const {
@@ -602,10 +588,7 @@ void SchedulerStateMachine::UpdateState(Action action) {
return;
case ACTION_SEND_BEGIN_MAIN_FRAME:
- DCHECK(!has_pending_tree_ ||
- settings_.main_frame_before_activation_enabled);
- DCHECK(!active_tree_needs_first_draw_ ||
- settings_.main_frame_before_draw_enabled);
+ DCHECK(!has_pending_tree_);
DCHECK(visible_ ||
readback_state_ == READBACK_STATE_NEEDS_BEGIN_MAIN_FRAME);
commit_state_ = COMMIT_STATE_BEGIN_MAIN_FRAME_SENT;
@@ -662,16 +645,6 @@ void SchedulerStateMachine::UpdateState(Action action) {
void SchedulerStateMachine::UpdateStateOnCommit(bool commit_was_aborted) {
commit_count_++;
- if (commit_was_aborted || settings_.main_frame_before_activation_enabled) {
- commit_state_ = COMMIT_STATE_IDLE;
- } else if (settings_.main_frame_before_draw_enabled) {
- commit_state_ = settings_.impl_side_painting
- ? COMMIT_STATE_WAITING_FOR_ACTIVATION
- : COMMIT_STATE_IDLE;
- } else {
- commit_state_ = COMMIT_STATE_WAITING_FOR_FIRST_DRAW;
- }
-
// If we are impl-side-painting but the commit was aborted, then we behave
// mostly as if we are not impl-side-painting since there is no pending tree.
has_pending_tree_ = settings_.impl_side_painting && !commit_was_aborted;
@@ -717,6 +690,18 @@ void SchedulerStateMachine::UpdateStateOnCommit(bool commit_was_aborted) {
}
}
+ // Update the commit state. We expect and wait for a draw if the commit
+ // was not aborted or if we are in a readback or forced draw.
+ if (!commit_was_aborted) {
+ DCHECK(commit_state_ == COMMIT_STATE_READY_TO_COMMIT);
+ commit_state_ = COMMIT_STATE_WAITING_FOR_FIRST_DRAW;
+ } else if (readback_state_ != READBACK_STATE_IDLE ||
+ forced_redraw_state_ != FORCED_REDRAW_STATE_IDLE) {
+ commit_state_ = COMMIT_STATE_WAITING_FOR_FIRST_DRAW;
+ } else {
+ commit_state_ = COMMIT_STATE_IDLE;
+ }
+
// Update state if we have a new active tree to draw, or if the active tree
// was unchanged but we need to do a readback or forced draw.
if (!has_pending_tree_ &&
@@ -742,9 +727,6 @@ void SchedulerStateMachine::UpdateStateOnCommit(bool commit_was_aborted) {
}
void SchedulerStateMachine::UpdateStateOnActivation() {
- if (commit_state_ == COMMIT_STATE_WAITING_FOR_ACTIVATION)
- commit_state_ = COMMIT_STATE_IDLE;
-
if (output_surface_state_ == OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION)
output_surface_state_ = OUTPUT_SURFACE_ACTIVE;
@@ -768,7 +750,8 @@ void SchedulerStateMachine::UpdateStateOnDraw(bool did_swap) {
<< *AsValue();
if (readback_state_ == READBACK_STATE_WAITING_FOR_DRAW_AND_READBACK) {
- // The draw corresponds to a readback commit.
+ // The draw correspons to a readback commit.
+ DCHECK_EQ(commit_state_, COMMIT_STATE_WAITING_FOR_FIRST_DRAW);
// We are blocking commits from the main thread until after this draw, so
// we should not have a pending tree.
DCHECK(!has_pending_tree_);
@@ -777,11 +760,13 @@ void SchedulerStateMachine::UpdateStateOnDraw(bool did_swap) {
commit_state_ = COMMIT_STATE_BEGIN_MAIN_FRAME_SENT;
readback_state_ = READBACK_STATE_WAITING_FOR_REPLACEMENT_COMMIT;
} else if (forced_redraw_state_ == FORCED_REDRAW_STATE_WAITING_FOR_DRAW) {
+ DCHECK_EQ(commit_state_, COMMIT_STATE_WAITING_FOR_FIRST_DRAW);
+ commit_state_ = COMMIT_STATE_IDLE;
forced_redraw_state_ = FORCED_REDRAW_STATE_IDLE;
- }
-
- if (commit_state_ == COMMIT_STATE_WAITING_FOR_FIRST_DRAW)
+ } else if (commit_state_ == COMMIT_STATE_WAITING_FOR_FIRST_DRAW &&
+ !has_pending_tree_) {
commit_state_ = COMMIT_STATE_IDLE;
+ }
if (texture_state_ == LAYER_TEXTURE_STATE_ACQUIRED_BY_IMPL_THREAD)
texture_state_ = LAYER_TEXTURE_STATE_UNLOCKED;
@@ -977,11 +962,6 @@ bool SchedulerStateMachine::ShouldTriggerBeginImplFrameDeadlineEarly() const {
}
bool SchedulerStateMachine::MainThreadIsInHighLatencyMode() const {
- // If a commit is pending before the previous commit has been drawn, we
- // are definitely in a high latency mode.
- if (CommitPending() && (active_tree_needs_first_draw_ || has_pending_tree_))
- return true;
-
// If we just sent a BeginMainFrame and haven't hit the deadline yet, the main
// thread is in a low latency mode.
if (last_frame_number_begin_main_frame_sent_ == current_frame_number_ &&
diff --git a/cc/scheduler/scheduler_state_machine.h b/cc/scheduler/scheduler_state_machine.h
index 40a054f..8dbf829 100644
--- a/cc/scheduler/scheduler_state_machine.h
+++ b/cc/scheduler/scheduler_state_machine.h
@@ -63,7 +63,6 @@ class CC_EXPORT SchedulerStateMachine {
COMMIT_STATE_BEGIN_MAIN_FRAME_SENT,
COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED,
COMMIT_STATE_READY_TO_COMMIT,
- COMMIT_STATE_WAITING_FOR_ACTIVATION,
COMMIT_STATE_WAITING_FOR_FIRST_DRAW,
};
static const char* CommitStateToString(CommitState state);
@@ -101,7 +100,6 @@ class CC_EXPORT SchedulerStateMachine {
commit_state_ == COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED ||
commit_state_ == COMMIT_STATE_READY_TO_COMMIT;
}
- CommitState commit_state() const { return commit_state_; }
bool RedrawPending() const { return needs_redraw_; }
bool ManageTilesPending() const { return needs_manage_tiles_; }
@@ -233,9 +231,6 @@ class CC_EXPORT SchedulerStateMachine {
void NotifyReadyToActivate();
bool has_pending_tree() const { return has_pending_tree_; }
- bool active_tree_needs_first_draw() const {
- return active_tree_needs_first_draw_;
- }
void DidManageTiles();
void DidLoseOutputSurface();
@@ -247,6 +242,8 @@ class CC_EXPORT SchedulerStateMachine {
bool SupportsProactiveBeginImplFrame() const;
+ CommitState commit_state() const { return commit_state_; }
+
protected:
bool BeginImplFrameNeededToDraw() const;
bool ProactiveBeginImplFrameWanted() const;
diff --git a/cc/scheduler/scheduler_state_machine_unittest.cc b/cc/scheduler/scheduler_state_machine_unittest.cc
index f31dabb..2e4a7bb 100644
--- a/cc/scheduler/scheduler_state_machine_unittest.cc
+++ b/cc/scheduler/scheduler_state_machine_unittest.cc
@@ -11,6 +11,11 @@
EXPECT_EQ(action, state.NextAction()) << *state.AsValue(); \
if (action == SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE || \
action == SchedulerStateMachine::ACTION_DRAW_AND_SWAP_FORCED) { \
+ if (SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW == \
+ state.CommitState() && \
+ SchedulerStateMachine::OUTPUT_SURFACE_ACTIVE != \
+ state.output_surface_state()) \
+ return; \
EXPECT_EQ(SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE, \
state.begin_impl_frame_state()) \
<< *state.AsValue(); \
@@ -40,8 +45,7 @@ const SchedulerStateMachine::CommitState all_commit_states[] = {
SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT,
SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED,
SchedulerStateMachine::COMMIT_STATE_READY_TO_COMMIT,
- SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_ACTIVATION,
- SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW};
+ SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW, };
// Exposes the protected state fields of the SchedulerStateMachine for testing
class StateMachine : public SchedulerStateMachine {
@@ -81,7 +85,7 @@ class StateMachine : public SchedulerStateMachine {
void SetNeedsForcedRedrawForTimeout(bool b) {
forced_redraw_state_ = FORCED_REDRAW_STATE_WAITING_FOR_COMMIT;
- active_tree_needs_first_draw_ = true;
+ commit_state_ = COMMIT_STATE_WAITING_FOR_FIRST_DRAW;
}
bool NeedsForcedRedrawForTimeout() const {
return forced_redraw_state_ != FORCED_REDRAW_STATE_IDLE;
@@ -89,7 +93,7 @@ class StateMachine : public SchedulerStateMachine {
void SetNeedsForcedRedrawForReadback() {
readback_state_ = READBACK_STATE_WAITING_FOR_DRAW_AND_READBACK;
- active_tree_needs_first_draw_ = true;
+ commit_state_ = COMMIT_STATE_WAITING_FOR_FIRST_DRAW;
}
bool NeedsForcedRedrawForReadback() const {
@@ -181,135 +185,6 @@ TEST(SchedulerStateMachineTest, TestNextActionBeginsMainFrameIfNeeded) {
}
}
-// Explicitly test main_frame_before_draw_enabled = false
-TEST(SchedulerStateMachineTest, MainFrameBeforeDrawDisabled) {
- SchedulerSettings scheduler_settings;
- scheduler_settings.impl_side_painting = true;
- scheduler_settings.main_frame_before_draw_enabled = false;
- StateMachine state(scheduler_settings);
- state.SetCommitState(SchedulerStateMachine::COMMIT_STATE_IDLE);
- state.SetCanStart();
- state.UpdateState(state.NextAction());
- state.CreateAndInitializeOutputSurfaceWithActivatedCommit();
- state.SetNeedsRedraw(false);
- state.SetVisible(true);
- state.SetCanDraw(true);
- state.SetNeedsCommit();
-
- EXPECT_TRUE(state.BeginImplFrameNeeded());
-
- // Commit to the pending tree.
- state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
- EXPECT_ACTION_UPDATE_STATE(
- SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
- 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);
- EXPECT_EQ(state.CommitState(),
- SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW);
-
- state.OnBeginImplFrameDeadline();
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
- EXPECT_EQ(state.CommitState(),
- SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW);
-
- // Verify that the next commit doesn't start until the previous
- // commit has been drawn.
- state.SetNeedsCommit();
- state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
-
- // Verify NotifyReadyToActivate unblocks activation, draw, and
- // commit in that order.
- state.NotifyReadyToActivate();
- EXPECT_ACTION_UPDATE_STATE(
- SchedulerStateMachine::ACTION_ACTIVATE_PENDING_TREE);
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
- EXPECT_EQ(state.CommitState(),
- SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW);
-
- EXPECT_TRUE(state.ShouldTriggerBeginImplFrameDeadlineEarly());
- state.OnBeginImplFrameDeadline();
- EXPECT_ACTION_UPDATE_STATE(
- SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE);
- EXPECT_EQ(state.CommitState(), SchedulerStateMachine::COMMIT_STATE_IDLE);
- EXPECT_ACTION_UPDATE_STATE(
- SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
- EXPECT_EQ(state.CommitState(),
- SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT);
-
- state.NotifyBeginMainFrameStarted();
- state.NotifyReadyToCommit();
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
- EXPECT_EQ(state.CommitState(),
- SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW);
-}
-
-// Explicitly test main_frame_before_activation_enabled = true
-TEST(SchedulerStateMachineTest, MainFrameBeforeActivationEnabled) {
- SchedulerSettings scheduler_settings;
- scheduler_settings.impl_side_painting = true;
- scheduler_settings.main_frame_before_activation_enabled = true;
- StateMachine state(scheduler_settings);
- state.SetCommitState(SchedulerStateMachine::COMMIT_STATE_IDLE);
- state.SetCanStart();
- state.UpdateState(state.NextAction());
- state.CreateAndInitializeOutputSurfaceWithActivatedCommit();
- state.SetNeedsRedraw(false);
- state.SetVisible(true);
- state.SetCanDraw(true);
- state.SetNeedsCommit();
-
- EXPECT_TRUE(state.BeginImplFrameNeeded());
-
- // Commit to the pending tree.
- state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
- EXPECT_ACTION_UPDATE_STATE(
- SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
- 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);
- EXPECT_EQ(state.CommitState(), SchedulerStateMachine::COMMIT_STATE_IDLE);
-
- state.OnBeginImplFrameDeadline();
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
-
- // Verify that the next commit starts while there is still a pending tree.
- state.SetNeedsCommit();
- state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
- EXPECT_ACTION_UPDATE_STATE(
- SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
-
- // Verify the pending commit doesn't overwrite the pending
- // tree until the pending tree has been activated.
- state.NotifyBeginMainFrameStarted();
- state.NotifyReadyToCommit();
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
-
- // Verify NotifyReadyToActivate unblocks activation, draw, and
- // commit in that order.
- state.NotifyReadyToActivate();
- EXPECT_ACTION_UPDATE_STATE(
- SchedulerStateMachine::ACTION_ACTIVATE_PENDING_TREE);
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
-
- EXPECT_TRUE(state.ShouldTriggerBeginImplFrameDeadlineEarly());
- state.OnBeginImplFrameDeadline();
- EXPECT_ACTION_UPDATE_STATE(
- SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE);
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
- EXPECT_EQ(state.CommitState(), SchedulerStateMachine::COMMIT_STATE_IDLE);
-}
-
TEST(SchedulerStateMachineTest,
TestFailedDrawForAnimationCheckerboardSetsNeedsCommitAndDoesNotDrawAgain) {
SchedulerSettings default_scheduler_settings;
@@ -413,11 +288,9 @@ TEST(SchedulerStateMachineTest,
EXPECT_TRUE(state.RedrawPending());
}
-void TestFailedDrawsEventuallyForceDrawAfterNextCommit(
- bool main_frame_before_draw_enabled) {
+TEST(SchedulerStateMachineTest,
+ TestFailedDrawsWillEventuallyForceADrawAfterTheNextCommit) {
SchedulerSettings scheduler_settings;
- scheduler_settings.main_frame_before_draw_enabled =
- main_frame_before_draw_enabled;
scheduler_settings.maximum_number_of_failed_draws_before_draw_is_forced_ = 1;
StateMachine state(scheduler_settings);
state.SetCanStart();
@@ -460,30 +333,12 @@ void TestFailedDrawsEventuallyForceDrawAfterNextCommit(
// The redraw should be forced at the end of the next BeginImplFrame.
state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
- if (main_frame_before_draw_enabled) {
- EXPECT_ACTION_UPDATE_STATE(
- SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
- }
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
state.OnBeginImplFrameDeadline();
EXPECT_ACTION_UPDATE_STATE(
SchedulerStateMachine::ACTION_DRAW_AND_SWAP_FORCED);
}
-TEST(SchedulerStateMachineTest,
- TestFailedDrawsEventuallyForceDrawAfterNextCommit) {
- bool main_frame_before_draw_enabled = false;
- TestFailedDrawsEventuallyForceDrawAfterNextCommit(
- main_frame_before_draw_enabled);
-}
-
-TEST(SchedulerStateMachineTest,
- TestFailedDrawsEventuallyForceDrawAfterNextCommit_CommitBeforeDraw) {
- bool main_frame_before_draw_enabled = true;
- TestFailedDrawsEventuallyForceDrawAfterNextCommit(
- main_frame_before_draw_enabled);
-}
-
TEST(SchedulerStateMachineTest, TestFailedDrawsDoNotRestartForcedDraw) {
SchedulerSettings scheduler_settings;
int draw_limit = 1;
@@ -665,14 +520,19 @@ TEST(SchedulerStateMachineTest, TestNextActionDrawsOnBeginImplFrame) {
}
}
- // When in BeginImplFrame deadline we should always draw for SetNeedsRedraw
- // except if we're ready to commit, in which case we expect a commit first.
- // SetNeedsForcedRedrawForReadback should take precedence over all and
- // issue a readback.
+ // When in BeginImplFrame deadline we should always draw for SetNeedsRedraw or
+ // SetNeedsForcedRedrawForReadback have been called... except if we're
+ // ready to commit, in which case we expect a commit first.
for (size_t i = 0; i < num_commit_states; ++i) {
for (size_t j = 0; j < 2; ++j) {
bool request_readback = j;
+ // Skip invalid states
+ if (request_readback &&
+ (SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW !=
+ all_commit_states[i]))
+ continue;
+
StateMachine state(default_scheduler_settings);
state.SetCanStart();
state.UpdateState(state.NextAction());
@@ -689,11 +549,15 @@ TEST(SchedulerStateMachineTest, TestNextActionDrawsOnBeginImplFrame) {
}
SchedulerStateMachine::Action expected_action;
- if (request_readback) {
- expected_action = SchedulerStateMachine::ACTION_DRAW_AND_READBACK;
- } else if (all_commit_states[i] ==
- SchedulerStateMachine::COMMIT_STATE_READY_TO_COMMIT) {
+ if (all_commit_states[i] ==
+ SchedulerStateMachine::COMMIT_STATE_READY_TO_COMMIT) {
expected_action = SchedulerStateMachine::ACTION_COMMIT;
+ } else if (request_readback) {
+ if (all_commit_states[i] ==
+ SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW)
+ expected_action = SchedulerStateMachine::ACTION_DRAW_AND_READBACK;
+ else
+ expected_action = SchedulerStateMachine::ACTION_NONE;
} else {
expected_action =
SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE;
@@ -702,13 +566,13 @@ TEST(SchedulerStateMachineTest, TestNextActionDrawsOnBeginImplFrame) {
// Case 1: needs_commit=false.
EXPECT_NE(state.BeginImplFrameNeeded(), request_readback)
<< *state.AsValue();
- EXPECT_EQ(state.NextAction(), expected_action) << *state.AsValue();
+ EXPECT_EQ(expected_action, state.NextAction()) << *state.AsValue();
// Case 2: needs_commit=true.
state.SetNeedsCommit();
EXPECT_NE(state.BeginImplFrameNeeded(), request_readback)
<< *state.AsValue();
- EXPECT_EQ(state.NextAction(), expected_action) << *state.AsValue();
+ EXPECT_EQ(expected_action, state.NextAction()) << *state.AsValue();
}
}
}
@@ -779,6 +643,8 @@ TEST(SchedulerStateMachineTest,
state.UpdateState(state.NextAction());
state.CreateAndInitializeOutputSurfaceWithActivatedCommit();
+ state.SetCommitState(
+ SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW);
state.SetActiveTreeNeedsFirstDraw(true);
state.SetNeedsCommit();
state.SetNeedsRedraw(true);
@@ -797,11 +663,9 @@ TEST(SchedulerStateMachineTest,
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
}
-void TestSetNeedsCommitIsNotLost(bool main_frame_before_draw_enabled) {
- SchedulerSettings scheduler_settings;
- scheduler_settings.main_frame_before_draw_enabled =
- main_frame_before_draw_enabled;
- StateMachine state(scheduler_settings);
+TEST(SchedulerStateMachineTest, TestsetNeedsCommitIsNotLost) {
+ SchedulerSettings default_scheduler_settings;
+ StateMachine state(default_scheduler_settings);
state.SetCanStart();
state.UpdateState(state.NextAction());
state.CreateAndInitializeOutputSurfaceWithActivatedCommit();
@@ -853,36 +717,20 @@ void TestSetNeedsCommitIsNotLost(bool main_frame_before_draw_enabled) {
state.begin_impl_frame_state());
EXPECT_EQ(SchedulerStateMachine::ACTION_COMMIT, state.NextAction());
- // Finish the commit, then make sure we start the next commit immediately
- // and draw on the next BeginImplFrame.
+ // Commit and make sure we draw on next BeginImplFrame
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
- if (main_frame_before_draw_enabled) {
- EXPECT_ACTION_UPDATE_STATE(
- SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
- }
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
-
state.OnBeginImplFrameDeadline();
-
- EXPECT_TRUE(state.active_tree_needs_first_draw());
+ EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW,
+ state.CommitState());
EXPECT_ACTION_UPDATE_STATE(
SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE);
state.DidDrawIfPossibleCompleted(DrawSwapReadbackResult::DRAW_SUCCESS);
- if (!main_frame_before_draw_enabled) {
- EXPECT_ACTION_UPDATE_STATE(
- SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
- }
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
-}
-TEST(SchedulerStateMachineTest, TestSetNeedsCommitIsNotLost) {
- bool main_frame_before_draw_enabled = false;
- TestSetNeedsCommitIsNotLost(main_frame_before_draw_enabled);
-}
-
-TEST(SchedulerStateMachineTest, TestSetNeedsCommitIsNotLost_CommitBeforeDraw) {
- bool main_frame_before_draw_enabled = true;
- TestSetNeedsCommitIsNotLost(main_frame_before_draw_enabled);
+ // Verify that another commit will start immediately after draw.
+ EXPECT_ACTION_UPDATE_STATE(
+ SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
+ EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
}
TEST(SchedulerStateMachineTest, TestFullCycle) {
@@ -914,7 +762,8 @@ TEST(SchedulerStateMachineTest, TestFullCycle) {
// Commit.
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
- EXPECT_TRUE(state.active_tree_needs_first_draw());
+ EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW,
+ state.CommitState());
EXPECT_TRUE(state.needs_redraw());
// Expect to do nothing until BeginImplFrame deadline
@@ -965,7 +814,8 @@ TEST(SchedulerStateMachineTest, TestFullCycleWithCommitRequestInbetween) {
// First commit.
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
- EXPECT_TRUE(state.active_tree_needs_first_draw());
+ EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW,
+ state.CommitState());
EXPECT_TRUE(state.needs_redraw());
// Expect to do nothing until BeginImplFrame deadline.
@@ -1255,7 +1105,8 @@ TEST(SchedulerStateMachineTest, TestContextLostWhileCommitInProgress) {
// We will abort the draw when the output surface is lost if we are
// waiting for the first draw to unblock the main thread.
- EXPECT_TRUE(state.active_tree_needs_first_draw());
+ EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW,
+ state.CommitState());
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_AND_SWAP_ABORT);
// Expect to begin context recreation only in BEGIN_IMPL_FRAME_STATE_IDLE
@@ -1317,7 +1168,8 @@ TEST(SchedulerStateMachineTest,
state.NotifyBeginMainFrameStarted();
state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
- EXPECT_TRUE(state.active_tree_needs_first_draw());
+ EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW,
+ state.CommitState());
// Because the output surface is missing, we expect the draw to abort.
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_AND_SWAP_ABORT);
@@ -1376,6 +1228,8 @@ TEST(SchedulerStateMachineTest, TestFinishAllRenderingWhileContextLost) {
state.DidLoseOutputSurface();
// Ask a forced redraw for readback and verify it ocurrs.
+ state.SetCommitState(
+ SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW);
state.SetNeedsForcedRedrawForReadback();
state.OnBeginImplFrame(BeginFrameArgs::CreateForTesting());
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_AND_READBACK);
@@ -1403,6 +1257,8 @@ TEST(SchedulerStateMachineTest, TestFinishAllRenderingWhileContextLost) {
SchedulerStateMachine::ACTION_BEGIN_OUTPUT_SURFACE_CREATION);
// Ask a readback and verify it occurs.
+ state.SetCommitState(
+ SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW);
state.SetNeedsForcedRedrawForReadback();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_AND_READBACK);
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
@@ -1545,7 +1401,8 @@ TEST(SchedulerStateMachineTest, TestFinishCommitWhenCommitInProgress) {
EXPECT_EQ(SchedulerStateMachine::ACTION_COMMIT, state.NextAction());
state.UpdateState(state.NextAction());
- EXPECT_TRUE(state.active_tree_needs_first_draw());
+ EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW,
+ state.CommitState());
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_AND_SWAP_ABORT);
}
@@ -1565,7 +1422,8 @@ TEST(SchedulerStateMachineTest, TestFinishCommitWhenForcedCommitInProgress) {
state.NotifyReadyToCommit();
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
- EXPECT_TRUE(state.active_tree_needs_first_draw());
+ EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW,
+ state.CommitState());
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_AND_READBACK);
// When the readback interrupts the normal commit, we should not get
@@ -1636,7 +1494,8 @@ TEST(SchedulerStateMachineTest, TestImmediateFinishCommit) {
state.CommitState());
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
- EXPECT_TRUE(state.active_tree_needs_first_draw());
+ EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW,
+ state.CommitState());
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_AND_READBACK);
state.DidDrawIfPossibleCompleted(DrawSwapReadbackResult::DRAW_SUCCESS);
@@ -1672,7 +1531,8 @@ TEST(SchedulerStateMachineTest, TestImmediateFinishCommitDuringCommit) {
state.CommitState());
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
- EXPECT_TRUE(state.active_tree_needs_first_draw());
+ EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW,
+ state.CommitState());
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_AND_READBACK);
state.DidDrawIfPossibleCompleted(DrawSwapReadbackResult::DRAW_SUCCESS);
@@ -1706,7 +1566,8 @@ TEST(SchedulerStateMachineTest, ImmediateBeginMainFrameAbortedWhileInvisible) {
state.CommitState());
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
- EXPECT_TRUE(state.active_tree_needs_first_draw());
+ EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW,
+ state.CommitState());
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_AND_READBACK);
state.DidDrawIfPossibleCompleted(DrawSwapReadbackResult::DRAW_SUCCESS);
@@ -1747,7 +1608,8 @@ TEST(SchedulerStateMachineTest, ImmediateFinishCommitWhileCantDraw) {
state.CommitState());
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
- EXPECT_TRUE(state.active_tree_needs_first_draw());
+ EXPECT_EQ(SchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW,
+ state.CommitState());
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_DRAW_AND_READBACK);
state.DidDrawIfPossibleCompleted(DrawSwapReadbackResult::DRAW_SUCCESS);
diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc
index 171e71e..7a9b63f 100644
--- a/cc/trees/layer_tree_host_unittest_animation.cc
+++ b/cc/trees/layer_tree_host_unittest_animation.cc
@@ -829,15 +829,13 @@ MULTI_THREAD_TEST_F(LayerTreeHostAnimationTestContinuousAnimate);
class LayerTreeHostAnimationTestCancelAnimateCommit
: public LayerTreeHostAnimationTest {
public:
- LayerTreeHostAnimationTestCancelAnimateCommit()
- : num_animate_calls_(0), num_commit_calls_(0), num_draw_calls_(0) {}
+ LayerTreeHostAnimationTestCancelAnimateCommit() : num_animate_calls_(0) {}
virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
virtual void Animate(base::TimeTicks) OVERRIDE {
- num_animate_calls_++;
// No-op animate will cancel the commit.
- if (layer_tree_host()->source_frame_number() == 1) {
+ if (++num_animate_calls_ == 2) {
EndTest();
return;
}
@@ -845,27 +843,19 @@ class LayerTreeHostAnimationTestCancelAnimateCommit
}
virtual void CommitCompleteOnThread(LayerTreeHostImpl* tree_impl) OVERRIDE {
- num_commit_calls_++;
- if (layer_tree_host()->source_frame_number() > 1)
+ if (num_animate_calls_ > 1)
FAIL() << "Commit should have been canceled.";
}
virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
- num_draw_calls_++;
- if (layer_tree_host()->source_frame_number() > 1)
+ if (num_animate_calls_ > 1)
FAIL() << "Draw should have been canceled.";
}
- virtual void AfterTest() OVERRIDE {
- EXPECT_EQ(2, num_animate_calls_);
- EXPECT_EQ(1, num_commit_calls_);
- EXPECT_EQ(1, num_draw_calls_);
- }
+ virtual void AfterTest() OVERRIDE { EXPECT_EQ(2, num_animate_calls_); }
private:
int num_animate_calls_;
- int num_commit_calls_;
- int num_draw_calls_;
FakeContentLayerClient client_;
scoped_refptr<FakeContentLayer> content_;
};
diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc
index 925eda4..baf2b2d 100644
--- a/cc/trees/layer_tree_host_unittest_context.cc
+++ b/cc/trees/layer_tree_host_unittest_context.cc
@@ -1126,8 +1126,10 @@ class LayerTreeHostContextTestDontUseLostResources
// This will get called twice:
// First when we create the initial output surface...
if (layer_tree_host()->source_frame_number() > 0) {
- // ... and then again after we forced the context to be lost.
+ // ... and then again after we forced the context to be lost on the third
+ // frame. Verify this assumption here.
lost_context_ = true;
+ EXPECT_EQ(layer_tree_host()->source_frame_number(), 3);
}
return LayerTreeHostContextTest::CreateFakeOutputSurface(fallback);
}
@@ -1135,7 +1137,7 @@ class LayerTreeHostContextTestDontUseLostResources
virtual void DidCommitAndDrawFrame() OVERRIDE {
ASSERT_TRUE(layer_tree_host()->hud_layer());
// End the test once we know the 3nd frame drew.
- if (layer_tree_host()->source_frame_number() < 5) {
+ if (layer_tree_host()->source_frame_number() < 4) {
layer_tree_host()->root_layer()->SetNeedsDisplay();
layer_tree_host()->SetNeedsCommit();
} else {
diff --git a/cc/trees/layer_tree_settings.cc b/cc/trees/layer_tree_settings.cc
index 74fb0d0..bcc59d0 100644
--- a/cc/trees/layer_tree_settings.cc
+++ b/cc/trees/layer_tree_settings.cc
@@ -17,8 +17,6 @@ LayerTreeSettings::LayerTreeSettings()
allow_antialiasing(true),
throttle_frame_production(true),
begin_impl_frame_scheduling_enabled(false),
- main_frame_before_draw_enabled(true),
- main_frame_before_activation_enabled(false),
using_synchronous_renderer_compositor(false),
per_tile_painting_enabled(false),
partial_swap_enabled(false),
diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h
index 32f1d83..3e8f4ac 100644
--- a/cc/trees/layer_tree_settings.h
+++ b/cc/trees/layer_tree_settings.h
@@ -22,8 +22,6 @@ class CC_EXPORT LayerTreeSettings {
bool allow_antialiasing;
bool throttle_frame_production;
bool begin_impl_frame_scheduling_enabled;
- bool main_frame_before_draw_enabled;
- bool main_frame_before_activation_enabled;
bool using_synchronous_renderer_compositor;
bool per_tile_painting_enabled;
bool partial_swap_enabled;
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index bf55546f..58e89b0 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -984,6 +984,8 @@ void ThreadProxy::StartCommitOnImplThread(
CompletionEvent* completion,
ResourceUpdateQueue* raw_queue,
scoped_refptr<ContextProvider> offscreen_context_provider) {
+ scoped_ptr<ResourceUpdateQueue> queue(raw_queue);
+
TRACE_EVENT0("cc", "ThreadProxy::StartCommitOnImplThread");
DCHECK(!impl().commit_completion_event);
DCHECK(IsImplThread() && IsMainThreadBlocked());
@@ -1001,8 +1003,6 @@ void ThreadProxy::StartCommitOnImplThread(
// But, we can avoid a PostTask in here.
impl().scheduler->NotifyBeginMainFrameStarted();
- scoped_ptr<ResourceUpdateQueue> queue(raw_queue);
-
if (offscreen_context_provider.get())
offscreen_context_provider->BindToCurrentThread();
impl().layer_tree_host_impl->SetOffscreenContextProvider(
@@ -1465,10 +1465,6 @@ void ThreadProxy::InitializeImplOnImplThread(CompletionEvent* completion) {
layer_tree_host()->CreateLayerTreeHostImpl(this);
const LayerTreeSettings& settings = layer_tree_host()->settings();
SchedulerSettings scheduler_settings;
- scheduler_settings.main_frame_before_draw_enabled =
- settings.main_frame_before_draw_enabled;
- scheduler_settings.main_frame_before_activation_enabled =
- settings.main_frame_before_activation_enabled;
scheduler_settings.impl_side_painting = settings.impl_side_painting;
scheduler_settings.timeout_and_draw_when_animation_checkerboards =
settings.timeout_and_draw_when_animation_checkerboards;
diff --git a/chrome/browser/chromeos/login/chrome_restart_request.cc b/chrome/browser/chromeos/login/chrome_restart_request.cc
index f5f88c9..3e75e25 100644
--- a/chrome/browser/chromeos/login/chrome_restart_request.cc
+++ b/chrome/browser/chromeos/login/chrome_restart_request.cc
@@ -167,12 +167,9 @@ std::string DeriveCommandLine(const GURL& start_url,
cc::switches::kCompositeToMailbox,
cc::switches::kDisableCompositedAntialiasing,
cc::switches::kDisableCompositorTouchHitTesting,
- cc::switches::kDisableMainFrameBeforeActivation,
- cc::switches::kDisableMainFrameBeforeDraw,
cc::switches::kDisableThreadedAnimation,
cc::switches::kEnableGpuBenchmarking,
cc::switches::kEnablePinchVirtualViewport,
- cc::switches::kEnableMainFrameBeforeActivation,
cc::switches::kEnableTopControlsPositionCalculation,
cc::switches::kMaxTilesForInterestArea,
cc::switches::kMaxUnusedResourceMemoryUsagePercentage,
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index aa223b2..77712f6 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -1125,12 +1125,9 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
cc::switches::kCompositeToMailbox,
cc::switches::kDisableCompositedAntialiasing,
cc::switches::kDisableCompositorTouchHitTesting,
- cc::switches::kDisableMainFrameBeforeActivation,
- cc::switches::kDisableMainFrameBeforeDraw,
cc::switches::kDisableThreadedAnimation,
cc::switches::kEnableGpuBenchmarking,
cc::switches::kEnablePinchVirtualViewport,
- cc::switches::kEnableMainFrameBeforeActivation,
cc::switches::kEnableTopControlsPositionCalculation,
cc::switches::kMaxTilesForInterestArea,
cc::switches::kMaxUnusedResourceMemoryUsagePercentage,
diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc
index e030776..eafca984 100644
--- a/content/renderer/gpu/render_widget_compositor.cc
+++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -90,11 +90,6 @@ scoped_ptr<RenderWidgetCompositor> RenderWidgetCompositor::Create(
!cmd->HasSwitch(switches::kDisableGpuVsync);
settings.begin_impl_frame_scheduling_enabled =
cmd->HasSwitch(switches::kEnableBeginFrameScheduling);
- settings.main_frame_before_activation_enabled =
- cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) &&
- !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation);
- settings.main_frame_before_draw_enabled =
- !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeDraw);
settings.using_synchronous_renderer_compositor =
widget->UsingSynchronousRendererCompositor();
settings.accelerated_animation_enabled =
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index 2da23fd..9130273 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -210,8 +210,6 @@ Compositor::Compositor(gfx::AcceleratedWidget widget)
ContextFactory::GetInstance()->DoesCreateTestContexts()
? kTestRefreshRate
: kDefaultRefreshRate;
- settings.main_frame_before_draw_enabled = false;
- settings.main_frame_before_activation_enabled = false;
settings.partial_swap_enabled =
!command_line->HasSwitch(cc::switches::kUIDisablePartialSwap);
#if defined(OS_CHROMEOS)