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 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "sky/engine/config.h" | 31 #include "sky/engine/config.h" |
32 #include "sky/engine/core/animation/Animation.h" | 32 #include "sky/engine/core/animation/Animation.h" |
33 | 33 |
34 #include "sky/engine/bindings/core/v8/Dictionary.h" | 34 #include "sky/engine/bindings2/exception_state.h" |
35 #include "sky/engine/bindings/core/v8/ExceptionState.h" | |
36 #include "sky/engine/core/animation/ActiveAnimations.h" | 35 #include "sky/engine/core/animation/ActiveAnimations.h" |
37 #include "sky/engine/core/animation/AnimationHelpers.h" | 36 #include "sky/engine/core/animation/AnimationHelpers.h" |
38 #include "sky/engine/core/animation/AnimationPlayer.h" | 37 #include "sky/engine/core/animation/AnimationPlayer.h" |
39 #include "sky/engine/core/animation/AnimationTimeline.h" | 38 #include "sky/engine/core/animation/AnimationTimeline.h" |
40 #include "sky/engine/core/animation/Interpolation.h" | 39 #include "sky/engine/core/animation/Interpolation.h" |
41 #include "sky/engine/core/animation/KeyframeEffectModel.h" | 40 #include "sky/engine/core/animation/KeyframeEffectModel.h" |
42 #include "sky/engine/core/dom/Element.h" | 41 #include "sky/engine/core/dom/Element.h" |
43 #include "sky/engine/core/rendering/RenderLayer.h" | 42 #include "sky/engine/core/rendering/RenderLayer.h" |
44 | 43 |
45 namespace blink { | 44 namespace blink { |
46 | 45 |
47 PassRefPtr<Animation> Animation::create(Element* target, PassRefPtr<AnimationEff
ect> effect, const Timing& timing, Priority priority, PassOwnPtr<EventDelegate>
eventDelegate) | 46 PassRefPtr<Animation> Animation::create(Element* target, PassRefPtr<AnimationEff
ect> effect, const Timing& timing, Priority priority, PassOwnPtr<EventDelegate>
eventDelegate) |
48 { | 47 { |
49 return adoptRef(new Animation(target, effect, timing, priority, eventDelegat
e)); | 48 return adoptRef(new Animation(target, effect, timing, priority, eventDelegat
e)); |
50 } | 49 } |
51 | 50 |
52 PassRefPtr<Animation> Animation::create(Element* element, PassRefPtr<AnimationEf
fect> effect, const Dictionary& timingInputDictionary) | 51 PassRefPtr<Animation> Animation::create(Element* element, double duration, Excep
tionState&) |
53 { | 52 { |
54 return create(element, effect, TimingInput::convert(timingInputDictionary)); | 53 return create(element, PassRefPtr<AnimationEffect>(), TimingInput::convert(d
uration)); |
55 } | 54 } |
56 PassRefPtr<Animation> Animation::create(Element* element, PassRefPtr<AnimationEf
fect> effect, double duration) | 55 PassRefPtr<Animation> Animation::create(Element* element, ExceptionState& es) |
57 { | 56 { |
58 return create(element, effect, TimingInput::convert(duration)); | 57 return create(element, 0.0, es); |
59 } | |
60 PassRefPtr<Animation> Animation::create(Element* element, PassRefPtr<AnimationEf
fect> effect) | |
61 { | |
62 return create(element, effect, Timing()); | |
63 } | |
64 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar
y>& keyframeDictionaryVector, const Dictionary& timingInputDictionary, Exception
State& exceptionState) | |
65 { | |
66 return create(element, EffectInput::convert(element, keyframeDictionaryVecto
r, exceptionState), TimingInput::convert(timingInputDictionary)); | |
67 } | |
68 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar
y>& keyframeDictionaryVector, double duration, ExceptionState& exceptionState) | |
69 { | |
70 return create(element, EffectInput::convert(element, keyframeDictionaryVecto
r, exceptionState), TimingInput::convert(duration)); | |
71 } | |
72 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar
y>& keyframeDictionaryVector, ExceptionState& exceptionState) | |
73 { | |
74 return create(element, EffectInput::convert(element, keyframeDictionaryVecto
r, exceptionState), Timing()); | |
75 } | 58 } |
76 | 59 |
77 Animation::Animation(Element* target, PassRefPtr<AnimationEffect> effect, const
Timing& timing, Priority priority, PassOwnPtr<EventDelegate> eventDelegate) | 60 Animation::Animation(Element* target, PassRefPtr<AnimationEffect> effect, const
Timing& timing, Priority priority, PassOwnPtr<EventDelegate> eventDelegate) |
78 : AnimationNode(timing, eventDelegate) | 61 : AnimationNode(timing, eventDelegate) |
79 , m_target(target) | 62 , m_target(target) |
80 , m_effect(effect) | 63 , m_effect(effect) |
81 , m_sampledEffect(nullptr) | 64 , m_sampledEffect(nullptr) |
82 , m_priority(priority) | 65 , m_priority(priority) |
83 { | 66 { |
84 if (m_target) | 67 if (m_target) |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 // clear m_sampledEffect first. | 191 // clear m_sampledEffect first. |
209 m_target = nullptr; | 192 m_target = nullptr; |
210 clearEventDelegate(); | 193 clearEventDelegate(); |
211 SampledEffect* sampledEffect = m_sampledEffect; | 194 SampledEffect* sampledEffect = m_sampledEffect; |
212 m_sampledEffect = nullptr; | 195 m_sampledEffect = nullptr; |
213 if (sampledEffect) | 196 if (sampledEffect) |
214 sampledEffect->clear(); | 197 sampledEffect->clear(); |
215 } | 198 } |
216 | 199 |
217 } // namespace blink | 200 } // namespace blink |
OLD | NEW |