Commit 6f314cd5 authored by Fredrik Söderquist's avatar Fredrik Söderquist Committed by Commit Bot

Improve forward seeking in SMILTimeContainer

When seeking forward we don't need to reset all the timed elements, but
can just move from the latest update time to the new presentation time
directly.

Bug: 998526
Change-Id: I1866b59b4e02f9de1a26c6a5844c4d8893dd68b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1856161Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#705393}
parent 87562b78
...@@ -275,16 +275,21 @@ void SMILTimeContainer::SetElapsed(SMILTime elapsed) { ...@@ -275,16 +275,21 @@ void SMILTimeContainer::SetElapsed(SMILTime elapsed) {
if (!IsPaused()) if (!IsPaused())
SynchronizeToDocumentTimeline(); SynchronizeToDocumentTimeline();
{ // If we are rewinding the timeline, we need to start from 0 and then move
// forward to the new presentation time. If we're moving forward we can just
// perform the update in the normal fashion.
if (elapsed < latest_update_time_) {
base::AutoReset<bool> updating_intervals_scope(&is_updating_intervals_, base::AutoReset<bool> updating_intervals_scope(&is_updating_intervals_,
true); true);
ScheduledAnimationsMutationsForbidden scope(this); ScheduledAnimationsMutationsForbidden scope(this);
for (auto& sandwich : scheduled_animations_.Values()) for (auto& sandwich : scheduled_animations_.Values())
sandwich->Reset(); sandwich->Reset();
}
latest_update_time_ = SMILTime();
}
// We need to set this to make sure we update the active state of the timed
// elements.
intervals_dirty_ = true; intervals_dirty_ = true;
latest_update_time_ = SMILTime();
UpdateAnimationsAndScheduleFrameIfNeeded(elapsed); UpdateAnimationsAndScheduleFrameIfNeeded(elapsed);
} }
......
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