Commit 5bf0642f authored by Kevin Ellis's avatar Kevin Ellis Committed by Commit Bot

Fix performance regression introduced by CL 1715764

This patch fixes the calculation of when the compositor state needs
synchronization.  Ordering is important in the calculation of play
state, and some idle and pause states were being misclassified as
pending.

Bug: 988471, 988607
Change-Id: Ie73c57a3101f07bc44d5c353328d7e17d4fb1a99
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1728074Reviewed-by: default avatarRobert Flack <flackr@chromium.org>
Commit-Queue: Kevin Ellis <kevers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#682889}
parent 8915f96d
......@@ -693,7 +693,7 @@ Animation::AnimationPlayState Animation::CalculatePlayState() const {
return kPaused;
if (internal_play_state_ == kIdle)
return kIdle;
if (NeedsCompositorTimeSync())
if (current_time_pending_ || (!start_time_ && playback_rate_ != 0))
return kPending;
if (Limited())
return kFinished;
......
......@@ -150,7 +150,8 @@ class CORE_EXPORT Animation : public EventTargetWithInlineData,
// the play state (running/paused) requires synchronization with the
// compositor.
bool NeedsCompositorTimeSync() const {
return current_time_pending_ || (!start_time_ && playback_rate_ != 0);
// TODO(crbug.com/958433): Eliminate need for pending play state.
return internal_play_state_ == kPending;
}
AnimationPlayState GetPlayState() const;
......
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