diff options
author | Iain Merrick <husky@google.com> | 2010-09-13 17:36:35 +0100 |
---|---|---|
committer | Iain Merrick <husky@google.com> | 2010-09-16 12:10:43 +0100 |
commit | f7a8a768a4485e7de59f3707eae666e989a76356 (patch) | |
tree | 2a6c7fc66baf636c3bc775f7944e766fd755fc74 /WebCore | |
parent | bd86da5b75ac10dc475694d78869914c79306169 (diff) | |
download | external_webkit-f7a8a768a4485e7de59f3707eae666e989a76356.zip external_webkit-f7a8a768a4485e7de59f3707eae666e989a76356.tar.gz external_webkit-f7a8a768a4485e7de59f3707eae666e989a76356.tar.bz2 |
Merge WebKit at r67178 : Fix AndroidAnimation.
TimingFunction was previously a simple struct with an enum to
select different behaviors. It's now an abstract class with
a different subclass for each behavior. Fixing AndroidAnimation
so that it holds a RefPtr to the timing function rather than
trying to store its value directly.
See http://trac.webkit.org/changeset/67032
Change-Id: Icb7f2911aea341975531c95594ab1c30ac48cd87
Diffstat (limited to 'WebCore')
-rw-r--r-- | WebCore/platform/graphics/android/AndroidAnimation.cpp | 13 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/AndroidAnimation.h | 2 |
2 files changed, 9 insertions, 6 deletions
diff --git a/WebCore/platform/graphics/android/AndroidAnimation.cpp b/WebCore/platform/graphics/android/AndroidAnimation.cpp index 2b1b252..0daef46 100644 --- a/WebCore/platform/graphics/android/AndroidAnimation.cpp +++ b/WebCore/platform/graphics/android/AndroidAnimation.cpp @@ -46,6 +46,8 @@ AndroidAnimation::AndroidAnimation(const Animation* animation, m_direction(animation->direction()), m_timingFunction(animation->timingFunction()) { + ASSERT(m_timingFunction); + if (!static_cast<int>(beginTime)) // time not set m_beginTime = WTF::currentTime(); @@ -100,11 +102,12 @@ bool AndroidAnimation::checkIterationsAndProgress(double time, float* finalProgr && (m_iterationCount != Animation::IterationCountInfinite)) return false; - if (m_timingFunction.type() != LinearTimingFunction) { - UnitBezier bezier(m_timingFunction.x1(), - m_timingFunction.y1(), - m_timingFunction.x2(), - m_timingFunction.y2()); + if (m_timingFunction->isCubicBezierTimingFunction()) { + CubicBezierTimingFunction* bezierFunction = static_cast<CubicBezierTimingFunction*>(m_timingFunction.get()); + UnitBezier bezier(bezierFunction->x1(), + bezierFunction->y1(), + bezierFunction->x2(), + bezierFunction->y2()); if (m_duration > 0) progress = bezier.solve(progress, 1.0f / (200.0f * m_duration)); } diff --git a/WebCore/platform/graphics/android/AndroidAnimation.h b/WebCore/platform/graphics/android/AndroidAnimation.h index 1eb13d4..358af23 100644 --- a/WebCore/platform/graphics/android/AndroidAnimation.h +++ b/WebCore/platform/graphics/android/AndroidAnimation.h @@ -55,7 +55,7 @@ class AndroidAnimation : public RefCounted<AndroidAnimation> { int m_iterationCount; int m_currentIteration; int m_direction; - TimingFunction m_timingFunction; + RefPtr<TimingFunction> m_timingFunction; String m_name; }; |