| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/animation/TransitionInterpolation.h" | 5 #include "core/animation/TransitionInterpolation.h" |
| 6 | 6 |
| 7 #include "core/animation/CSSInterpolationTypesMap.h" | 7 #include "core/animation/CSSInterpolationTypesMap.h" |
| 8 #include "core/animation/InterpolationEnvironment.h" | 8 #include "core/animation/InterpolationEnvironment.h" |
| 9 #include "core/animation/InterpolationType.h" | 9 #include "core/animation/InterpolationType.h" |
| 10 #include "core/css/resolver/StyleResolverState.h" | 10 #include "core/css/resolver/StyleResolverState.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 return start_.non_interpolable_value.Get(); | 40 return start_.non_interpolable_value.Get(); |
| 41 } | 41 } |
| 42 if (cached_fraction_ == 1) { | 42 if (cached_fraction_ == 1) { |
| 43 return end_.non_interpolable_value.Get(); | 43 return end_.non_interpolable_value.Get(); |
| 44 } | 44 } |
| 45 return merge_.non_interpolable_value.Get(); | 45 return merge_.non_interpolable_value.Get(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void TransitionInterpolation::Apply(StyleResolverState& state) const { | 48 void TransitionInterpolation::Apply(StyleResolverState& state) const { |
| 49 CSSInterpolationTypesMap map(state.GetDocument().GetPropertyRegistry()); | 49 CSSInterpolationTypesMap map(state.GetDocument().GetPropertyRegistry()); |
| 50 InterpolationEnvironment environment(map, state); | 50 CSSInterpolationEnvironment environment(map, state); |
| 51 type_.Apply(CurrentInterpolableValue(), CurrentNonInterpolableValue(), | 51 type_.Apply(CurrentInterpolableValue(), CurrentNonInterpolableValue(), |
| 52 environment); | 52 environment); |
| 53 } | 53 } |
| 54 | 54 |
| 55 std::unique_ptr<TypedInterpolationValue> | 55 std::unique_ptr<TypedInterpolationValue> |
| 56 TransitionInterpolation::GetInterpolatedValue() const { | 56 TransitionInterpolation::GetInterpolatedValue() const { |
| 57 return TypedInterpolationValue::Create( | 57 return TypedInterpolationValue::Create( |
| 58 type_, CurrentInterpolableValue().Clone(), CurrentNonInterpolableValue()); | 58 type_, CurrentInterpolableValue().Clone(), CurrentNonInterpolableValue()); |
| 59 } | 59 } |
| 60 | 60 |
| 61 RefPtr<AnimatableValue> | 61 RefPtr<AnimatableValue> |
| 62 TransitionInterpolation::GetInterpolatedCompositorValue() const { | 62 TransitionInterpolation::GetInterpolatedCompositorValue() const { |
| 63 return AnimatableValue::Interpolate(compositor_start_.Get(), | 63 return AnimatableValue::Interpolate(compositor_start_.Get(), |
| 64 compositor_end_.Get(), cached_fraction_); | 64 compositor_end_.Get(), cached_fraction_); |
| 65 } | 65 } |
| 66 | 66 |
| 67 } // namespace blink | 67 } // namespace blink |
| OLD | NEW |