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

Add early out in SMIL 'next progress time' search

As soon as we get a progress time that isn't "in the future" we can
terminate the search.

Bug: 998526
Change-Id: Ic5bea2235ba6337dc9a7759438700716a865b651
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1798608
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695967}
parent d68fc4d8
...@@ -85,6 +85,8 @@ SMILTime SMILAnimationSandwich::NextProgressTime( ...@@ -85,6 +85,8 @@ SMILTime SMILAnimationSandwich::NextProgressTime(
for (const auto& animation : sandwich_) { for (const auto& animation : sandwich_) {
earliest_progress_time = std::min( earliest_progress_time = std::min(
earliest_progress_time, animation->NextProgressTime(presentation_time)); earliest_progress_time, animation->NextProgressTime(presentation_time));
if (earliest_progress_time <= presentation_time)
break;
} }
return earliest_progress_time; return earliest_progress_time;
} }
......
...@@ -424,9 +424,11 @@ void SMILTimeContainer::UpdateAnimationsAndScheduleFrameIfNeeded( ...@@ -424,9 +424,11 @@ void SMILTimeContainer::UpdateAnimationsAndScheduleFrameIfNeeded(
ApplyAnimationValues(elapsed); ApplyAnimationValues(elapsed);
SMILTime next_progress_time = SMILTime::Unresolved(); SMILTime next_progress_time = SMILTime::Unresolved();
for (auto& sandwich : scheduled_animations_) { for (auto& sandwich : scheduled_animations_.Values()) {
next_progress_time = next_progress_time =
std::min(next_progress_time, sandwich.value->NextProgressTime(elapsed)); std::min(next_progress_time, sandwich->NextProgressTime(elapsed));
if (next_progress_time <= elapsed)
break;
} }
if (!CanScheduleFrame(next_progress_time)) if (!CanScheduleFrame(next_progress_time))
......
...@@ -1057,7 +1057,7 @@ SMILTime SVGSMILElement::NextProgressTime(double presentation_time) const { ...@@ -1057,7 +1057,7 @@ SMILTime SVGSMILElement::NextProgressTime(double presentation_time) const {
return repeating_duration_end; return repeating_duration_end;
return interval_.end; return interval_.end;
} }
return presentation_time + 0.025; return presentation_time;
} }
return interval_.begin >= presentation_time ? interval_.begin return interval_.begin >= presentation_time ? interval_.begin
: SMILTime::Unresolved(); : SMILTime::Unresolved();
......
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