| 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 #ifndef Animation_h | 31 #ifndef Animation_h |
| 32 #define Animation_h | 32 #define Animation_h |
| 33 | 33 |
| 34 #include "bindings/core/v8/ActiveScriptWrappable.h" |
| 34 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 35 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
| 35 #include "bindings/core/v8/ScriptPromise.h" | 36 #include "bindings/core/v8/ScriptPromise.h" |
| 36 #include "bindings/core/v8/ScriptPromiseProperty.h" | 37 #include "bindings/core/v8/ScriptPromiseProperty.h" |
| 37 #include "core/CSSPropertyNames.h" | 38 #include "core/CSSPropertyNames.h" |
| 38 #include "core/CoreExport.h" | 39 #include "core/CoreExport.h" |
| 39 #include "core/animation/AnimationEffect.h" | 40 #include "core/animation/AnimationEffect.h" |
| 40 #include "core/dom/ActiveDOMObject.h" | 41 #include "core/dom/ActiveDOMObject.h" |
| 41 #include "core/dom/DOMException.h" | 42 #include "core/dom/DOMException.h" |
| 42 #include "core/events/EventTarget.h" | 43 #include "core/events/EventTarget.h" |
| 43 #include "platform/animation/CompositorAnimationDelegate.h" | 44 #include "platform/animation/CompositorAnimationDelegate.h" |
| 44 #include "platform/animation/CompositorAnimationPlayerClient.h" | 45 #include "platform/animation/CompositorAnimationPlayerClient.h" |
| 45 #include "platform/heap/Handle.h" | 46 #include "platform/heap/Handle.h" |
| 46 #include "wtf/RefPtr.h" | 47 #include "wtf/RefPtr.h" |
| 47 | 48 |
| 48 namespace blink { | 49 namespace blink { |
| 49 | 50 |
| 50 class AnimationTimeline; | 51 class AnimationTimeline; |
| 51 class CompositorAnimationPlayer; | 52 class CompositorAnimationPlayer; |
| 52 class Element; | 53 class Element; |
| 53 class ExceptionState; | 54 class ExceptionState; |
| 54 | 55 |
| 55 class CORE_EXPORT Animation final | 56 class CORE_EXPORT Animation final |
| 56 : public RefCountedGarbageCollectedEventTargetWithInlineData<Animation> | 57 : public RefCountedGarbageCollectedEventTargetWithInlineData<Animation> |
| 58 , public ActiveScriptWrappable |
| 57 , public ActiveDOMObject | 59 , public ActiveDOMObject |
| 58 , public CompositorAnimationDelegate | 60 , public CompositorAnimationDelegate |
| 59 , public CompositorAnimationPlayerClient { | 61 , public CompositorAnimationPlayerClient { |
| 60 DEFINE_WRAPPERTYPEINFO(); | 62 DEFINE_WRAPPERTYPEINFO(); |
| 61 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(Animation); | 63 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(Animation); |
| 62 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Animation); | 64 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Animation); |
| 63 public: | 65 public: |
| 64 enum AnimationPlayState { | 66 enum AnimationPlayState { |
| 65 Unset, | 67 Unset, |
| 66 Idle, | 68 Idle, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 110 |
| 109 bool playing() const { return !(playStateInternal() == Idle || limited() ||
m_paused || m_isPausedForTesting); } | 111 bool playing() const { return !(playStateInternal() == Idle || limited() ||
m_paused || m_isPausedForTesting); } |
| 110 bool limited() const { return limited(currentTimeInternal()); } | 112 bool limited() const { return limited(currentTimeInternal()); } |
| 111 bool finishedInternal() const { return m_finished; } | 113 bool finishedInternal() const { return m_finished; } |
| 112 | 114 |
| 113 DEFINE_ATTRIBUTE_EVENT_LISTENER(finish); | 115 DEFINE_ATTRIBUTE_EVENT_LISTENER(finish); |
| 114 DEFINE_ATTRIBUTE_EVENT_LISTENER(cancel); | 116 DEFINE_ATTRIBUTE_EVENT_LISTENER(cancel); |
| 115 | 117 |
| 116 const AtomicString& interfaceName() const override; | 118 const AtomicString& interfaceName() const override; |
| 117 ExecutionContext* getExecutionContext() const override; | 119 ExecutionContext* getExecutionContext() const override; |
| 118 bool hasPendingActivity() const override; | 120 bool hasPendingActivity() const final; |
| 119 void stop() override; | 121 void stop() override; |
| 120 | 122 |
| 121 double playbackRate() const; | 123 double playbackRate() const; |
| 122 void setPlaybackRate(double); | 124 void setPlaybackRate(double); |
| 123 const AnimationTimeline* timeline() const { return m_timeline; } | 125 const AnimationTimeline* timeline() const { return m_timeline; } |
| 124 AnimationTimeline* timeline() { return m_timeline; } | 126 AnimationTimeline* timeline() { return m_timeline; } |
| 125 | 127 |
| 126 double calculateStartTime(double currentTime) const; | 128 double calculateStartTime(double currentTime) const; |
| 127 bool hasStartTime() const { return !isNull(m_startTime); } | 129 bool hasStartTime() const { return !isNull(m_startTime); } |
| 128 double startTime(bool& isNull) const; | 130 double startTime(bool& isNull) const; |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 | 298 |
| 297 OwnPtr<CompositorAnimationPlayer> m_compositorPlayer; | 299 OwnPtr<CompositorAnimationPlayer> m_compositorPlayer; |
| 298 | 300 |
| 299 bool m_currentTimePending; | 301 bool m_currentTimePending; |
| 300 bool m_stateIsBeingUpdated; | 302 bool m_stateIsBeingUpdated; |
| 301 }; | 303 }; |
| 302 | 304 |
| 303 } // namespace blink | 305 } // namespace blink |
| 304 | 306 |
| 305 #endif // Animation_h | 307 #endif // Animation_h |
| OLD | NEW |