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 28 matching lines...) Expand all Loading... |
39 #include "core/animation/AnimationTimeline.h" | 39 #include "core/animation/AnimationTimeline.h" |
40 #include "core/animation/CompositorAnimations.h" | 40 #include "core/animation/CompositorAnimations.h" |
41 #include "core/animation/Interpolation.h" | 41 #include "core/animation/Interpolation.h" |
42 #include "core/animation/KeyframeEffectModel.h" | 42 #include "core/animation/KeyframeEffectModel.h" |
43 #include "core/dom/Element.h" | 43 #include "core/dom/Element.h" |
44 #include "core/frame/UseCounter.h" | 44 #include "core/frame/UseCounter.h" |
45 #include "core/rendering/RenderLayer.h" | 45 #include "core/rendering/RenderLayer.h" |
46 | 46 |
47 namespace blink { | 47 namespace blink { |
48 | 48 |
49 PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* target, PassRefPtrW
illBeRawPtr<AnimationEffect> effect, const Timing& timing, Priority priority, Pa
ssOwnPtr<EventDelegate> eventDelegate) | 49 PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* target, PassRefPtrW
illBeRawPtr<AnimationEffect> effect, const Timing& timing, Priority priority, Pa
ssOwnPtrWillBeRawPtr<EventDelegate> eventDelegate) |
50 { | 50 { |
51 return adoptRefWillBeNoop(new Animation(target, effect, timing, priority, ev
entDelegate)); | 51 return adoptRefWillBeNoop(new Animation(target, effect, timing, priority, ev
entDelegate)); |
52 } | 52 } |
53 | 53 |
54 PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, PassRefPtr
WillBeRawPtr<AnimationEffect> effect, const Dictionary& timingInputDictionary) | 54 PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, PassRefPtr
WillBeRawPtr<AnimationEffect> effect, const Dictionary& timingInputDictionary) |
55 { | 55 { |
56 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | 56 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
57 return create(element, effect, TimingInput::convert(timingInputDictionary)); | 57 return create(element, effect, TimingInput::convert(timingInputDictionary)); |
58 } | 58 } |
59 PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, PassRefPtr
WillBeRawPtr<AnimationEffect> effect, double duration) | 59 PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, PassRefPtr
WillBeRawPtr<AnimationEffect> effect, double duration) |
(...skipping 21 matching lines...) Expand all Loading... |
81 return create(element, EffectInput::convert(element, keyframeDictionaryVecto
r, exceptionState), TimingInput::convert(duration)); | 81 return create(element, EffectInput::convert(element, keyframeDictionaryVecto
r, exceptionState), TimingInput::convert(duration)); |
82 } | 82 } |
83 PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, const Vect
or<Dictionary>& keyframeDictionaryVector, ExceptionState& exceptionState) | 83 PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, const Vect
or<Dictionary>& keyframeDictionaryVector, ExceptionState& exceptionState) |
84 { | 84 { |
85 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | 85 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
86 if (element) | 86 if (element) |
87 UseCounter::count(element->document(), UseCounter::AnimationConstructorK
eyframeListEffectNoTiming); | 87 UseCounter::count(element->document(), UseCounter::AnimationConstructorK
eyframeListEffectNoTiming); |
88 return create(element, EffectInput::convert(element, keyframeDictionaryVecto
r, exceptionState), Timing()); | 88 return create(element, EffectInput::convert(element, keyframeDictionaryVecto
r, exceptionState), Timing()); |
89 } | 89 } |
90 | 90 |
91 Animation::Animation(Element* target, PassRefPtrWillBeRawPtr<AnimationEffect> ef
fect, const Timing& timing, Priority priority, PassOwnPtr<EventDelegate> eventDe
legate) | 91 Animation::Animation(Element* target, PassRefPtrWillBeRawPtr<AnimationEffect> ef
fect, const Timing& timing, Priority priority, PassOwnPtrWillBeRawPtr<EventDeleg
ate> eventDelegate) |
92 : AnimationNode(timing, eventDelegate) | 92 : AnimationNode(timing, eventDelegate) |
93 , m_target(target) | 93 , m_target(target) |
94 , m_effect(effect) | 94 , m_effect(effect) |
95 , m_sampledEffect(nullptr) | 95 , m_sampledEffect(nullptr) |
96 , m_priority(priority) | 96 , m_priority(priority) |
97 { | 97 { |
98 #if !ENABLE(OILPAN) | 98 #if !ENABLE(OILPAN) |
99 if (m_target) | 99 if (m_target) |
100 m_target->ensureActiveAnimations().addAnimation(this); | 100 m_target->ensureActiveAnimations().addAnimation(this); |
101 #endif | 101 #endif |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 | 307 |
308 void Animation::trace(Visitor* visitor) | 308 void Animation::trace(Visitor* visitor) |
309 { | 309 { |
310 visitor->trace(m_target); | 310 visitor->trace(m_target); |
311 visitor->trace(m_effect); | 311 visitor->trace(m_effect); |
312 visitor->trace(m_sampledEffect); | 312 visitor->trace(m_sampledEffect); |
313 AnimationNode::trace(visitor); | 313 AnimationNode::trace(visitor); |
314 } | 314 } |
315 | 315 |
316 } // namespace blink | 316 } // namespace blink |
OLD | NEW |