| 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 23 matching lines...) Expand all Loading... |
| 34 #include "core/animation/AnimationNode.h" | 34 #include "core/animation/AnimationNode.h" |
| 35 #include "core/dom/ActiveDOMObject.h" | 35 #include "core/dom/ActiveDOMObject.h" |
| 36 #include "core/events/EventTarget.h" | 36 #include "core/events/EventTarget.h" |
| 37 #include "wtf/RefPtr.h" | 37 #include "wtf/RefPtr.h" |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 class AnimationTimeline; | 41 class AnimationTimeline; |
| 42 class ExceptionState; | 42 class ExceptionState; |
| 43 | 43 |
| 44 class AnimationPlayer FINAL : public RefCountedWillBeGarbageCollectedFinalized<A
nimationPlayer> | 44 class AnimationPlayer final : public RefCountedWillBeGarbageCollectedFinalized<A
nimationPlayer> |
| 45 , public ActiveDOMObject | 45 , public ActiveDOMObject |
| 46 , public EventTargetWithInlineData { | 46 , public EventTargetWithInlineData { |
| 47 DEFINE_WRAPPERTYPEINFO(); | 47 DEFINE_WRAPPERTYPEINFO(); |
| 48 REFCOUNTED_EVENT_TARGET(AnimationPlayer); | 48 REFCOUNTED_EVENT_TARGET(AnimationPlayer); |
| 49 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(AnimationPlayer); | 49 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(AnimationPlayer); |
| 50 public: | 50 public: |
| 51 enum AnimationPlayState { | 51 enum AnimationPlayState { |
| 52 Idle, | 52 Idle, |
| 53 Pending, | 53 Pending, |
| 54 Running, | 54 Running, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 void reverse(); | 87 void reverse(); |
| 88 void finish(ExceptionState&); | 88 void finish(ExceptionState&); |
| 89 bool finished() { return !m_idle && limited(currentTimeInternal()); } | 89 bool finished() { return !m_idle && limited(currentTimeInternal()); } |
| 90 bool playing() { return !(finished() || m_paused || m_isPausedForTesting ||
m_idle); } | 90 bool playing() { return !(finished() || m_paused || m_isPausedForTesting ||
m_idle); } |
| 91 // FIXME: Resolve whether finished() should just return the flag, and | 91 // FIXME: Resolve whether finished() should just return the flag, and |
| 92 // remove this method. | 92 // remove this method. |
| 93 bool finishedInternal() const { return m_finished; } | 93 bool finishedInternal() const { return m_finished; } |
| 94 | 94 |
| 95 DEFINE_ATTRIBUTE_EVENT_LISTENER(finish); | 95 DEFINE_ATTRIBUTE_EVENT_LISTENER(finish); |
| 96 | 96 |
| 97 virtual const AtomicString& interfaceName() const OVERRIDE; | 97 virtual const AtomicString& interfaceName() const override; |
| 98 virtual ExecutionContext* executionContext() const OVERRIDE; | 98 virtual ExecutionContext* executionContext() const override; |
| 99 virtual bool hasPendingActivity() const OVERRIDE; | 99 virtual bool hasPendingActivity() const override; |
| 100 virtual void stop() OVERRIDE; | 100 virtual void stop() override; |
| 101 virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) OVERRIDE; | 101 virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) override; |
| 102 | 102 |
| 103 double playbackRate() const; | 103 double playbackRate() const; |
| 104 void setPlaybackRate(double); | 104 void setPlaybackRate(double); |
| 105 const AnimationTimeline* timeline() const { return m_timeline; } | 105 const AnimationTimeline* timeline() const { return m_timeline; } |
| 106 AnimationTimeline* timeline() { return m_timeline; } | 106 AnimationTimeline* timeline() { return m_timeline; } |
| 107 | 107 |
| 108 #if !ENABLE(OILPAN) | 108 #if !ENABLE(OILPAN) |
| 109 void timelineDestroyed() { m_timeline = nullptr; } | 109 void timelineDestroyed() { m_timeline = nullptr; } |
| 110 #endif | 110 #endif |
| 111 | 111 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 { | 147 { |
| 148 return player1->sequenceNumber() < player2->sequenceNumber(); | 148 return player1->sequenceNumber() < player2->sequenceNumber(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 #if !ENABLE(OILPAN) | 151 #if !ENABLE(OILPAN) |
| 152 // Checks if the AnimationStack is the last reference holder to the Player. | 152 // Checks if the AnimationStack is the last reference holder to the Player. |
| 153 // This won't be needed when AnimationPlayer is moved to Oilpan. | 153 // This won't be needed when AnimationPlayer is moved to Oilpan. |
| 154 bool canFree() const; | 154 bool canFree() const; |
| 155 #endif | 155 #endif |
| 156 | 156 |
| 157 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even
tListener>, bool useCapture = false) OVERRIDE; | 157 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even
tListener>, bool useCapture = false) override; |
| 158 | 158 |
| 159 virtual void trace(Visitor*) OVERRIDE; | 159 virtual void trace(Visitor*) override; |
| 160 | 160 |
| 161 private: | 161 private: |
| 162 AnimationPlayer(ExecutionContext*, AnimationTimeline&, AnimationNode*); | 162 AnimationPlayer(ExecutionContext*, AnimationTimeline&, AnimationNode*); |
| 163 double sourceEnd() const; | 163 double sourceEnd() const; |
| 164 bool limited(double currentTime) const; | 164 bool limited(double currentTime) const; |
| 165 void setPlaybackRateInternal(double); | 165 void setPlaybackRateInternal(double); |
| 166 void updateCurrentTimingState(TimingUpdateReason); | 166 void updateCurrentTimingState(TimingUpdateReason); |
| 167 void unpauseInternal(); | 167 void unpauseInternal(); |
| 168 void uncancel(); | 168 void uncancel(); |
| 169 void setFinished(bool); | 169 void setFinished(bool); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 // modifications are pushed to the compositor. | 220 // modifications are pushed to the compositor. |
| 221 OwnPtr<CompositorState> m_compositorState; | 221 OwnPtr<CompositorState> m_compositorState; |
| 222 bool m_compositorPending; | 222 bool m_compositorPending; |
| 223 bool m_currentTimePending; | 223 bool m_currentTimePending; |
| 224 bool m_idle; | 224 bool m_idle; |
| 225 }; | 225 }; |
| 226 | 226 |
| 227 } // namespace blink | 227 } // namespace blink |
| 228 | 228 |
| 229 #endif | 229 #endif |
| OLD | NEW |