diff options
author | Ben Murdoch <benm@google.com> | 2010-07-22 15:37:06 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-07-27 10:20:25 +0100 |
commit | 967717af5423377c967781471ee106e2bb4e11c8 (patch) | |
tree | 1e701dc0a12f7f07cce1df4a7681717de77a211b /WebCore/page/animation | |
parent | dcc30a9fca45f634b1d3a12b276d3a0ccce99fc3 (diff) | |
download | external_webkit-967717af5423377c967781471ee106e2bb4e11c8.zip external_webkit-967717af5423377c967781471ee106e2bb4e11c8.tar.gz external_webkit-967717af5423377c967781471ee106e2bb4e11c8.tar.bz2 |
Merge WebKit at r63859 : Initial merge by git.
Change-Id: Ie8096c63ec7c991c9a9cba8bdd9c3b74a3b8ed62
Diffstat (limited to 'WebCore/page/animation')
-rw-r--r-- | WebCore/page/animation/AnimationBase.cpp | 12 | ||||
-rw-r--r-- | WebCore/page/animation/AnimationBase.h | 9 | ||||
-rw-r--r-- | WebCore/page/animation/AnimationController.cpp | 22 | ||||
-rw-r--r-- | WebCore/page/animation/AnimationController.h | 3 | ||||
-rw-r--r-- | WebCore/page/animation/AnimationControllerPrivate.h | 3 | ||||
-rw-r--r-- | WebCore/page/animation/CompositeAnimation.cpp | 8 | ||||
-rw-r--r-- | WebCore/page/animation/CompositeAnimation.h | 4 | ||||
-rw-r--r-- | WebCore/page/animation/ImplicitAnimation.cpp | 2 | ||||
-rw-r--r-- | WebCore/page/animation/KeyframeAnimation.cpp | 2 |
9 files changed, 41 insertions, 24 deletions
diff --git a/WebCore/page/animation/AnimationBase.cpp b/WebCore/page/animation/AnimationBase.cpp index 7195d1f..83fd039 100644 --- a/WebCore/page/animation/AnimationBase.cpp +++ b/WebCore/page/animation/AnimationBase.cpp @@ -774,7 +774,7 @@ AnimationBase::AnimationBase(const Animation* transition, RenderObject* renderer , m_object(renderer) , m_animation(const_cast<Animation*>(transition)) , m_compAnim(compAnim) - , m_fallbackAnimating(false) + , m_isAccelerated(false) , m_transformFunctionListValid(false) , m_nextIterationDuration(-1) , m_next(0) @@ -837,7 +837,7 @@ bool AnimationBase::blendProperties(const AnimationBase* anim, int prop, RenderS if (wrapper) { wrapper->blend(anim, dst, a, b, progress); #if USE(ACCELERATED_COMPOSITING) - return !wrapper->animationIsAccelerated() || anim->isFallbackAnimating(); + return !wrapper->animationIsAccelerated() || !anim->isAccelerated(); #else return true; #endif @@ -974,7 +974,7 @@ void AnimationBase::updateStateMachine(AnimStateInput input, double param) // We won't try to start accelerated animations if we are overridden and // just move on to the next state. m_animState = AnimationStateStartWaitResponse; - m_fallbackAnimating = true; + m_isAccelerated = false; updateStateMachine(AnimationStateInputStartTimeSet, beginAnimationUpdateTime()); } else { @@ -985,7 +985,7 @@ void AnimationBase::updateStateMachine(AnimStateInput input, double param) bool started = startAnimation(timeOffset); m_compAnim->animationController()->addToStartTimeResponseWaitList(this, started); - m_fallbackAnimating = !started; + m_isAccelerated = started; } break; case AnimationStateStartWaitResponse: @@ -1108,11 +1108,11 @@ void AnimationBase::updateStateMachine(AnimStateInput input, double param) // We won't try to start accelerated animations if we are overridden and // just move on to the next state. updateStateMachine(AnimationStateInputStartTimeSet, beginAnimationUpdateTime()); - m_fallbackAnimating = true; + m_isAccelerated = false; } else { bool started = startAnimation(beginAnimationUpdateTime() - m_startTime); m_compAnim->animationController()->addToStartTimeResponseWaitList(this, started); - m_fallbackAnimating = !started; + m_isAccelerated = started; } break; case AnimationStateFillingForwards: diff --git a/WebCore/page/animation/AnimationBase.h b/WebCore/page/animation/AnimationBase.h index 91ef8cf..9bdca3a 100644 --- a/WebCore/page/animation/AnimationBase.h +++ b/WebCore/page/animation/AnimationBase.h @@ -144,9 +144,10 @@ public: // Does this animation/transition involve the given property? virtual bool affectsProperty(int /*property*/) const { return false; } - bool isAnimatingProperty(int property, bool isRunningNow) const + + bool isAnimatingProperty(int property, bool acceleratedOnly, bool isRunningNow) const { - if (m_fallbackAnimating) + if (acceleratedOnly && !m_isAccelerated) return false; if (isRunningNow) @@ -197,7 +198,7 @@ protected: void goIntoEndingOrLoopingState(); - bool isFallbackAnimating() const { return m_fallbackAnimating; } + bool isAccelerated() const { return m_isAccelerated; } static bool propertiesEqual(int prop, const RenderStyle* a, const RenderStyle* b); static int getPropertyAtIndex(int, bool& isShorthand); @@ -220,7 +221,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_isAccelerated; bool m_transformFunctionListValid; double m_totalDuration, m_nextIterationDuration; diff --git a/WebCore/page/animation/AnimationController.cpp b/WebCore/page/animation/AnimationController.cpp index 3761c5a..b5d87e6 100644 --- a/WebCore/page/animation/AnimationController.cpp +++ b/WebCore/page/animation/AnimationController.cpp @@ -209,13 +209,22 @@ void AnimationControllerPrivate::animationTimerFired(Timer<AnimationControllerPr fireEventsAndUpdateStyle(); } -bool AnimationControllerPrivate::isAnimatingPropertyOnRenderer(RenderObject* renderer, CSSPropertyID property, bool isRunningNow) const +bool AnimationControllerPrivate::isRunningAnimationOnRenderer(RenderObject* renderer, CSSPropertyID property, bool isRunningNow) const { RefPtr<CompositeAnimation> animation = m_compositeAnimations.get(renderer); if (!animation) return false; - return animation->isAnimatingProperty(property, isRunningNow); + return animation->isAnimatingProperty(property, false, isRunningNow); +} + +bool AnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer(RenderObject* renderer, CSSPropertyID property, bool isRunningNow) const +{ + RefPtr<CompositeAnimation> animation = m_compositeAnimations.get(renderer); + if (!animation) + return false; + + return animation->isAnimatingProperty(property, true, isRunningNow); } void AnimationControllerPrivate::suspendAnimations(Document* document) @@ -532,9 +541,14 @@ bool AnimationController::pauseTransitionAtTime(RenderObject* renderer, const St return m_data->pauseTransitionAtTime(renderer, property, t); } -bool AnimationController::isAnimatingPropertyOnRenderer(RenderObject* renderer, CSSPropertyID property, bool isRunningNow) const +bool AnimationController::isRunningAnimationOnRenderer(RenderObject* renderer, CSSPropertyID property, bool isRunningNow) const +{ + return m_data->isRunningAnimationOnRenderer(renderer, property, isRunningNow); +} + +bool AnimationController::isRunningAcceleratedAnimationOnRenderer(RenderObject* renderer, CSSPropertyID property, bool isRunningNow) const { - return m_data->isAnimatingPropertyOnRenderer(renderer, property, isRunningNow); + return m_data->isRunningAcceleratedAnimationOnRenderer(renderer, property, isRunningNow); } void AnimationController::suspendAnimations(Document* document) diff --git a/WebCore/page/animation/AnimationController.h b/WebCore/page/animation/AnimationController.h index db82618..d184b45 100644 --- a/WebCore/page/animation/AnimationController.h +++ b/WebCore/page/animation/AnimationController.h @@ -61,7 +61,8 @@ public: bool pauseTransitionAtTime(RenderObject*, const String& property, double t); // To be used only for testing unsigned numberOfActiveAnimations() const; // To be used only for testing - bool isAnimatingPropertyOnRenderer(RenderObject*, CSSPropertyID, bool isRunningNow = true) const; + bool isRunningAnimationOnRenderer(RenderObject*, CSSPropertyID, bool isRunningNow = true) const; + bool isRunningAcceleratedAnimationOnRenderer(RenderObject*, CSSPropertyID, bool isRunningNow = true) const; void suspendAnimations(Document*); void resumeAnimations(Document*); diff --git a/WebCore/page/animation/AnimationControllerPrivate.h b/WebCore/page/animation/AnimationControllerPrivate.h index 5ef9098..3ae15a5 100644 --- a/WebCore/page/animation/AnimationControllerPrivate.h +++ b/WebCore/page/animation/AnimationControllerPrivate.h @@ -70,7 +70,8 @@ public: void suspendAnimations(Document*); void resumeAnimations(Document*); - bool isAnimatingPropertyOnRenderer(RenderObject*, CSSPropertyID, bool isRunningNow) const; + bool isRunningAnimationOnRenderer(RenderObject*, CSSPropertyID, bool isRunningNow) const; + bool isRunningAcceleratedAnimationOnRenderer(RenderObject*, CSSPropertyID, bool isRunningNow) const; bool pauseAnimationAtTime(RenderObject*, const String& name, double t); bool pauseTransitionAtTime(RenderObject*, const String& property, double t); diff --git a/WebCore/page/animation/CompositeAnimation.cpp b/WebCore/page/animation/CompositeAnimation.cpp index 7619b1f..57c2aa4 100644 --- a/WebCore/page/animation/CompositeAnimation.cpp +++ b/WebCore/page/animation/CompositeAnimation.cpp @@ -136,7 +136,7 @@ void CompositeAnimation::updateTransitions(RenderObject* renderer, RenderStyle* #if USE(ACCELERATED_COMPOSITING) // For accelerated animations we need to return a new RenderStyle with the _current_ value // of the property, so that restarted transitions use the correct starting point. - if (AnimationBase::animationOfPropertyIsAccelerated(prop) && !implAnim->isFallbackAnimating()) { + if (AnimationBase::animationOfPropertyIsAccelerated(prop) && implAnim->isAccelerated()) { if (!modifiedCurrentStyle) modifiedCurrentStyle = RenderStyle::clone(currentStyle); @@ -460,14 +460,14 @@ void CompositeAnimation::resumeOverriddenImplicitAnimations(int property) } } -bool CompositeAnimation::isAnimatingProperty(int property, bool isRunningNow) const +bool CompositeAnimation::isAnimatingProperty(int property, bool acceleratedOnly, bool isRunningNow) const { if (!m_keyframeAnimations.isEmpty()) { m_keyframeAnimations.checkConsistency(); AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end(); for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) { KeyframeAnimation* anim = it->second.get(); - if (anim && anim->isAnimatingProperty(property, isRunningNow)) + if (anim && anim->isAnimatingProperty(property, acceleratedOnly, isRunningNow)) return true; } } @@ -476,7 +476,7 @@ bool CompositeAnimation::isAnimatingProperty(int property, bool isRunningNow) co CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end(); for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) { ImplicitAnimation* anim = it->second.get(); - if (anim && anim->isAnimatingProperty(property, isRunningNow)) + if (anim && anim->isAnimatingProperty(property, acceleratedOnly, isRunningNow)) return true; } } diff --git a/WebCore/page/animation/CompositeAnimation.h b/WebCore/page/animation/CompositeAnimation.h index b7db442..51ba565 100644 --- a/WebCore/page/animation/CompositeAnimation.h +++ b/WebCore/page/animation/CompositeAnimation.h @@ -70,8 +70,8 @@ public: bool hasAnimations() const { return !m_transitions.isEmpty() || !m_keyframeAnimations.isEmpty(); } void setAnimating(bool); - bool isAnimatingProperty(int property, bool isRunningNow) const; - + bool isAnimatingProperty(int property, bool acceleratedOnly, bool isRunningNow) const; + PassRefPtr<KeyframeAnimation> getAnimationForProperty(int property) const; void overrideImplicitAnimations(int property); diff --git a/WebCore/page/animation/ImplicitAnimation.cpp b/WebCore/page/animation/ImplicitAnimation.cpp index 328fe0e..da0a810 100644 --- a/WebCore/page/animation/ImplicitAnimation.cpp +++ b/WebCore/page/animation/ImplicitAnimation.cpp @@ -273,7 +273,7 @@ double ImplicitAnimation::timeToNextService() // A return value of 0 means we need service. But if this is an accelerated animation we // only need service at the end of the transition. - if (animationOfPropertyIsAccelerated(m_animatingProperty) && !isFallbackAnimating()) { + if (animationOfPropertyIsAccelerated(m_animatingProperty) && isAccelerated()) { bool isLooping; getTimeToNextEvent(t, isLooping); } diff --git a/WebCore/page/animation/KeyframeAnimation.cpp b/WebCore/page/animation/KeyframeAnimation.cpp index 4c2cbc8..2f2cfc0 100644 --- a/WebCore/page/animation/KeyframeAnimation.cpp +++ b/WebCore/page/animation/KeyframeAnimation.cpp @@ -400,7 +400,7 @@ double KeyframeAnimation::timeToNextService() bool acceleratedPropertiesOnly = true; for (HashSet<int>::const_iterator it = m_keyframes.beginProperties(); it != endProperties; ++it) { - if (!animationOfPropertyIsAccelerated(*it) || isFallbackAnimating()) { + if (!animationOfPropertyIsAccelerated(*it) || !isAccelerated()) { acceleratedPropertiesOnly = false; break; } |