| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 #include "sky/engine/bindings/core/v8/Dictionary.h" | 34 #include "sky/engine/bindings/core/v8/Dictionary.h" |
| 35 #include "sky/engine/bindings/core/v8/ExceptionState.h" | 35 #include "sky/engine/bindings/core/v8/ExceptionState.h" |
| 36 #include "sky/engine/core/animation/ActiveAnimations.h" | 36 #include "sky/engine/core/animation/ActiveAnimations.h" |
| 37 #include "sky/engine/core/animation/AnimationHelpers.h" | 37 #include "sky/engine/core/animation/AnimationHelpers.h" |
| 38 #include "sky/engine/core/animation/AnimationPlayer.h" | 38 #include "sky/engine/core/animation/AnimationPlayer.h" |
| 39 #include "sky/engine/core/animation/AnimationTimeline.h" | 39 #include "sky/engine/core/animation/AnimationTimeline.h" |
| 40 #include "sky/engine/core/animation/Interpolation.h" | 40 #include "sky/engine/core/animation/Interpolation.h" |
| 41 #include "sky/engine/core/animation/KeyframeEffectModel.h" | 41 #include "sky/engine/core/animation/KeyframeEffectModel.h" |
| 42 #include "sky/engine/core/dom/Element.h" | 42 #include "sky/engine/core/dom/Element.h" |
| 43 #include "sky/engine/core/frame/UseCounter.h" | |
| 44 #include "sky/engine/core/rendering/RenderLayer.h" | 43 #include "sky/engine/core/rendering/RenderLayer.h" |
| 45 | 44 |
| 46 namespace blink { | 45 namespace blink { |
| 47 | 46 |
| 48 PassRefPtr<Animation> Animation::create(Element* target, PassRefPtr<AnimationEff
ect> effect, const Timing& timing, Priority priority, PassOwnPtr<EventDelegate>
eventDelegate) | 47 PassRefPtr<Animation> Animation::create(Element* target, PassRefPtr<AnimationEff
ect> effect, const Timing& timing, Priority priority, PassOwnPtr<EventDelegate>
eventDelegate) |
| 49 { | 48 { |
| 50 return adoptRef(new Animation(target, effect, timing, priority, eventDelegat
e)); | 49 return adoptRef(new Animation(target, effect, timing, priority, eventDelegat
e)); |
| 51 } | 50 } |
| 52 | 51 |
| 53 PassRefPtr<Animation> Animation::create(Element* element, PassRefPtr<AnimationEf
fect> effect, const Dictionary& timingInputDictionary) | 52 PassRefPtr<Animation> Animation::create(Element* element, PassRefPtr<AnimationEf
fect> effect, const Dictionary& timingInputDictionary) |
| 54 { | 53 { |
| 55 return create(element, effect, TimingInput::convert(timingInputDictionary)); | 54 return create(element, effect, TimingInput::convert(timingInputDictionary)); |
| 56 } | 55 } |
| 57 PassRefPtr<Animation> Animation::create(Element* element, PassRefPtr<AnimationEf
fect> effect, double duration) | 56 PassRefPtr<Animation> Animation::create(Element* element, PassRefPtr<AnimationEf
fect> effect, double duration) |
| 58 { | 57 { |
| 59 return create(element, effect, TimingInput::convert(duration)); | 58 return create(element, effect, TimingInput::convert(duration)); |
| 60 } | 59 } |
| 61 PassRefPtr<Animation> Animation::create(Element* element, PassRefPtr<AnimationEf
fect> effect) | 60 PassRefPtr<Animation> Animation::create(Element* element, PassRefPtr<AnimationEf
fect> effect) |
| 62 { | 61 { |
| 63 return create(element, effect, Timing()); | 62 return create(element, effect, Timing()); |
| 64 } | 63 } |
| 65 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar
y>& keyframeDictionaryVector, const Dictionary& timingInputDictionary, Exception
State& exceptionState) | 64 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar
y>& keyframeDictionaryVector, const Dictionary& timingInputDictionary, Exception
State& exceptionState) |
| 66 { | 65 { |
| 67 if (element) | |
| 68 UseCounter::count(element->document(), UseCounter::AnimationConstructorK
eyframeListEffectObjectTiming); | |
| 69 return create(element, EffectInput::convert(element, keyframeDictionaryVecto
r, exceptionState), TimingInput::convert(timingInputDictionary)); | 66 return create(element, EffectInput::convert(element, keyframeDictionaryVecto
r, exceptionState), TimingInput::convert(timingInputDictionary)); |
| 70 } | 67 } |
| 71 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar
y>& keyframeDictionaryVector, double duration, ExceptionState& exceptionState) | 68 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar
y>& keyframeDictionaryVector, double duration, ExceptionState& exceptionState) |
| 72 { | 69 { |
| 73 if (element) | |
| 74 UseCounter::count(element->document(), UseCounter::AnimationConstructorK
eyframeListEffectDoubleTiming); | |
| 75 return create(element, EffectInput::convert(element, keyframeDictionaryVecto
r, exceptionState), TimingInput::convert(duration)); | 70 return create(element, EffectInput::convert(element, keyframeDictionaryVecto
r, exceptionState), TimingInput::convert(duration)); |
| 76 } | 71 } |
| 77 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar
y>& keyframeDictionaryVector, ExceptionState& exceptionState) | 72 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar
y>& keyframeDictionaryVector, ExceptionState& exceptionState) |
| 78 { | 73 { |
| 79 if (element) | |
| 80 UseCounter::count(element->document(), UseCounter::AnimationConstructorK
eyframeListEffectNoTiming); | |
| 81 return create(element, EffectInput::convert(element, keyframeDictionaryVecto
r, exceptionState), Timing()); | 74 return create(element, EffectInput::convert(element, keyframeDictionaryVecto
r, exceptionState), Timing()); |
| 82 } | 75 } |
| 83 | 76 |
| 84 Animation::Animation(Element* target, PassRefPtr<AnimationEffect> effect, const
Timing& timing, Priority priority, PassOwnPtr<EventDelegate> eventDelegate) | 77 Animation::Animation(Element* target, PassRefPtr<AnimationEffect> effect, const
Timing& timing, Priority priority, PassOwnPtr<EventDelegate> eventDelegate) |
| 85 : AnimationNode(timing, eventDelegate) | 78 : AnimationNode(timing, eventDelegate) |
| 86 , m_target(target) | 79 , m_target(target) |
| 87 , m_effect(effect) | 80 , m_effect(effect) |
| 88 , m_sampledEffect(nullptr) | 81 , m_sampledEffect(nullptr) |
| 89 , m_priority(priority) | 82 , m_priority(priority) |
| 90 { | 83 { |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 // clear m_sampledEffect first. | 208 // clear m_sampledEffect first. |
| 216 m_target = nullptr; | 209 m_target = nullptr; |
| 217 clearEventDelegate(); | 210 clearEventDelegate(); |
| 218 SampledEffect* sampledEffect = m_sampledEffect; | 211 SampledEffect* sampledEffect = m_sampledEffect; |
| 219 m_sampledEffect = nullptr; | 212 m_sampledEffect = nullptr; |
| 220 if (sampledEffect) | 213 if (sampledEffect) |
| 221 sampledEffect->clear(); | 214 sampledEffect->clear(); |
| 222 } | 215 } |
| 223 | 216 |
| 224 } // namespace blink | 217 } // namespace blink |
| OLD | NEW |