OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "config.h" | 5 #include "config.h" |
6 #include "core/animation/StringKeyframe.h" | 6 #include "core/animation/StringKeyframe.h" |
7 | 7 |
8 #include "core/animation/AngleSVGInterpolation.h" | 8 #include "core/animation/AngleSVGInterpolation.h" |
9 #include "core/animation/ColorStyleInterpolation.h" | 9 #include "core/animation/ColorStyleInterpolation.h" |
10 #include "core/animation/CompositorAnimations.h" | 10 #include "core/animation/CompositorAnimations.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 ASSERT(property.isSVGAttribute()); | 96 ASSERT(property.isSVGAttribute()); |
97 return adoptPtrWillBeNoop(new SVGPropertySpecificKeyframe(offset(), &easing(
), svgPropertyValue(*property.svgAttribute()), composite())); | 97 return adoptPtrWillBeNoop(new SVGPropertySpecificKeyframe(offset(), &easing(
), svgPropertyValue(*property.svgAttribute()), composite())); |
98 } | 98 } |
99 | 99 |
100 DEFINE_TRACE(StringKeyframe) | 100 DEFINE_TRACE(StringKeyframe) |
101 { | 101 { |
102 visitor->trace(m_propertySet); | 102 visitor->trace(m_propertySet); |
103 Keyframe::trace(visitor); | 103 Keyframe::trace(visitor); |
104 } | 104 } |
105 | 105 |
106 StringKeyframe::CSSPropertySpecificKeyframe::CSSPropertySpecificKeyframe(double
offset, PassRefPtr<TimingFunction> easing, CSSValue* value, AnimationEffect::Com
positeOperation op) | 106 StringKeyframe::CSSPropertySpecificKeyframe::CSSPropertySpecificKeyframe(double
offset, PassRefPtr<TimingFunction> easing, CSSValue* value, EffectModel::Composi
teOperation op) |
107 : Keyframe::PropertySpecificKeyframe(offset, easing, op) | 107 : Keyframe::PropertySpecificKeyframe(offset, easing, op) |
108 , m_value(value) | 108 , m_value(value) |
109 { } | 109 { } |
110 | 110 |
111 StringKeyframe::CSSPropertySpecificKeyframe::CSSPropertySpecificKeyframe(double
offset, PassRefPtr<TimingFunction> easing, CSSValue* value) | 111 StringKeyframe::CSSPropertySpecificKeyframe::CSSPropertySpecificKeyframe(double
offset, PassRefPtr<TimingFunction> easing, CSSValue* value) |
112 : Keyframe::PropertySpecificKeyframe(offset, easing, AnimationEffect::Compos
iteReplace) | 112 : Keyframe::PropertySpecificKeyframe(offset, easing, EffectModel::CompositeR
eplace) |
113 , m_value(value) | 113 , m_value(value) |
114 { | 114 { |
115 ASSERT(!isNull(m_offset)); | 115 ASSERT(!isNull(m_offset)); |
116 } | 116 } |
117 | 117 |
118 void StringKeyframe::CSSPropertySpecificKeyframe::populateAnimatableValue(CSSPro
pertyID property, Element& element, const ComputedStyle* baseStyle) const | 118 void StringKeyframe::CSSPropertySpecificKeyframe::populateAnimatableValue(CSSPro
pertyID property, Element& element, const ComputedStyle* baseStyle) const |
119 { | 119 { |
120 if (!m_animatableValueCache && (baseStyle || !m_value->isInheritedValue())) | 120 if (!m_animatableValueCache && (baseStyle || !m_value->isInheritedValue())) |
121 m_animatableValueCache = StyleResolver::createAnimatableValueSnapshot(el
ement, baseStyle, property, m_value.get()); | 121 m_animatableValueCache = StyleResolver::createAnimatableValueSnapshot(el
ement, baseStyle, property, m_value.get()); |
122 } | 122 } |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 ASSERT(AnimatableValue::usesDefaultInterpolation( | 434 ASSERT(AnimatableValue::usesDefaultInterpolation( |
435 StyleResolver::createAnimatableValueSnapshot(*element, baseStyle, proper
ty, fromCSSValue).get(), | 435 StyleResolver::createAnimatableValueSnapshot(*element, baseStyle, proper
ty, fromCSSValue).get(), |
436 StyleResolver::createAnimatableValueSnapshot(*element, baseStyle, proper
ty, toCSSValue).get())); | 436 StyleResolver::createAnimatableValueSnapshot(*element, baseStyle, proper
ty, toCSSValue).get())); |
437 | 437 |
438 return nullptr; | 438 return nullptr; |
439 | 439 |
440 } | 440 } |
441 | 441 |
442 PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> StringKeyframe::CSSPr
opertySpecificKeyframe::neutralKeyframe(double offset, PassRefPtr<TimingFunction
> easing) const | 442 PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> StringKeyframe::CSSPr
opertySpecificKeyframe::neutralKeyframe(double offset, PassRefPtr<TimingFunction
> easing) const |
443 { | 443 { |
444 return adoptPtrWillBeNoop(new CSSPropertySpecificKeyframe(offset, easing, st
atic_cast<CSSValue*>(0), AnimationEffect::CompositeAdd)); | 444 return adoptPtrWillBeNoop(new CSSPropertySpecificKeyframe(offset, easing, st
atic_cast<CSSValue*>(0), EffectModel::CompositeAdd)); |
445 } | 445 } |
446 | 446 |
447 PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> StringKeyframe::CSSPr
opertySpecificKeyframe::cloneWithOffset(double offset) const | 447 PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> StringKeyframe::CSSPr
opertySpecificKeyframe::cloneWithOffset(double offset) const |
448 { | 448 { |
449 Keyframe::PropertySpecificKeyframe* theClone = new CSSPropertySpecificKeyfra
me(offset, m_easing, m_value.get()); | 449 Keyframe::PropertySpecificKeyframe* theClone = new CSSPropertySpecificKeyfra
me(offset, m_easing, m_value.get()); |
450 toCSSPropertySpecificKeyframe(theClone)->m_animatableValueCache = m_animatab
leValueCache; | 450 toCSSPropertySpecificKeyframe(theClone)->m_animatableValueCache = m_animatab
leValueCache; |
451 return adoptPtrWillBeNoop(theClone); | 451 return adoptPtrWillBeNoop(theClone); |
452 } | 452 } |
453 | 453 |
454 DEFINE_TRACE(StringKeyframe::CSSPropertySpecificKeyframe) | 454 DEFINE_TRACE(StringKeyframe::CSSPropertySpecificKeyframe) |
455 { | 455 { |
456 visitor->trace(m_value); | 456 visitor->trace(m_value); |
457 visitor->trace(m_animatableValueCache); | 457 visitor->trace(m_animatableValueCache); |
458 Keyframe::PropertySpecificKeyframe::trace(visitor); | 458 Keyframe::PropertySpecificKeyframe::trace(visitor); |
459 } | 459 } |
460 | 460 |
461 SVGPropertySpecificKeyframe::SVGPropertySpecificKeyframe(double offset, PassRefP
tr<TimingFunction> easing, const String& value, AnimationEffect::CompositeOperat
ion op) | 461 SVGPropertySpecificKeyframe::SVGPropertySpecificKeyframe(double offset, PassRefP
tr<TimingFunction> easing, const String& value, EffectModel::CompositeOperation
op) |
462 : Keyframe::PropertySpecificKeyframe(offset, easing, op) | 462 : Keyframe::PropertySpecificKeyframe(offset, easing, op) |
463 , m_value(value) | 463 , m_value(value) |
464 { | 464 { |
465 } | 465 } |
466 | 466 |
467 SVGPropertySpecificKeyframe::SVGPropertySpecificKeyframe(double offset, PassRefP
tr<TimingFunction> easing, const String& value) | 467 SVGPropertySpecificKeyframe::SVGPropertySpecificKeyframe(double offset, PassRefP
tr<TimingFunction> easing, const String& value) |
468 : Keyframe::PropertySpecificKeyframe(offset, easing, AnimationEffect::Compos
iteReplace) | 468 : Keyframe::PropertySpecificKeyframe(offset, easing, EffectModel::CompositeR
eplace) |
469 , m_value(value) | 469 , m_value(value) |
470 { | 470 { |
471 ASSERT(!isNull(m_offset)); | 471 ASSERT(!isNull(m_offset)); |
472 } | 472 } |
473 | 473 |
474 DEFINE_TRACE(StringKeyframe::SVGPropertySpecificKeyframe) | 474 DEFINE_TRACE(StringKeyframe::SVGPropertySpecificKeyframe) |
475 { | 475 { |
476 Keyframe::PropertySpecificKeyframe::trace(visitor); | 476 Keyframe::PropertySpecificKeyframe::trace(visitor); |
477 } | 477 } |
478 | 478 |
479 PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> SVGPropertySpecificKe
yframe::cloneWithOffset(double offset) const | 479 PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> SVGPropertySpecificKe
yframe::cloneWithOffset(double offset) const |
480 { | 480 { |
481 return adoptPtrWillBeNoop(new SVGPropertySpecificKeyframe(offset, m_easing,
m_value)); | 481 return adoptPtrWillBeNoop(new SVGPropertySpecificKeyframe(offset, m_easing,
m_value)); |
482 } | 482 } |
483 | 483 |
484 PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> SVGPropertySpecificKe
yframe::neutralKeyframe(double offset, PassRefPtr<TimingFunction> easing) const | 484 PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> SVGPropertySpecificKe
yframe::neutralKeyframe(double offset, PassRefPtr<TimingFunction> easing) const |
485 { | 485 { |
486 return adoptPtrWillBeNoop(new SVGPropertySpecificKeyframe(offset, easing, ""
, AnimationEffect::CompositeAdd)); | 486 return adoptPtrWillBeNoop(new SVGPropertySpecificKeyframe(offset, easing, ""
, EffectModel::CompositeAdd)); |
487 } | 487 } |
488 | 488 |
489 namespace { | 489 namespace { |
490 | 490 |
491 PassRefPtrWillBeRawPtr<Interpolation> createSVGInterpolation(SVGPropertyBase* fr
omValue, SVGPropertyBase* toValue, SVGAnimatedPropertyBase* attribute) | 491 PassRefPtrWillBeRawPtr<Interpolation> createSVGInterpolation(SVGPropertyBase* fr
omValue, SVGPropertyBase* toValue, SVGAnimatedPropertyBase* attribute) |
492 { | 492 { |
493 RefPtrWillBeRawPtr<Interpolation> interpolation = nullptr; | 493 RefPtrWillBeRawPtr<Interpolation> interpolation = nullptr; |
494 ASSERT(fromValue->type() == toValue->type()); | 494 ASSERT(fromValue->type() == toValue->type()); |
495 switch (fromValue->type()) { | 495 switch (fromValue->type()) { |
496 case AnimatedAngle: | 496 case AnimatedAngle: |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 RefPtrWillBeRawPtr<SVGPropertyBase> fromValue = attribute->currentValueBase(
)->cloneForAnimation(m_value); | 550 RefPtrWillBeRawPtr<SVGPropertyBase> fromValue = attribute->currentValueBase(
)->cloneForAnimation(m_value); |
551 RefPtrWillBeRawPtr<SVGPropertyBase> toValue = attribute->currentValueBase()-
>cloneForAnimation(toSVGPropertySpecificKeyframe(end).value()); | 551 RefPtrWillBeRawPtr<SVGPropertyBase> toValue = attribute->currentValueBase()-
>cloneForAnimation(toSVGPropertySpecificKeyframe(end).value()); |
552 | 552 |
553 if (!fromValue || !toValue) | 553 if (!fromValue || !toValue) |
554 return nullptr; | 554 return nullptr; |
555 | 555 |
556 return createSVGInterpolation(fromValue.get(), toValue.get(), attribute.get(
)); | 556 return createSVGInterpolation(fromValue.get(), toValue.get(), attribute.get(
)); |
557 } | 557 } |
558 | 558 |
559 } // namespace blink | 559 } // namespace blink |
OLD | NEW |