| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 class EventDelegate { | 65 class EventDelegate { |
| 66 public: | 66 public: |
| 67 virtual ~EventDelegate() { }; | 67 virtual ~EventDelegate() { }; |
| 68 virtual void onEventCondition(const TimedItem*, bool isFirstSample, Phas
e previousPhase, double previousIteration) = 0; | 68 virtual void onEventCondition(const TimedItem*, bool isFirstSample, Phas
e previousPhase, double previousIteration) = 0; |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 virtual ~TimedItem() { } | 71 virtual ~TimedItem() { } |
| 72 | 72 |
| 73 virtual bool isAnimation() { return false; } |
| 74 |
| 73 Phase phase() const { return ensureCalculated().phase; } | 75 Phase phase() const { return ensureCalculated().phase; } |
| 74 bool isCurrent() const { return ensureCalculated().isCurrent; } | 76 bool isCurrent() const { return ensureCalculated().isCurrent; } |
| 75 bool isInEffect() const { return ensureCalculated().isInEffect; } | 77 bool isInEffect() const { return ensureCalculated().isInEffect; } |
| 76 bool isInPlay() const { return ensureCalculated().isInPlay; } | 78 bool isInPlay() const { return ensureCalculated().isInPlay; } |
| 77 double timeToEffectChange() const { return ensureCalculated().timeToEffectCh
ange; } | 79 double timeToEffectChange() const { return ensureCalculated().timeToEffectCh
ange; } |
| 78 | 80 |
| 79 double startTime() const { return m_startTime; } | |
| 80 | |
| 81 double currentIteration() const { return ensureCalculated().currentIteration
; } | 81 double currentIteration() const { return ensureCalculated().currentIteration
; } |
| 82 double activeDuration() const { return ensureCalculated().activeDuration; } | 82 double activeDuration() const { return ensureCalculated().activeDuration; } |
| 83 double timeFraction() const { return ensureCalculated().timeFraction; } | 83 double timeFraction() const { return ensureCalculated().timeFraction; } |
| 84 double startTime() const { return m_startTime; } |
| 84 const Player* player() const { return m_player; } | 85 const Player* player() const { return m_player; } |
| 85 Player* player() { return m_player; } | 86 Player* player() { return m_player; } |
| 86 | |
| 87 const Timing& specified() const { return m_specified; } | 87 const Timing& specified() const { return m_specified; } |
| 88 | 88 |
| 89 protected: | 89 protected: |
| 90 TimedItem(const Timing&, PassOwnPtr<EventDelegate> = nullptr); | 90 TimedItem(const Timing&, PassOwnPtr<EventDelegate> = nullptr); |
| 91 | 91 |
| 92 // When TimedItem receives a new inherited time via updateInheritedTime | 92 // When TimedItem receives a new inherited time via updateInheritedTime |
| 93 // it will (if necessary) recalculate timings and (if necessary) call | 93 // it will (if necessary) recalculate timings and (if necessary) call |
| 94 // updateChildrenAndEffects. | 94 // updateChildrenAndEffects. |
| 95 // Returns whether style recalc was triggered. | 95 // Returns whether style recalc was triggered. |
| 96 bool updateInheritedTime(double inheritedTime) const; | 96 bool updateInheritedTime(double inheritedTime) const; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 } m_calculated; | 136 } m_calculated; |
| 137 mutable bool m_isFirstSample; | 137 mutable bool m_isFirstSample; |
| 138 | 138 |
| 139 // FIXME: Should check the version and reinherit time if inconsistent. | 139 // FIXME: Should check the version and reinherit time if inconsistent. |
| 140 const CalculatedTiming& ensureCalculated() const { return m_calculated; } | 140 const CalculatedTiming& ensureCalculated() const { return m_calculated; } |
| 141 }; | 141 }; |
| 142 | 142 |
| 143 } // namespace WebCore | 143 } // namespace WebCore |
| 144 | 144 |
| 145 #endif | 145 #endif |
| OLD | NEW |