summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
diff options
context:
space:
mode:
authorNicolas Roard <nicolasroard@google.com>2011-03-09 13:52:11 -0800
committerNicolas Roard <nicolasroard@google.com>2011-03-10 15:14:54 -0800
commitac8d9f13717dd67de94dc7ab18690d6da10b0c99 (patch)
tree0387c02be91f0e9b652a83f4c8502672ec2dfabb /WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
parent95cb21b0cde2a64281360f9e45f31f049e583273 (diff)
downloadexternal_webkit-ac8d9f13717dd67de94dc7ab18690d6da10b0c99.zip
external_webkit-ac8d9f13717dd67de94dc7ab18690d6da10b0c99.tar.gz
external_webkit-ac8d9f13717dd67de94dc7ab18690d6da10b0c99.tar.bz2
Fix CSS animations
- we were overriding existing animations. - implement correctly the removeAnimations functions - refactor AndroidAnimation (share common code) - fix how we use the timing functions for the animations - implements timing functions per keyframes bug:2453890 Change-Id: I367d708338c270171eeaacc7e2fb3729eb78c444
Diffstat (limited to 'WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp')
-rw-r--r--WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
index 54346e5..ba9f295 100644
--- a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
+++ b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
@@ -609,7 +609,7 @@ bool GraphicsLayerAndroid::repaint()
}
}
- TLOG("(%x) repaint() on (%.2f,%.2f) contentlayer(%.2f,%.2f,%.2f,%.2f)paintGraphicsLayer called!",
+ LOG("(%x) repaint() on (%.2f,%.2f) contentlayer(%.2f,%.2f,%.2f,%.2f)paintGraphicsLayer called!",
this, m_size.width(), m_size.height(),
m_contentLayer->getPosition().fX,
m_contentLayer->getPosition().fY,
@@ -722,23 +722,22 @@ bool GraphicsLayerAndroid::createAnimationFromKeyframes(const KeyframeValueList&
bool isKeyframe = valueList.size() > 2;
TLOG("createAnimationFromKeyframes(%d), name(%s) beginTime(%.2f)",
isKeyframe, keyframesName.latin1().data(), beginTime);
- // TODO: handles keyframe animations correctly
switch (valueList.property()) {
case AnimatedPropertyInvalid: break;
case AnimatedPropertyWebkitTransform: break;
case AnimatedPropertyBackgroundColor: break;
-
case AnimatedPropertyOpacity: {
MLOG("ANIMATEDPROPERTYOPACITY");
KeyframeValueList* operationsList = new KeyframeValueList(AnimatedPropertyOpacity);
for (unsigned int i = 0; i < valueList.size(); i++) {
- FloatAnimationValue* originalValue = (FloatAnimationValue*)valueList.at(i);
- FloatAnimationValue* value = new FloatAnimationValue(originalValue->keyTime(),
- originalValue->value(), 0);
- // TODO: pass the timing function originalValue->timingFunction());
- operationsList->insert(value);
+ FloatAnimationValue* originalValue = (FloatAnimationValue*)valueList.at(i);
+ PassRefPtr<TimingFunction> timingFunction(const_cast<TimingFunction*>(originalValue->timingFunction()));
+ FloatAnimationValue* value = new FloatAnimationValue(originalValue->keyTime(),
+ originalValue->value(),
+ timingFunction);
+ operationsList->insert(value);
}
RefPtr<AndroidOpacityAnimation> anim = AndroidOpacityAnimation::create(animation,
@@ -776,9 +775,10 @@ bool GraphicsLayerAndroid::createTransformAnimationsFromKeyframes(const Keyframe
KeyframeValueList* operationsList = new KeyframeValueList(AnimatedPropertyWebkitTransform);
for (unsigned int i = 0; i < valueList.size(); i++) {
TransformAnimationValue* originalValue = (TransformAnimationValue*)valueList.at(i);
+ PassRefPtr<TimingFunction> timingFunction(const_cast<TimingFunction*>(originalValue->timingFunction()));
TransformAnimationValue* value = new TransformAnimationValue(originalValue->keyTime(),
- originalValue->value(), 0);
- // TODO: pass the timing function originalValue->timingFunction());
+ originalValue->value(),
+ timingFunction);
operationsList->insert(value);
}
@@ -801,14 +801,14 @@ bool GraphicsLayerAndroid::createTransformAnimationsFromKeyframes(const Keyframe
void GraphicsLayerAndroid::removeAnimationsForProperty(AnimatedPropertyID anID)
{
TLOG("NRO removeAnimationsForProperty(%d)", anID);
- m_contentLayer->removeAnimation(propertyIdToString(anID));
+ m_contentLayer->removeAnimationsForProperty(anID);
askForSync();
}
void GraphicsLayerAndroid::removeAnimationsForKeyframes(const String& keyframesName)
{
TLOG("NRO removeAnimationsForKeyframes(%s)", keyframesName.latin1().data());
- m_contentLayer->removeAnimation(keyframesName);
+ m_contentLayer->removeAnimationsForKeyframes(keyframesName);
askForSync();
}