Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Unified Diff: trunk/src/cc/scheduler/scheduler_state_machine.cc

Issue 254883004: Revert 266624 "cc: Split animating and drawing into separate act..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: trunk/src/cc/scheduler/scheduler_state_machine.cc
===================================================================
--- trunk/src/cc/scheduler/scheduler_state_machine.cc (revision 266894)
+++ trunk/src/cc/scheduler/scheduler_state_machine.cc (working copy)
@@ -22,7 +22,6 @@
readback_state_(READBACK_STATE_IDLE),
commit_count_(0),
current_frame_number_(0),
- last_frame_number_animate_performed_(-1),
last_frame_number_swap_performed_(-1),
last_frame_number_begin_main_frame_sent_(-1),
last_frame_number_update_visible_tiles_was_called_(-1),
@@ -31,7 +30,6 @@
max_pending_swaps_(1),
pending_swaps_(0),
needs_redraw_(false),
- needs_animate_(false),
needs_manage_tiles_(false),
swap_used_incomplete_tile_(false),
needs_commit_(false),
@@ -48,8 +46,7 @@
skip_next_begin_main_frame_to_reduce_latency_(false),
skip_begin_main_frame_to_reduce_latency_(false),
continuous_painting_(false),
- needs_back_to_back_readback_(false) {
-}
+ needs_back_to_back_readback_(false) {}
const char* SchedulerStateMachine::OutputSurfaceStateToString(
OutputSurfaceState state) {
@@ -146,8 +143,6 @@
switch (action) {
case ACTION_NONE:
return "ACTION_NONE";
- case ACTION_ANIMATE:
- return "ACTION_ANIMATE";
case ACTION_SEND_BEGIN_MAIN_FRAME:
return "ACTION_SEND_BEGIN_MAIN_FRAME";
case ACTION_COMMIT:
@@ -221,8 +216,6 @@
minor_state->SetInteger("commit_count", commit_count_);
minor_state->SetInteger("current_frame_number", current_frame_number_);
- minor_state->SetInteger("last_frame_number_animate_performed",
- last_frame_number_animate_performed_);
minor_state->SetInteger("last_frame_number_swap_performed",
last_frame_number_swap_performed_);
minor_state->SetInteger(
@@ -238,7 +231,6 @@
minor_state->SetInteger("max_pending_swaps_", max_pending_swaps_);
minor_state->SetInteger("pending_swaps_", pending_swaps_);
minor_state->SetBoolean("needs_redraw", needs_redraw_);
- minor_state->SetBoolean("needs_animate_", needs_animate_);
minor_state->SetBoolean("needs_manage_tiles", needs_manage_tiles_);
minor_state->SetBoolean("swap_used_incomplete_tile",
swap_used_incomplete_tile_);
@@ -435,20 +427,6 @@
return false;
}
-bool SchedulerStateMachine::ShouldAnimate() const {
- if (!can_draw_)
- return false;
-
- if (last_frame_number_animate_performed_ == current_frame_number_)
- return false;
-
- if (begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_BEGIN_FRAME_STARTING &&
- begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE)
- return false;
-
- return needs_redraw_ || needs_animate_;
-}
-
bool SchedulerStateMachine::ShouldSendBeginMainFrame() const {
if (!needs_commit_)
return false;
@@ -553,8 +531,6 @@
return ACTION_ACTIVATE_PENDING_TREE;
if (ShouldCommit())
return ACTION_COMMIT;
- if (ShouldAnimate())
- return ACTION_ANIMATE;
if (ShouldDraw()) {
if (readback_state_ == READBACK_STATE_WAITING_FOR_DRAW_AND_READBACK)
return ACTION_DRAW_AND_READBACK;
@@ -595,14 +571,6 @@
UpdateStateOnActivation();
return;
- case ACTION_ANIMATE:
- last_frame_number_animate_performed_ = current_frame_number_;
- needs_animate_ = false;
- // TODO(skyostil): Instead of assuming this, require the client to tell
- // us.
- SetNeedsRedraw();
- return;
-
case ACTION_SEND_BEGIN_MAIN_FRAME:
DCHECK(!has_pending_tree_ ||
settings_.main_frame_before_activation_enabled);
@@ -815,9 +783,9 @@
// To poll for state with the synchronous compositor without having to draw,
// we rely on ShouldPollForAnticipatedDrawTriggers instead.
if (!SupportsProactiveBeginFrame())
- return BeginFrameNeededToAnimateOrDraw();
+ return BeginFrameNeededToDraw();
- return BeginFrameNeededToAnimateOrDraw() || ProactiveBeginFrameWanted();
+ return BeginFrameNeededToDraw() || ProactiveBeginFrameWanted();
}
bool SchedulerStateMachine::ShouldPollForAnticipatedDrawTriggers() const {
@@ -825,7 +793,7 @@
// ProactiveBeginFrameWanted when we are using the synchronous
// compositor.
if (!SupportsProactiveBeginFrame()) {
- return !BeginFrameNeededToAnimateOrDraw() && ProactiveBeginFrameWanted();
+ return !BeginFrameNeededToDraw() && ProactiveBeginFrameWanted();
}
// Non synchronous compositors should rely on
@@ -844,8 +812,8 @@
}
// These are the cases where we definitely (or almost definitely) have a
-// new frame to animate and/or draw and can draw.
-bool SchedulerStateMachine::BeginFrameNeededToAnimateOrDraw() const {
+// new frame to draw and can draw.
+bool SchedulerStateMachine::BeginFrameNeededToDraw() const {
// The output surface is the provider of BeginImplFrames, so we are not going
// to get them even if we ask for them.
if (!HasInitializedOutputSurface())
@@ -870,9 +838,6 @@
if (swap_used_incomplete_tile_)
return true;
- if (needs_animate_)
- return true;
-
return needs_redraw_;
}
@@ -1042,10 +1007,6 @@
void SchedulerStateMachine::SetNeedsRedraw() { needs_redraw_ = true; }
-void SchedulerStateMachine::SetNeedsAnimate() {
- needs_animate_ = true;
-}
-
void SchedulerStateMachine::SetNeedsManageTiles() {
if (!needs_manage_tiles_) {
TRACE_EVENT0("cc",
« no previous file with comments | « trunk/src/cc/scheduler/scheduler_state_machine.h ('k') | trunk/src/cc/scheduler/scheduler_state_machine_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698