Title: [148232] trunk/Source/WebCore
Revision
148232
Author
[email protected]
Date
2013-04-11 13:51:50 -0700 (Thu, 11 Apr 2013)

Log Message

[GTK][AC] Implement GraphicsLayerClutter::moveOrCopyAnimations
https://bugs.webkit.org/show_bug.cgi?id=114019

Patch by ChangSeok Oh <[email protected]> on 2013-04-11
Reviewed by Gustavo Noronha Silva.

Fill moveOrCopyAnimations that is based on Mac port implementation.

Tests: animations/3d/change-transform-in-end-event.html
       animations/3d/transform-origin-vs-functions.html
       compositing/animation/state-at-end-event-transform-layer.html

* platform/graphics/clutter/GraphicsLayerClutter.cpp:
(WebCore::GraphicsLayerClutter::moveOrCopyLayerAnimation):
(WebCore):
(WebCore::GraphicsLayerClutter::moveOrCopyAnimations):
* platform/graphics/clutter/GraphicsLayerClutter.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (148231 => 148232)


--- trunk/Source/WebCore/ChangeLog	2013-04-11 20:34:00 UTC (rev 148231)
+++ trunk/Source/WebCore/ChangeLog	2013-04-11 20:51:50 UTC (rev 148232)
@@ -1,3 +1,22 @@
+2013-04-11  ChangSeok Oh  <[email protected]>
+
+        [GTK][AC] Implement GraphicsLayerClutter::moveOrCopyAnimations
+        https://bugs.webkit.org/show_bug.cgi?id=114019
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Fill moveOrCopyAnimations that is based on Mac port implementation.
+
+        Tests: animations/3d/change-transform-in-end-event.html
+               animations/3d/transform-origin-vs-functions.html
+               compositing/animation/state-at-end-event-transform-layer.html
+
+        * platform/graphics/clutter/GraphicsLayerClutter.cpp:
+        (WebCore::GraphicsLayerClutter::moveOrCopyLayerAnimation):
+        (WebCore):
+        (WebCore::GraphicsLayerClutter::moveOrCopyAnimations):
+        * platform/graphics/clutter/GraphicsLayerClutter.h:
+
 2013-04-11  Anders Carlsson  <[email protected]>
 
         Implement StorageManager::getValues

Modified: trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.cpp (148231 => 148232)


--- trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.cpp	2013-04-11 20:34:00 UTC (rev 148231)
+++ trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.cpp	2013-04-11 20:51:50 UTC (rev 148232)
@@ -400,9 +400,39 @@
     noteLayerPropertyChanged(TransformChanged);
 }
 
+void GraphicsLayerClutter::moveOrCopyLayerAnimation(MoveOrCopy operation, const String& animationIdentifier, GraphicsLayerActor* fromLayer, GraphicsLayerActor* toLayer)
+{
+    RefPtr<PlatformClutterAnimation> anim = graphicsLayerActorGetAnimationForKey(fromLayer, animationIdentifier);
+    if (!anim)
+        return;
+
+    switch (operation) {
+    case Move:
+        anim->removeAnimationForKey(fromLayer, animationIdentifier);
+        anim->addAnimationForKey(toLayer, animationIdentifier);
+        break;
+    case Copy:
+        anim->addAnimationForKey(toLayer, animationIdentifier);
+        break;
+    }
+}
+
 void GraphicsLayerClutter::moveOrCopyAnimations(MoveOrCopy operation, GraphicsLayerActor* fromLayer, GraphicsLayerActor* toLayer)
 {
-    notImplemented();
+    // Look for running animations affecting this property.
+    AnimationsMap::const_iterator end = m_runningAnimations.end();
+    for (AnimationsMap::const_iterator it = m_runningAnimations.begin(); it != end; ++it) {
+        const Vector<LayerPropertyAnimation>& propertyAnimations = it->value;
+        size_t numAnimations = propertyAnimations.size();
+        for (size_t i = 0; i < numAnimations; ++i) {
+            const LayerPropertyAnimation& currAnimation = propertyAnimations[i];
+
+            if (currAnimation.m_property == AnimatedPropertyWebkitTransform
+                || currAnimation.m_property == AnimatedPropertyOpacity
+                || currAnimation.m_property == AnimatedPropertyBackgroundColor)
+                moveOrCopyLayerAnimation(operation, animationIdentifier(currAnimation.m_name, currAnimation.m_property, currAnimation.m_index), fromLayer, toLayer);
+        }
+    }
 }
 
 void GraphicsLayerClutter::setPreserves3D(bool preserves3D)

Modified: trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.h (148231 => 148232)


--- trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.h	2013-04-11 20:34:00 UTC (rev 148231)
+++ trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.h	2013-04-11 20:51:50 UTC (rev 148232)
@@ -143,6 +143,7 @@
     bool setTransformAnimationKeyframes(const KeyframeValueList&, const Animation*, PlatformClutterAnimation*, int functionIndex, TransformOperation::OperationType, bool isMatrixAnimation, const IntSize& boxSize);
 
     enum MoveOrCopy { Move, Copy };
+    static void moveOrCopyLayerAnimation(MoveOrCopy, const String& animationIdentifier, GraphicsLayerActor* fromLayer, GraphicsLayerActor* toLayer);
     void moveOrCopyAnimations(MoveOrCopy, GraphicsLayerActor* fromLayer, GraphicsLayerActor* toLayer);
 
     bool appendToUncommittedAnimations(const KeyframeValueList&, const TransformOperations*, const Animation*, const String& animationName, const IntSize& boxSize, int animationIndex, double timeOffset, bool isMatrixAnimation);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to