Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Texmap] CSS Transform flicks at the end of animation
https://bugs.webkit.org/show_bug.cgi?id=95347

Reviewed by Noam Rosenthal.

* platform/graphics/GraphicsLayerAnimation.cpp: Check if the last loop has
been completed and then use 1.0 as normalized value for the progress, otherwise
it would work as if there was a new loop forward and then cycle the progress value.


Canonical link: https://commits.webkit.org/113245@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@127072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Rafael Brandao committed Aug 30, 2012
1 parent 29701ce commit 8c3e5b6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
11 changes: 11 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,14 @@
2012-08-29 Rafael Brandao <rafael.lobo@openbossa.org>

[Texmap] CSS Transform flicks at the end of animation
https://bugs.webkit.org/show_bug.cgi?id=95347

Reviewed by Noam Rosenthal.

* platform/graphics/GraphicsLayerAnimation.cpp: Check if the last loop has
been completed and then use 1.0 as normalized value for the progress, otherwise
it would work as if there was a new loop forward and then cycle the progress value.

2012-08-29 Abhishek Arya <inferno@chromium.org>

Crash in WebCore::StyleSheetContents::checkLoadCompleted.
Expand Down
7 changes: 4 additions & 3 deletions Source/WebCore/platform/graphics/GraphicsLayerAnimation.cpp
Expand Up @@ -37,15 +37,16 @@ static bool shouldReverseAnimationValue(Animation::AnimationDirection direction,
return false;
}

static double normalizedAnimationValue(double runningTime, double duration, Animation::AnimationDirection direction)
static double normalizedAnimationValue(double runningTime, double duration, Animation::AnimationDirection direction, double iterationCount)
{
if (!duration)
return 0;

const int loopCount = runningTime / duration;
const double lastFullLoop = duration * double(loopCount);
const double remainder = runningTime - lastFullLoop;
const double normalized = remainder / duration;
// Ignore remainder when we've reached the end of animation.
const double normalized = (loopCount == iterationCount) ? 1.0 : (remainder / duration);

return shouldReverseAnimationValue(direction, loopCount) ? 1 - normalized : normalized;
}
Expand Down Expand Up @@ -214,7 +215,7 @@ void GraphicsLayerAnimation::apply(Client* client)
return;

double totalRunningTime = m_state == PausedState ? m_pauseTime : WTF::currentTime() - m_startTime;
double normalizedValue = normalizedAnimationValue(totalRunningTime, m_animation->duration(), m_animation->direction());
double normalizedValue = normalizedAnimationValue(totalRunningTime, m_animation->duration(), m_animation->direction(), m_animation->iterationCount());

if (m_animation->iterationCount() != Animation::IterationCountInfinite && totalRunningTime >= m_animation->duration() * m_animation->iterationCount()) {
setState(StoppedState);
Expand Down

0 comments on commit 8c3e5b6

Please sign in to comment.