RenderElement::startAnimation should take const Animation&
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Mar 2019 17:59:24 +0000 (17:59 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Mar 2019 17:59:24 +0000 (17:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195929

Reviewed by Daniel Bates.

* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::applyPendingAcceleratedActions):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::startAnimation):
(WebCore::KeyframeAnimation::endAnimation):
* rendering/RenderElement.h:
(WebCore::RenderElement::startAnimation):
(WebCore::RenderElement::animationFinished):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::startAnimation):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::startAnimation):
(WebCore::RenderLayerModelObject::animationFinished):
* rendering/RenderLayerModelObject.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243151 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/animation/KeyframeEffect.cpp
Source/WebCore/page/animation/KeyframeAnimation.cpp
Source/WebCore/rendering/RenderElement.h
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerBacking.h
Source/WebCore/rendering/RenderLayerModelObject.cpp
Source/WebCore/rendering/RenderLayerModelObject.h

index 646fe5f..89a554f 100644 (file)
@@ -1,3 +1,26 @@
+2019-03-19  Zalan Bujtas  <zalan@apple.com>
+
+        RenderElement::startAnimation should take const Animation&
+        https://bugs.webkit.org/show_bug.cgi?id=195929
+
+        Reviewed by Daniel Bates.
+
+        * animation/KeyframeEffect.cpp:
+        (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
+        * page/animation/KeyframeAnimation.cpp:
+        (WebCore::KeyframeAnimation::startAnimation):
+        (WebCore::KeyframeAnimation::endAnimation):
+        * rendering/RenderElement.h:
+        (WebCore::RenderElement::startAnimation):
+        (WebCore::RenderElement::animationFinished):
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::startAnimation):
+        * rendering/RenderLayerBacking.h:
+        * rendering/RenderLayerModelObject.cpp:
+        (WebCore::RenderLayerModelObject::startAnimation):
+        (WebCore::RenderLayerModelObject::animationFinished):
+        * rendering/RenderLayerModelObject.h:
+
 2019-03-19  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: Heap: lazily create the agent
index 4302919..2ed45ad 100644 (file)
@@ -1319,7 +1319,7 @@ void KeyframeEffect::applyPendingAcceleratedActions()
     for (const auto& action : pendingAcceleratedActions) {
         switch (action) {
         case AcceleratedAction::Play:
-            if (!compositedRenderer->startAnimation(timeOffset, backingAnimationForCompositedRenderer().ptr(), m_blendingKeyframes)) {
+            if (!compositedRenderer->startAnimation(timeOffset, backingAnimationForCompositedRenderer(), m_blendingKeyframes)) {
                 m_shouldRunAccelerated = false;
                 m_lastRecordedAcceleratedAction = AcceleratedAction::Stop;
                 animation()->acceleratedStateDidChange();
index 5026dfd..6096919 100644 (file)
@@ -292,7 +292,7 @@ bool KeyframeAnimation::hasAnimationForProperty(CSSPropertyID property) const
 bool KeyframeAnimation::startAnimation(double timeOffset)
 {
     if (auto* renderer = this->renderer())
-        return renderer->startAnimation(timeOffset, m_animation.ptr(), m_keyframes);
+        return renderer->startAnimation(timeOffset, m_animation, m_keyframes);
     return false;
 }
 
index dae56d3..f28dd24 100644 (file)
@@ -226,7 +226,7 @@ public:
     virtual void transitionPaused(double /* timeOffset */, CSSPropertyID) { }
     virtual void transitionFinished(CSSPropertyID) { }
 
-    virtual bool startAnimation(double /* timeOffset */, const Animation*, const KeyframeList&) { return false; }
+    virtual bool startAnimation(double /* timeOffset */, const Animation&, const KeyframeList&) { return false; }
     virtual void animationPaused(double /* timeOffset */, const String& /* name */) { }
     virtual void animationSeeked(double /* timeOffset */, const String& /* name */) { }
     virtual void animationFinished(const String& /* name */) { }
index 6f6bb8b..a90abdd 100644 (file)
@@ -2793,7 +2793,7 @@ void RenderLayerBacking::verifyNotPainting()
 }
 #endif
 
-bool RenderLayerBacking::startAnimation(double timeOffset, const Animation* anim, const KeyframeList& keyframes)
+bool RenderLayerBacking::startAnimation(double timeOffset, const Animation& animation, const KeyframeList& keyframes)
 {
     bool hasOpacity = keyframes.containsProperty(CSSPropertyOpacity);
     bool hasTransform = renderer().isBox() && keyframes.containsProperty(CSSPropertyTransform);
@@ -2846,17 +2846,17 @@ bool RenderLayerBacking::startAnimation(double timeOffset, const Animation* anim
 
     bool didAnimate = false;
 
-    if (hasTransform && m_graphicsLayer->addAnimation(transformVector, snappedIntRect(renderBox()->borderBoxRect()).size(), anim, keyframes.animationName(), timeOffset))
+    if (hasTransform && m_graphicsLayer->addAnimation(transformVector, snappedIntRect(renderBox()->borderBoxRect()).size(), &animation, keyframes.animationName(), timeOffset))
         didAnimate = true;
 
-    if (hasOpacity && m_graphicsLayer->addAnimation(opacityVector, IntSize(), anim, keyframes.animationName(), timeOffset))
+    if (hasOpacity && m_graphicsLayer->addAnimation(opacityVector, IntSize { }, &animation, keyframes.animationName(), timeOffset))
         didAnimate = true;
 
-    if (hasFilter && m_graphicsLayer->addAnimation(filterVector, IntSize(), anim, keyframes.animationName(), timeOffset))
+    if (hasFilter && m_graphicsLayer->addAnimation(filterVector, IntSize { }, &animation, keyframes.animationName(), timeOffset))
         didAnimate = true;
 
 #if ENABLE(FILTERS_LEVEL_2)
-    if (hasBackdropFilter && m_graphicsLayer->addAnimation(backdropFilterVector, IntSize(), anim, keyframes.animationName(), timeOffset))
+    if (hasBackdropFilter && m_graphicsLayer->addAnimation(backdropFilterVector, IntSize { }, &animation, keyframes.animationName(), timeOffset))
         didAnimate = true;
 #endif
 
index fbe2a70..4c57146 100644 (file)
@@ -194,7 +194,7 @@ public:
     void transitionPaused(double timeOffset, CSSPropertyID);
     void transitionFinished(CSSPropertyID);
 
-    bool startAnimation(double timeOffset, const Animation* anim, const KeyframeList& keyframes);
+    bool startAnimation(double timeOffset, const Animation&, const KeyframeList&);
     void animationPaused(double timeOffset, const String& name);
     void animationSeeked(double timeOffset, const String& name);
     void animationFinished(const String& name);
index 4c01e8e..725a47d 100644 (file)
@@ -304,7 +304,7 @@ void RenderLayerModelObject::transitionFinished(CSSPropertyID propertyId)
     layer()->backing()->transitionFinished(propertyId);
 }
 
-bool RenderLayerModelObject::startAnimation(double timeOffset, const Animation* animation, const KeyframeList& keyframes)
+bool RenderLayerModelObject::startAnimation(double timeOffset, const Animation& animation, const KeyframeList& keyframes)
 {
     if (!layer() || !layer()->backing())
         return false;
index a6b2a66..d879242 100644 (file)
@@ -73,7 +73,7 @@ public:
     void transitionPaused(double timeOffset, CSSPropertyID) override;
     void transitionFinished(CSSPropertyID) override;
 
-    bool startAnimation(double timeOffset, const Animation*, const KeyframeList& keyframes) override;
+    bool startAnimation(double timeOffset, const Animation&, const KeyframeList&) override;
     void animationPaused(double timeOffset, const String& name) override;
     void animationSeeked(double timeOffset, const String& name) override;
     void animationFinished(const String& name) override;