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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 PhaseActive, | 70 PhaseActive, |
71 PhaseAfter, | 71 PhaseAfter, |
72 PhaseNone, | 72 PhaseNone, |
73 }; | 73 }; |
74 | 74 |
75 class EventDelegate : public NoBaseWillBeGarbageCollectedFinalized<EventDele
gate> { | 75 class EventDelegate : public NoBaseWillBeGarbageCollectedFinalized<EventDele
gate> { |
76 public: | 76 public: |
77 virtual ~EventDelegate() { } | 77 virtual ~EventDelegate() { } |
78 virtual bool requiresIterationEvents(const AnimationNode&) = 0; | 78 virtual bool requiresIterationEvents(const AnimationNode&) = 0; |
79 virtual void onEventCondition(const AnimationNode&) = 0; | 79 virtual void onEventCondition(const AnimationNode&) = 0; |
80 virtual void trace(Visitor*) { } | 80 DEFINE_INLINE_VIRTUAL_TRACE() { } |
81 }; | 81 }; |
82 | 82 |
83 virtual ~AnimationNode() { } | 83 virtual ~AnimationNode() { } |
84 | 84 |
85 virtual bool isAnimation() const { return false; } | 85 virtual bool isAnimation() const { return false; } |
86 | 86 |
87 Phase phase() const { return ensureCalculated().phase; } | 87 Phase phase() const { return ensureCalculated().phase; } |
88 bool isCurrent() const { return ensureCalculated().isCurrent; } | 88 bool isCurrent() const { return ensureCalculated().isCurrent; } |
89 bool isInEffect() const { return ensureCalculated().isInEffect; } | 89 bool isInEffect() const { return ensureCalculated().isInEffect; } |
90 bool isInPlay() const { return ensureCalculated().isInPlay; } | 90 bool isInPlay() const { return ensureCalculated().isInPlay; } |
(...skipping 12 matching lines...) Expand all Loading... |
103 const Timing& specifiedTiming() const { return m_timing; } | 103 const Timing& specifiedTiming() const { return m_timing; } |
104 PassRefPtrWillBeRawPtr<AnimationNodeTiming> timing(); | 104 PassRefPtrWillBeRawPtr<AnimationNodeTiming> timing(); |
105 void updateSpecifiedTiming(const Timing&); | 105 void updateSpecifiedTiming(const Timing&); |
106 | 106 |
107 void computedTiming(ComputedTimingProperties&); | 107 void computedTiming(ComputedTimingProperties&); |
108 ComputedTimingProperties computedTiming(); | 108 ComputedTimingProperties computedTiming(); |
109 | 109 |
110 void setName(const String& name) { m_name = name; } | 110 void setName(const String& name) { m_name = name; } |
111 const String& name() const { return m_name; } | 111 const String& name() const { return m_name; } |
112 | 112 |
113 virtual void trace(Visitor*); | 113 DECLARE_VIRTUAL_TRACE(); |
114 | 114 |
115 protected: | 115 protected: |
116 explicit AnimationNode(const Timing&, PassOwnPtrWillBeRawPtr<EventDelegate>
= nullptr); | 116 explicit AnimationNode(const Timing&, PassOwnPtrWillBeRawPtr<EventDelegate>
= nullptr); |
117 | 117 |
118 // When AnimationNode receives a new inherited time via updateInheritedTime | 118 // When AnimationNode receives a new inherited time via updateInheritedTime |
119 // it will (if necessary) recalculate timings and (if necessary) call | 119 // it will (if necessary) recalculate timings and (if necessary) call |
120 // updateChildrenAndEffects. | 120 // updateChildrenAndEffects. |
121 void updateInheritedTime(double inheritedTime, TimingUpdateReason) const; | 121 void updateInheritedTime(double inheritedTime, TimingUpdateReason) const; |
122 void invalidate() const { m_needsUpdate = true; }; | 122 void invalidate() const { m_needsUpdate = true; }; |
123 bool requiresIterationEvents() const { return m_eventDelegate && m_eventDele
gate->requiresIterationEvents(*this); } | 123 bool requiresIterationEvents() const { return m_eventDelegate && m_eventDele
gate->requiresIterationEvents(*this); } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 mutable bool m_needsUpdate; | 162 mutable bool m_needsUpdate; |
163 mutable double m_lastUpdateTime; | 163 mutable double m_lastUpdateTime; |
164 String m_name; | 164 String m_name; |
165 | 165 |
166 const CalculatedTiming& ensureCalculated() const; | 166 const CalculatedTiming& ensureCalculated() const; |
167 }; | 167 }; |
168 | 168 |
169 } // namespace blink | 169 } // namespace blink |
170 | 170 |
171 #endif // AnimationNode_h | 171 #endif // AnimationNode_h |
OLD | NEW |