OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "core/animation/TransitionKeyframe.h" |
| 6 |
| 7 #include "core/animation/CompositorAnimations.h" |
| 8 #include "core/animation/InterpolationType.h" |
| 9 #include "core/animation/PairwiseInterpolationValue.h" |
| 10 #include "core/animation/TransitionInterpolation.h" |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 void TransitionKeyframe::setCompositorValue( |
| 15 RefPtr<AnimatableValue> compositorValue) { |
| 16 DCHECK_EQ( |
| 17 CompositorAnimations::isCompositableProperty(m_property.cssProperty()), |
| 18 static_cast<bool>(compositorValue.get())); |
| 19 m_compositorValue = std::move(compositorValue); |
| 20 } |
| 21 |
| 22 PropertyHandleSet TransitionKeyframe::properties() const { |
| 23 PropertyHandleSet result; |
| 24 result.insert(m_property); |
| 25 return result; |
| 26 } |
| 27 |
| 28 PassRefPtr<Keyframe::PropertySpecificKeyframe> |
| 29 TransitionKeyframe::createPropertySpecificKeyframe( |
| 30 const PropertyHandle& property) const { |
| 31 DCHECK(property == m_property); |
| 32 return PropertySpecificKeyframe::create(offset(), &easing(), composite(), |
| 33 m_value->clone(), m_compositorValue); |
| 34 } |
| 35 |
| 36 PassRefPtr<Interpolation> |
| 37 TransitionKeyframe::PropertySpecificKeyframe::createInterpolation( |
| 38 const PropertyHandle& property, |
| 39 const Keyframe::PropertySpecificKeyframe& otherSuperClass) const { |
| 40 const PropertySpecificKeyframe& other = |
| 41 toTransitionPropertySpecificKeyframe(otherSuperClass); |
| 42 DCHECK(m_value->type() == other.m_value->type()); |
| 43 return TransitionInterpolation::create( |
| 44 property, m_value->type(), m_value->value().clone(), |
| 45 other.m_value->value().clone(), m_compositorValue, |
| 46 other.m_compositorValue); |
| 47 } |
| 48 |
| 49 } // namespace blink |
OLD | NEW |