From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebCore/page/animation/CompositeAnimation.h | 47 +++++++++++++--------- 1 file changed, 28 insertions(+), 19 deletions(-) (limited to 'Source/WebCore/page/animation/CompositeAnimation.h') diff --git a/Source/WebCore/page/animation/CompositeAnimation.h b/Source/WebCore/page/animation/CompositeAnimation.h index 48c679ef2..715de586d 100644 --- a/Source/WebCore/page/animation/CompositeAnimation.h +++ b/Source/WebCore/page/animation/CompositeAnimation.h @@ -10,7 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * 3. Neither the name of Apple Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -26,8 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef CompositeAnimation_h -#define CompositeAnimation_h +#pragma once #include "ImplicitAnimation.h" #include "KeyframeAnimation.h" @@ -37,30 +36,32 @@ namespace WebCore { -class AnimationControllerPrivate; -class AnimationController; +class CSSAnimationControllerPrivate; +class CSSAnimationController; class RenderElement; class RenderStyle; // A CompositeAnimation represents a collection of animations that are running // on a single RenderElement, such as a number of properties transitioning at once. class CompositeAnimation : public RefCounted { + WTF_MAKE_FAST_ALLOCATED; public: - static PassRefPtr create(AnimationControllerPrivate* animationController) + static Ref create(CSSAnimationControllerPrivate& animationController) { - return adoptRef(new CompositeAnimation(animationController)); + return adoptRef(*new CompositeAnimation(animationController)); }; ~CompositeAnimation(); void clearRenderer(); - PassRef animate(RenderElement&, RenderStyle* currentStyle, RenderStyle& targetStyle); - PassRefPtr getAnimatedStyle() const; + bool animate(RenderElement&, const RenderStyle* currentStyle, const RenderStyle& targetStyle, std::unique_ptr& blendedStyle); + std::unique_ptr getAnimatedStyle() const; + bool computeExtentOfTransformAnimation(LayoutRect&) const; double timeToNextService() const; - AnimationControllerPrivate* animationController() const { return m_animationController; } + CSSAnimationControllerPrivate& animationController() const { return m_animationController; } void suspendAnimations(); void resumeAnimations(); @@ -68,9 +69,9 @@ public: bool hasAnimations() const { return !m_transitions.isEmpty() || !m_keyframeAnimations.isEmpty(); } - bool isAnimatingProperty(CSSPropertyID, bool acceleratedOnly, bool isRunningNow) const; + bool isAnimatingProperty(CSSPropertyID, bool acceleratedOnly, AnimationBase::RunningState) const; - PassRefPtr getAnimationForProperty(CSSPropertyID) const; + KeyframeAnimation* animationForProperty(CSSPropertyID) const; void overrideImplicitAnimations(CSSPropertyID); void resumeOverriddenImplicitAnimations(CSSPropertyID); @@ -79,22 +80,30 @@ public: bool pauseTransitionAtTime(CSSPropertyID, double); unsigned numberOfActiveAnimations() const; +#if ENABLE(CSS_ANIMATIONS_LEVEL_2) + bool hasScrollTriggeredAnimation() const { return m_hasScrollTriggeredAnimation; } +#endif + + bool hasAnimationThatDependsOnLayout() const { return m_hasAnimationThatDependsOnLayout; } + private: - CompositeAnimation(AnimationControllerPrivate*); + CompositeAnimation(CSSAnimationControllerPrivate&); - void updateTransitions(RenderElement*, RenderStyle* currentStyle, RenderStyle* targetStyle); - void updateKeyframeAnimations(RenderElement*, RenderStyle* currentStyle, RenderStyle* targetStyle); + void updateTransitions(RenderElement*, const RenderStyle* currentStyle, const RenderStyle* targetStyle); + void updateKeyframeAnimations(RenderElement*, const RenderStyle* currentStyle, const RenderStyle* targetStyle); typedef HashMap> CSSPropertyTransitionsMap; - typedef HashMap> AnimationNameMap; + typedef HashMap> AnimationNameMap; - AnimationControllerPrivate* m_animationController; + CSSAnimationControllerPrivate& m_animationController; CSSPropertyTransitionsMap m_transitions; AnimationNameMap m_keyframeAnimations; Vector m_keyframeAnimationOrderMap; bool m_suspended; + bool m_hasAnimationThatDependsOnLayout { false }; +#if ENABLE(CSS_ANIMATIONS_LEVEL_2) + bool m_hasScrollTriggeredAnimation { false }; +#endif }; } // namespace WebCore - -#endif // CompositeAnimation_h -- cgit v1.2.1