summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorChangSeok Oh <changseok.oh@collabora.co.uk>2013-03-12 07:01:10 (GMT)
committerGustavo Noronha Silva <gustavo.noronha@collabora.com>2013-03-22 14:15:56 (GMT)
commit9ca6989fe48dd5d5ad2f40e33cee8aa206e23008 (patch)
tree9d08475ff87374b92378659e4360ff3f82111552 /Source
parentb66b9836d3b255a5c1c359f86fd7f31d68995702 (diff)
downloadwebkit-clutter-9ca6989fe48dd5d5ad2f40e33cee8aa206e23008.tar.gz
webkit-clutter-9ca6989fe48dd5d5ad2f40e33cee8aa206e23008.tar.xz
[GTK][AC] Add removing animations procedure with clutter ac backend
This changes is based on mac port implementation. The only different thing is that updateAnimations is called explicitly in destructor of GraphicsLayerClutter to remove uncommitted animations. Because even though we call notifyFlushRequired to remove existing animations in removeAnimation(), removeClutterAnimationFromLayer has been never reached since the root layer is destroyed before. It means that we haven't lost a change to remove actual animations from clutterActor.
Diffstat (limited to 'Source')
-rwxr-xr-xSource/WebCore/platform/graphics/clutter/GraphicsLayerClutter.cpp21
-rw-r--r--Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.h8
2 files changed, 22 insertions, 7 deletions
diff --git a/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.cpp b/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.cpp
index f049ef7..d99b5b9 100755
--- a/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.cpp
+++ b/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.cpp
@@ -337,6 +337,13 @@ GraphicsLayerClutter::~GraphicsLayerClutter()
{
LOG(AcceleratedCompositing, "GraphicsLayerClutter::%s", __func__);
+ // Even though we call notifyFlushRequired to remove existing animations in removeAnimation(),
+ // removeClutterAnimationFromLayer has been never reached since the root layer is destroyed.
+ // It means that we haven't lost a change to remove actual animations from clutterActor.
+ // So, we call explictly updateAnimations once here to remove uncommitted animations.
+ if (m_uncommittedChanges & AnimationChanged)
+ updateAnimations();
+
GraphicsLayer::willBeDestroyed();
// We destroy the actors on an idle so that the main loop can run enough to
@@ -782,7 +789,11 @@ void GraphicsLayerClutter::removeAnimation(const String& animationName)
{
LOG(AcceleratedCompositing, "GraphicsLayerClutter::%s", __func__);
- notImplemented();
+ if (!animationIsRunning(animationName))
+ return;
+
+ m_animationsToProcess.add(animationName, AnimationProcessingAction(Remove));
+ noteLayerPropertyChanged(AnimationChanged);
}
void GraphicsLayerClutter::suspendAnimations(double time)
@@ -1662,7 +1673,6 @@ bool GraphicsLayerClutter::addAnimation(const KeyframeValueList& valueList, cons
// http://desandro.github.com/3dtransforms/examples/cube-01-steps.html
return false;
-
ASSERT(!animationName.isEmpty());
if (!anim || anim->isEmptyOrZeroDuration() || valueList.size() < 2)
@@ -1697,12 +1707,11 @@ bool GraphicsLayerClutter::removeClutterAnimationFromLayer(AnimatedPropertyID pr
String animationID = animationIdentifier(animationName, property, index);
- PlatformClutterAnimation* animation = graphicsLayerActorGetAnimationForKey(layer, animationID.utf8().data());
- if (!animation)
+ PlatformClutterAnimation* existingAnimation = graphicsLayerActorGetAnimationForKey(layer, animationID);
+ if (!existingAnimation)
return false;
- animation->removeAnimationForKey(layer, animationID);
-
+ existingAnimation->removeAnimationForKey(layer, animationID);
return true;
}
diff --git a/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.h b/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.h
index 8a3f16c..f3361d9 100644
--- a/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.h
+++ b/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.h
@@ -107,7 +107,7 @@ public:
virtual void setNeedsDisplayInRect(const FloatRect&);
virtual bool addAnimation(const KeyframeValueList&, const IntSize& boxSize, const Animation*, const String& animationName, double timeOffset);
- virtual void removeAnimation(const String& /*animationName*/);
+ virtual void removeAnimation(const String& animationName);
virtual void pauseAnimation(const String& keyframesName, double timeOffset);
virtual void suspendAnimations(double time);
virtual void resumeAnimations();
@@ -131,6 +131,12 @@ private:
StructuralLayerPurpose structuralLayerPurpose() const;
FloatPoint computePositionRelativeToBase(float& pageScale) const;
+
+ bool animationIsRunning(const String& animationName) const
+ {
+ return m_runningAnimations.find(animationName) != m_runningAnimations.end();
+ }
+
void commitLayerChangesBeforeSublayers(float pageScaleFactor, const FloatPoint& positionRelativeToBase);
void commitLayerChangesAfterSublayers();