Commit 29dfb840 authored by Sergio Villar Senin's avatar Sergio Villar Senin Committed by Commit Bot

Do not pass iteration_duration to CalculateTransformedProgress

It's unused so there is no point in passing it.

Bug: 994811
Change-Id: Ib7923897beaaf7b302c3d49b23d5da9fe11e32e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1792892Reviewed-by: default avatarStephen McGruer <smcgruer@chromium.org>
Commit-Queue: Sergio Villar <svillar@igalia.com>
Cr-Commit-Position: refs/heads/master@{#695068}
parent 8d371f43
...@@ -182,9 +182,9 @@ Timing::CalculatedTiming Timing::CalculateTimings( ...@@ -182,9 +182,9 @@ Timing::CalculatedTiming Timing::CalculateTimings(
const base::Optional<double> directed_progress = CalculateDirectedProgress( const base::Optional<double> directed_progress = CalculateDirectedProgress(
simple_iteration_progress, current_iteration, direction); simple_iteration_progress, current_iteration, direction);
progress = CalculateTransformedProgress( progress = CalculateTransformedProgress(current_phase, directed_progress,
current_phase, directed_progress, iteration_duration, current_direction_is_forwards,
current_direction_is_forwards, timing_function); timing_function);
double time_to_next_iteration = std::numeric_limits<double>::infinity(); double time_to_next_iteration = std::numeric_limits<double>::infinity();
// Conditionally compute the time to next iteration, which is only // Conditionally compute the time to next iteration, which is only
......
...@@ -279,7 +279,6 @@ static inline base::Optional<double> CalculateDirectedProgress( ...@@ -279,7 +279,6 @@ static inline base::Optional<double> CalculateDirectedProgress(
static inline base::Optional<double> CalculateTransformedProgress( static inline base::Optional<double> CalculateTransformedProgress(
Timing::Phase phase, Timing::Phase phase,
base::Optional<double> directed_progress, base::Optional<double> directed_progress,
double iteration_duration,
bool is_current_direction_forward, bool is_current_direction_forward,
scoped_refptr<TimingFunction> timing_function) { scoped_refptr<TimingFunction> timing_function) {
if (!directed_progress) if (!directed_progress)
......
...@@ -317,7 +317,7 @@ TEST(AnimationTimingCalculationsTest, CalculateDirectedProgress) { ...@@ -317,7 +317,7 @@ TEST(AnimationTimingCalculationsTest, CalculateDirectedProgress) {
TEST(AnimationTimingCalculationsTest, TransformedProgress) { TEST(AnimationTimingCalculationsTest, TransformedProgress) {
// CalculateTransformedProgress( // CalculateTransformedProgress(
// phase, directed_progress, iteration_duraction, // phase, directed_progress,
// is_current_direction_forward, timing_function) // is_current_direction_forward, timing_function)
scoped_refptr<TimingFunction> timing_function = scoped_refptr<TimingFunction> timing_function =
...@@ -325,53 +325,53 @@ TEST(AnimationTimingCalculationsTest, TransformedProgress) { ...@@ -325,53 +325,53 @@ TEST(AnimationTimingCalculationsTest, TransformedProgress) {
// directed_progress is null. // directed_progress is null.
EXPECT_FALSE(CalculateTransformedProgress(Timing::kPhaseActive, base::nullopt, EXPECT_FALSE(CalculateTransformedProgress(Timing::kPhaseActive, base::nullopt,
1, true, timing_function)); true, timing_function));
// At step boundaries. // At step boundaries.
// Forward direction. // Forward direction.
EXPECT_EQ(0, CalculateTransformedProgress(Timing::kPhaseBefore, 0, 1, true, EXPECT_EQ(0, CalculateTransformedProgress(Timing::kPhaseBefore, 0, true,
timing_function)); timing_function));
EXPECT_EQ(0, CalculateTransformedProgress(Timing::kPhaseBefore, 0.25, 1, true, EXPECT_EQ(0, CalculateTransformedProgress(Timing::kPhaseBefore, 0.25, true,
timing_function)); timing_function));
EXPECT_EQ(0.25, CalculateTransformedProgress(Timing::kPhaseAfter, 0.25, 1, EXPECT_EQ(0.25, CalculateTransformedProgress(Timing::kPhaseAfter, 0.25, true,
true, timing_function)); timing_function));
EXPECT_EQ(0.25, CalculateTransformedProgress(Timing::kPhaseBefore, 0.5, 1, EXPECT_EQ(0.25, CalculateTransformedProgress(Timing::kPhaseBefore, 0.5, true,
true, timing_function)); timing_function));
EXPECT_EQ(0.5, CalculateTransformedProgress(Timing::kPhaseAfter, 0.5, 1, true, EXPECT_EQ(0.5, CalculateTransformedProgress(Timing::kPhaseAfter, 0.5, true,
timing_function)); timing_function));
EXPECT_EQ(0.5, CalculateTransformedProgress(Timing::kPhaseBefore, 0.75, 1, EXPECT_EQ(0.5, CalculateTransformedProgress(Timing::kPhaseBefore, 0.75, true,
true, timing_function)); timing_function));
EXPECT_EQ(0.75, CalculateTransformedProgress(Timing::kPhaseAfter, 0.75, 1, EXPECT_EQ(0.75, CalculateTransformedProgress(Timing::kPhaseAfter, 0.75, true,
true, timing_function)); timing_function));
EXPECT_EQ(0.75, CalculateTransformedProgress(Timing::kPhaseBefore, 1, 1, true, EXPECT_EQ(0.75, CalculateTransformedProgress(Timing::kPhaseBefore, 1, true,
timing_function)); timing_function));
EXPECT_EQ(1, CalculateTransformedProgress(Timing::kPhaseAfter, 1, 1, true, EXPECT_EQ(1, CalculateTransformedProgress(Timing::kPhaseAfter, 1, true,
timing_function)); timing_function));
// Reverse direction. // Reverse direction.
EXPECT_EQ(1, CalculateTransformedProgress(Timing::kPhaseBefore, 1, 1, false, EXPECT_EQ(1, CalculateTransformedProgress(Timing::kPhaseBefore, 1, false,
timing_function)); timing_function));
EXPECT_EQ(0.75, CalculateTransformedProgress(Timing::kPhaseAfter, 1, 1, false, EXPECT_EQ(0.75, CalculateTransformedProgress(Timing::kPhaseAfter, 1, false,
timing_function)); timing_function));
EXPECT_EQ(0.75, CalculateTransformedProgress(Timing::kPhaseBefore, 0.75, 1, EXPECT_EQ(0.75, CalculateTransformedProgress(Timing::kPhaseBefore, 0.75,
false, timing_function)); false, timing_function));
EXPECT_EQ(0.5, CalculateTransformedProgress(Timing::kPhaseAfter, 0.75, 1, EXPECT_EQ(0.5, CalculateTransformedProgress(Timing::kPhaseAfter, 0.75, false,
false, timing_function)); timing_function));
EXPECT_EQ(0.5, CalculateTransformedProgress(Timing::kPhaseBefore, 0.5, 1, EXPECT_EQ(0.5, CalculateTransformedProgress(Timing::kPhaseBefore, 0.5, false,
false, timing_function)); timing_function));
EXPECT_EQ(0.25, CalculateTransformedProgress(Timing::kPhaseAfter, 0.5, 1, EXPECT_EQ(0.25, CalculateTransformedProgress(Timing::kPhaseAfter, 0.5, false,
false, timing_function)); timing_function));
EXPECT_EQ(0.25, CalculateTransformedProgress(Timing::kPhaseBefore, 0.25, 1, EXPECT_EQ(0.25, CalculateTransformedProgress(Timing::kPhaseBefore, 0.25,
false, timing_function)); false, timing_function));
EXPECT_EQ(0, CalculateTransformedProgress(Timing::kPhaseAfter, 0.25, 1, false, EXPECT_EQ(0, CalculateTransformedProgress(Timing::kPhaseAfter, 0.25, false,
timing_function)); timing_function));
// Edges cases // Edges cases
EXPECT_EQ(1, CalculateTransformedProgress(Timing::kPhaseAfter, 1 - 1e-16, 1, EXPECT_EQ(1, CalculateTransformedProgress(Timing::kPhaseAfter, 1 - 1e-16,
true, timing_function)); true, timing_function));
scoped_refptr<TimingFunction> step_start_timing_function = scoped_refptr<TimingFunction> step_start_timing_function =
StepsTimingFunction::Create(4, StepsTimingFunction::StepPosition::START); StepsTimingFunction::Create(4, StepsTimingFunction::StepPosition::START);
EXPECT_EQ(0, CalculateTransformedProgress(Timing::kPhaseAfter, 1e-16, 1, EXPECT_EQ(0, CalculateTransformedProgress(Timing::kPhaseAfter, 1e-16, false,
false, step_start_timing_function)); step_start_timing_function));
} }
} // namespace blink } // namespace blink
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