Index: third_party/WebKit/Source/core/animation/TransitionKeyframe.cpp |
diff --git a/third_party/WebKit/Source/core/animation/TransitionKeyframe.cpp b/third_party/WebKit/Source/core/animation/TransitionKeyframe.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2fd8d8c64a340b290c68704cd500a30151db1071 |
--- /dev/null |
+++ b/third_party/WebKit/Source/core/animation/TransitionKeyframe.cpp |
@@ -0,0 +1,50 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "core/animation/TransitionKeyframe.h" |
+ |
+#include "core/animation/CompositorAnimations.h" |
+#include "core/animation/InterpolationType.h" |
+#include "core/animation/PairwiseInterpolationValue.h" |
+#include "core/animation/TransitionInterpolation.h" |
+ |
+namespace blink { |
+ |
+void TransitionKeyframe::setCompositorValue( |
+ RefPtr<AnimatableValue> compositorValue) { |
+ DCHECK_EQ( |
+ CompositorAnimations::isCompositableProperty(m_property.cssProperty()), |
+ static_cast<bool>(compositorValue.get())); |
+ m_compositorValue = std::move(compositorValue); |
+} |
+ |
+PropertyHandleSet TransitionKeyframe::properties() const { |
+ PropertyHandleSet result; |
+ result.add(m_property); |
+ return result; |
+} |
+ |
+PassRefPtr<Keyframe::PropertySpecificKeyframe> |
+TransitionKeyframe::createPropertySpecificKeyframe( |
+ PropertyHandle property) const { |
+ DCHECK(property == m_property); |
+ return PropertySpecificKeyframe::create(offset(), &easing(), composite(), |
+ m_value->clone(), m_compositorValue); |
+} |
+ |
+PassRefPtr<Interpolation> |
+TransitionKeyframe::PropertySpecificKeyframe::createInterpolation( |
+ PropertyHandle property, |
+ const Keyframe::PropertySpecificKeyframe& otherSuperClass) const { |
+ const PropertySpecificKeyframe& other = |
+ toTransitionPropertySpecificKeyframe(otherSuperClass); |
+ DCHECK(m_value->type() == other.m_value->type()); |
+ PairwiseInterpolationValue merge = m_value->type().maybeMergeSingles( |
+ m_value->value().clone(), other.m_value->value().clone()); |
+ DCHECK(merge); |
+ return TransitionInterpolation::create(property, m_value->type(), |
+ std::move(merge)); |
+} |
+ |
+} // namespace blink |