summaryrefslogtreecommitdiffstats
path: root/WebCore/page/animation/AnimationBase.h
diff options
context:
space:
mode:
authorFeng Qian <>2009-04-10 18:11:29 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-10 18:11:29 -0700
commit8f72e70a9fd78eec56623b3a62e68f16b7b27e28 (patch)
tree181bf9a400c30a1bf34ea6d72560e8d00111d549 /WebCore/page/animation/AnimationBase.h
parent7ed56f225e0ade046e1c2178977f72b2d896f196 (diff)
downloadexternal_webkit-8f72e70a9fd78eec56623b3a62e68f16b7b27e28.zip
external_webkit-8f72e70a9fd78eec56623b3a62e68f16b7b27e28.tar.gz
external_webkit-8f72e70a9fd78eec56623b3a62e68f16b7b27e28.tar.bz2
AI 145796: Land the WebKit merge @r42026.
Automated import of CL 145796
Diffstat (limited to 'WebCore/page/animation/AnimationBase.h')
-rw-r--r--WebCore/page/animation/AnimationBase.h30
1 files changed, 22 insertions, 8 deletions
diff --git a/WebCore/page/animation/AnimationBase.h b/WebCore/page/animation/AnimationBase.h
index ce16f93..da4341b 100644
--- a/WebCore/page/animation/AnimationBase.h
+++ b/WebCore/page/animation/AnimationBase.h
@@ -94,7 +94,10 @@ public:
void updateStateMachine(AnimStateInput, double param);
// Animation has actually started, at passed time
- void onAnimationStartResponse(double startTime);
+ void onAnimationStartResponse(double startTime)
+ {
+ updateStateMachine(AnimationBase::AnimationStateInputStartTimeSet, startTime);
+ }
// Called to change to or from paused state
void updatePlayState(bool running);
@@ -117,12 +120,12 @@ public:
// "animating" means that something is running that requires a timer to keep firing
// (e.g. a software animation)
void setAnimating(bool inAnimating = true) { m_isAnimating = inAnimating; }
- double willNeedService() const;
+ virtual double willNeedService();
double progress(double scale, double offset, const TimingFunction*) const;
- virtual void animate(CompositeAnimation*, RenderObject*, const RenderStyle* /*currentStyle*/,
- const RenderStyle* /*targetStyle*/, RefPtr<RenderStyle>& /*animatedStyle*/) { }
+ virtual void animate(CompositeAnimation*, RenderObject*, const RenderStyle* /*currentStyle*/, RenderStyle* /*targetStyle*/, RefPtr<RenderStyle>& /*animatedStyle*/) = 0;
+ virtual void getAnimatedStyle(RefPtr<RenderStyle>& /*animatedStyle*/) = 0;
virtual bool shouldFireEvents() const { return false; }
@@ -142,6 +145,9 @@ public:
virtual bool affectsProperty(int /*property*/) const { return false; }
bool isAnimatingProperty(int property, bool isRunningNow) const
{
+ if (m_fallbackAnimating)
+ return false;
+
if (isRunningNow)
return (!waitingToStart() && !postActive()) && affectsProperty(property);
@@ -164,7 +170,11 @@ public:
ASSERT(waitingForStyleAvailable());
updateStateMachine(AnimationBase::AnimationStateInputStyleAvailable, -1);
}
-
+
+#if USE(ACCELERATED_COMPOSITING)
+ static bool animationOfPropertyIsAccelerated(int prop);
+#endif
+
protected:
virtual void overrideAnimations() { }
virtual void resumeOverriddenAnimations() { }
@@ -176,23 +186,26 @@ protected:
virtual void onAnimationIteration(double /*elapsedTime*/) { }
virtual void onAnimationEnd(double /*elapsedTime*/) { }
virtual bool startAnimation(double /*beginTime*/) { return false; }
- virtual void endAnimation(bool /*reset*/) { }
+ virtual void endAnimation(bool /*reset*/, double /*forcePauseTime*/ = -1) { }
void goIntoEndingOrLoopingState();
+ bool isFallbackAnimating() const { return m_fallbackAnimating; }
+
static bool propertiesEqual(int prop, const RenderStyle* a, const RenderStyle* b);
static int getPropertyAtIndex(int, bool& isShorthand);
static int getNumProperties();
// Return true if we need to start software animation timers
static bool blendProperties(const AnimationBase* anim, int prop, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress);
-
+
static void setChanged(Node*);
+
+ void getTimeToNextEvent(double& time, bool& isLooping) const;
AnimState m_animState;
bool m_isAnimating; // transition/animation requires continual timer firing
- bool m_waitedForResponse;
double m_startTime;
double m_pauseTime;
double m_requestedStartTime;
@@ -200,6 +213,7 @@ protected:
RefPtr<Animation> m_animation;
CompositeAnimation* m_compAnim;
+ bool m_fallbackAnimating; // true when animating an accelerated property but have to fall back to software
bool m_transformFunctionListValid;
double m_totalDuration, m_nextIterationDuration;