| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 double getElapsedTime() const; | 164 double getElapsedTime() const; |
| 165 | 165 |
| 166 AnimationBase* next() const { return m_next; } | 166 AnimationBase* next() const { return m_next; } |
| 167 void setNext(AnimationBase* animation) { m_next = animation; } | 167 void setNext(AnimationBase* animation) { m_next = animation; } |
| 168 | 168 |
| 169 void styleAvailable() | 169 void styleAvailable() |
| 170 { | 170 { |
| 171 ASSERT(waitingForStyleAvailable()); | 171 ASSERT(waitingForStyleAvailable()); |
| 172 updateStateMachine(AnimationBase::AnimationStateInputStyleAvailable, -1)
; | 172 updateStateMachine(AnimationBase::AnimationStateInputStyleAvailable, -1)
; |
| 173 } | 173 } |
| 174 | 174 |
| 175 #if USE(ACCELERATED_COMPOSITING) |
| 176 static bool animationOfPropertyIsAccelerated(int prop); |
| 177 #endif |
| 178 |
| 175 protected: | 179 protected: |
| 176 virtual void overrideAnimations() { } | 180 virtual void overrideAnimations() { } |
| 177 virtual void resumeOverriddenAnimations() { } | 181 virtual void resumeOverriddenAnimations() { } |
| 178 | 182 |
| 179 CompositeAnimation* compositeAnimation() { return m_compAnim; } | 183 CompositeAnimation* compositeAnimation() { return m_compAnim; } |
| 180 | 184 |
| 181 // These are called when the corresponding timer fires so subclasses can do
any extra work | 185 // These are called when the corresponding timer fires so subclasses can do
any extra work |
| 182 virtual void onAnimationStart(double /*elapsedTime*/) { } | 186 virtual void onAnimationStart(double /*elapsedTime*/) { } |
| 183 virtual void onAnimationIteration(double /*elapsedTime*/) { } | 187 virtual void onAnimationIteration(double /*elapsedTime*/) { } |
| 184 virtual void onAnimationEnd(double /*elapsedTime*/) { } | 188 virtual void onAnimationEnd(double /*elapsedTime*/) { } |
| 185 virtual bool startAnimation(double /*beginTime*/) { return false; } | 189 virtual bool startAnimation(double /*beginTime*/) { return false; } |
| 186 virtual void endAnimation(bool /*reset*/, double /*forcePauseTime*/ = -1) {
} | 190 virtual void endAnimation(bool /*reset*/, double /*forcePauseTime*/ = -1) {
} |
| 187 | 191 |
| 188 void goIntoEndingOrLoopingState(); | 192 void goIntoEndingOrLoopingState(); |
| 189 | 193 |
| 190 bool isFallbackAnimating() const { return m_fallbackAnimating; } | 194 bool isFallbackAnimating() const { return m_fallbackAnimating; } |
| 191 | 195 |
| 192 static bool propertiesEqual(int prop, const RenderStyle* a, const RenderStyl
e* b); | 196 static bool propertiesEqual(int prop, const RenderStyle* a, const RenderStyl
e* b); |
| 193 static int getPropertyAtIndex(int, bool& isShorthand); | 197 static int getPropertyAtIndex(int, bool& isShorthand); |
| 194 static int getNumProperties(); | 198 static int getNumProperties(); |
| 195 | 199 |
| 196 // Return true if we need to start software animation timers | 200 // Return true if we need to start software animation timers |
| 197 static bool blendProperties(const AnimationBase* anim, int prop, RenderStyle
* dst, const RenderStyle* a, const RenderStyle* b, double progress); | 201 static bool blendProperties(const AnimationBase* anim, int prop, RenderStyle
* dst, const RenderStyle* a, const RenderStyle* b, double progress); |
| 198 | 202 |
| 199 #if USE(ACCELERATED_COMPOSITING) | |
| 200 static bool animationOfPropertyIsAccelerated(int prop); | |
| 201 #endif | |
| 202 | |
| 203 static void setChanged(Node*); | 203 static void setChanged(Node*); |
| 204 | 204 |
| 205 void getTimeToNextEvent(double& time, bool& isLooping) const; | 205 void getTimeToNextEvent(double& time, bool& isLooping) const; |
| 206 | 206 |
| 207 AnimState m_animState; | 207 AnimState m_animState; |
| 208 | 208 |
| 209 bool m_isAnimating; // transition/animation requires continual timer f
iring | 209 bool m_isAnimating; // transition/animation requires continual timer f
iring |
| 210 double m_startTime; | 210 double m_startTime; |
| 211 double m_pauseTime; | 211 double m_pauseTime; |
| 212 double m_requestedStartTime; | 212 double m_requestedStartTime; |
| 213 RenderObject* m_object; | 213 RenderObject* m_object; |
| 214 | 214 |
| 215 RefPtr<Animation> m_animation; | 215 RefPtr<Animation> m_animation; |
| 216 CompositeAnimation* m_compAnim; | 216 CompositeAnimation* m_compAnim; |
| 217 bool m_fallbackAnimating; // true if any animation returned false from
startAnimation() | 217 bool m_fallbackAnimating; // true if any animation returned false from
startAnimation() |
| 218 bool m_transformFunctionListValid; | 218 bool m_transformFunctionListValid; |
| 219 double m_totalDuration, m_nextIterationDuration; | 219 double m_totalDuration, m_nextIterationDuration; |
| 220 | 220 |
| 221 AnimationBase* m_next; | 221 AnimationBase* m_next; |
| 222 }; | 222 }; |
| 223 | 223 |
| 224 } // namespace WebCore | 224 } // namespace WebCore |
| 225 | 225 |
| 226 #endif // AnimationBase_h | 226 #endif // AnimationBase_h |
| 227 | 227 |
| OLD | NEW |