diff options
author | Nicolas Roard <nicolasroard@google.com> | 2011-03-08 17:06:17 -0800 |
---|---|---|
committer | Nicolas Roard <nicolasroard@google.com> | 2011-03-08 19:04:37 -0800 |
commit | 91672cbe203b55ec355d118636d333e9e7d7f3d7 (patch) | |
tree | e242ad245e4c2c1be7d47c7fbdfddb3b89b74c5d /WebCore/platform/graphics/android/AndroidAnimation.cpp | |
parent | 42046545ce1012ef3f925011573d265339778bed (diff) | |
download | external_webkit-91672cbe203b55ec355d118636d333e9e7d7f3d7.zip external_webkit-91672cbe203b55ec355d118636d333e9e7d7f3d7.tar.gz external_webkit-91672cbe203b55ec355d118636d333e9e7d7f3d7.tar.bz2 |
Fix CSS animation bugs
- we were replacing animations by new ones regardless of their types, so
when two anims (i.e. transform and opacity) where set on the same
layer, we'd only run the last one
- the selection of the keys for keyframes animations was buggy
bug:2453890
Change-Id: I03da3f6c2ba1f5bf778e099e52d71d2f5e67d27e
Diffstat (limited to 'WebCore/platform/graphics/android/AndroidAnimation.cpp')
-rw-r--r-- | WebCore/platform/graphics/android/AndroidAnimation.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/WebCore/platform/graphics/android/AndroidAnimation.cpp b/WebCore/platform/graphics/android/AndroidAnimation.cpp index 47fc82c..3280d07 100644 --- a/WebCore/platform/graphics/android/AndroidAnimation.cpp +++ b/WebCore/platform/graphics/android/AndroidAnimation.cpp @@ -54,7 +54,8 @@ long AndroidAnimation::instancesCount() return gDebugAndroidAnimationInstances; } -AndroidAnimation::AndroidAnimation(const Animation* animation, +AndroidAnimation::AndroidAnimation(AndroidAnimationType type, + const Animation* animation, double beginTime) : m_beginTime(beginTime) , m_duration(animation->duration()) @@ -63,6 +64,7 @@ AndroidAnimation::AndroidAnimation(const Animation* animation, , m_direction(animation->direction()) , m_currentDirection(false) , m_timingFunction(animation->timingFunction()) + , m_type(type) { ASSERT(m_timingFunction); @@ -80,6 +82,7 @@ AndroidAnimation::AndroidAnimation(AndroidAnimation* anim) , m_direction(anim->m_direction) , m_currentDirection(false) , m_timingFunction(anim->m_timingFunction) + , m_type(anim->m_type) { gDebugAndroidAnimationInstances++; } @@ -147,7 +150,7 @@ PassRefPtr<AndroidOpacityAnimation> AndroidOpacityAnimation::create( AndroidOpacityAnimation::AndroidOpacityAnimation(const Animation* animation, KeyframeValueList* operations, double beginTime) - : AndroidAnimation(animation, beginTime) + : AndroidAnimation(AndroidAnimation::OPACITY, animation, beginTime) , m_operations(operations) { } @@ -231,7 +234,7 @@ PassRefPtr<AndroidTransformAnimation> AndroidTransformAnimation::create( AndroidTransformAnimation::AndroidTransformAnimation(const Animation* animation, KeyframeValueList* operations, double beginTime) - : AndroidAnimation(animation, beginTime) + : AndroidAnimation(AndroidAnimation::TRANSFORM, animation, beginTime) , m_operations(operations) { } @@ -275,9 +278,9 @@ bool AndroidTransformAnimation::evaluate(LayerAndroid* layer, double time) TransformAnimationValue* value = (TransformAnimationValue*) m_operations->at(i); TransformOperations* values = (TransformOperations*) value->value(); float key = value->keyTime(); - float d = fabs(progress - key); + float d = progress - key; XLOG("[%d] Key %.2f, %d values", i, key, values->size()); - if (!fromValue || (d < distance && i + 1 < m_operations->size())) { + if (!fromValue || (d > 0 && d < distance && i + 1 < m_operations->size())) { fromValue = value; distance = d; foundAt = i; |