[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.22-985-g3c00f00
pkasting at chromium.org
pkasting at chromium.org
Wed Mar 17 17:58:33 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit edbb1eae3873486939c5dee64c94568558d427b3
Author: pkasting at chromium.org <pkasting at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Feb 24 21:52:07 2010 +0000
Fix regression in calculating an animated image's start time.
https://bugs.webkit.org/show_bug.cgi?id=35115
Reviewed by Adam Barth.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::startAnimation):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55199 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 750cec3..fcf55d9 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,13 @@
+2010-02-24 Peter Kasting <pkasting at google.com>
+
+ Reviewed by Adam Barth.
+
+ Fix regression in calculating an animated image's start time.
+ https://bugs.webkit.org/show_bug.cgi?id=35115
+
+ * platform/graphics/BitmapImage.cpp:
+ (WebCore::BitmapImage::startAnimation):
+
2010-02-24 Dan Bernstein <mitz at apple.com>
Reviewed by Simon Fraser.
diff --git a/WebCore/platform/graphics/BitmapImage.cpp b/WebCore/platform/graphics/BitmapImage.cpp
index c750541..910d39a 100644
--- a/WebCore/platform/graphics/BitmapImage.cpp
+++ b/WebCore/platform/graphics/BitmapImage.cpp
@@ -266,6 +266,11 @@ void BitmapImage::startAnimation(bool catchUpIfNecessary)
if (m_frameTimer || !shouldAnimate() || frameCount() <= 1)
return;
+ // If we aren't already animating, set now as the animation start time.
+ const double time = currentTime();
+ if (!m_desiredFrameStartTime)
+ m_desiredFrameStartTime = time;
+
// Don't advance the animation to an incomplete frame.
size_t nextFrame = (m_currentFrame + 1) % frameCount();
if (!m_allDataReceived && !frameIsCompleteAtIndex(nextFrame))
@@ -282,19 +287,14 @@ void BitmapImage::startAnimation(bool catchUpIfNecessary)
// in this calculation, we make the animation appear to run at its desired
// rate regardless of how fast it's being repainted.
const double currentDuration = frameDurationAtIndex(m_currentFrame);
- const double time = currentTime();
- if (m_desiredFrameStartTime == 0) {
+ m_desiredFrameStartTime += currentDuration;
+
+ // When an animated image is more than five minutes out of date, the
+ // user probably doesn't care about resyncing and we could burn a lot of
+ // time looping through frames below. Just reset the timings.
+ const double cAnimationResyncCutoff = 5 * 60;
+ if ((time - m_desiredFrameStartTime) > cAnimationResyncCutoff)
m_desiredFrameStartTime = time + currentDuration;
- } else {
- m_desiredFrameStartTime += currentDuration;
-
- // When an animated image is more than five minutes out of date, the
- // user probably doesn't care about resyncing and we could burn a lot of
- // time looping through frames below. Just reset the timings.
- const double cAnimationResyncCutoff = 5 * 60;
- if ((time - m_desiredFrameStartTime) > cAnimationResyncCutoff)
- m_desiredFrameStartTime = time + currentDuration;
- }
// The image may load more slowly than it's supposed to animate, so that by
// the time we reach the end of the first repetition, we're well behind.
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list