| 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 TimedItem_h | 31 #ifndef TimedItem_h |
| 32 #define TimedItem_h | 32 #define TimedItem_h |
| 33 | 33 |
| 34 #include "core/animation/TimedItemTiming.h" |
| 34 #include "core/animation/Timing.h" | 35 #include "core/animation/Timing.h" |
| 35 #include "wtf/OwnPtr.h" | 36 #include "wtf/OwnPtr.h" |
| 36 #include "wtf/PassOwnPtr.h" | 37 #include "wtf/PassOwnPtr.h" |
| 37 #include "wtf/RefCounted.h" | 38 #include "wtf/RefCounted.h" |
| 38 | 39 |
| 39 namespace WebCore { | 40 namespace WebCore { |
| 40 | 41 |
| 41 class Player; | 42 class Player; |
| 42 class TimedItem; | 43 class TimedItem; |
| 43 | 44 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 Phase phase() const { return ensureCalculated().phase; } | 76 Phase phase() const { return ensureCalculated().phase; } |
| 76 bool isCurrent() const { return ensureCalculated().isCurrent; } | 77 bool isCurrent() const { return ensureCalculated().isCurrent; } |
| 77 bool isInEffect() const { return ensureCalculated().isInEffect; } | 78 bool isInEffect() const { return ensureCalculated().isInEffect; } |
| 78 bool isInPlay() const { return ensureCalculated().isInPlay; } | 79 bool isInPlay() const { return ensureCalculated().isInPlay; } |
| 79 double timeToEffectChange() const { return ensureCalculated().timeToEffectCh
ange; } | 80 double timeToEffectChange() const { return ensureCalculated().timeToEffectCh
ange; } |
| 80 | 81 |
| 81 double currentIteration() const { return ensureCalculated().currentIteration
; } | 82 double currentIteration() const { return ensureCalculated().currentIteration
; } |
| 82 double activeDuration() const; | 83 double activeDuration() const; |
| 83 double timeFraction() const { return ensureCalculated().timeFraction; } | 84 double timeFraction() const { return ensureCalculated().timeFraction; } |
| 84 double startTime() const { return m_startTime; } | 85 double startTime() const { return m_startTime; } |
| 85 double endTime() const { return startTime() + specified().startDelay + activ
eDuration() + specified().endDelay; } | 86 double endTime() const { return startTime() + specifiedTiming().startDelay +
activeDuration() + specifiedTiming().endDelay; } |
| 86 | 87 |
| 87 const Player* player() const { return m_player; } | 88 const Player* player() const { return m_player; } |
| 88 Player* player() { return m_player; } | 89 Player* player() { return m_player; } |
| 89 Player* player(bool& isNull) { isNull = !m_player; return m_player; } | 90 Player* player(bool& isNull) { isNull = !m_player; return m_player; } |
| 90 const Timing& specified() const { return m_specified; } | 91 const Timing& specifiedTiming() const { return m_specified; } |
| 92 PassRefPtr<TimedItemTiming> specified() { return TimedItemTiming::create(thi
s); } |
| 91 | 93 |
| 92 protected: | 94 protected: |
| 93 TimedItem(const Timing&, PassOwnPtr<EventDelegate> = nullptr); | 95 TimedItem(const Timing&, PassOwnPtr<EventDelegate> = nullptr); |
| 94 | 96 |
| 95 // When TimedItem receives a new inherited time via updateInheritedTime | 97 // When TimedItem receives a new inherited time via updateInheritedTime |
| 96 // it will (if necessary) recalculate timings and (if necessary) call | 98 // it will (if necessary) recalculate timings and (if necessary) call |
| 97 // updateChildrenAndEffects. | 99 // updateChildrenAndEffects. |
| 98 // Returns whether style recalc was triggered. | 100 // Returns whether style recalc was triggered. |
| 99 bool updateInheritedTime(double inheritedTime) const; | 101 bool updateInheritedTime(double inheritedTime) const; |
| 100 void invalidate() const { m_needsUpdate = true; }; | 102 void invalidate() const { m_needsUpdate = true; }; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 mutable bool m_needsUpdate; | 146 mutable bool m_needsUpdate; |
| 145 mutable double m_lastUpdateTime; | 147 mutable double m_lastUpdateTime; |
| 146 | 148 |
| 147 // FIXME: Should check the version and reinherit time if inconsistent. | 149 // FIXME: Should check the version and reinherit time if inconsistent. |
| 148 const CalculatedTiming& ensureCalculated() const { return m_calculated; } | 150 const CalculatedTiming& ensureCalculated() const { return m_calculated; } |
| 149 }; | 151 }; |
| 150 | 152 |
| 151 } // namespace WebCore | 153 } // namespace WebCore |
| 152 | 154 |
| 153 #endif | 155 #endif |
| OLD | NEW |