[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.21-584-g1e41756

pkasting at chromium.org pkasting at chromium.org
Fri Feb 26 22:26:03 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 114834e6cd7d0afffd3a1db954c9685fcc3be1ff
Author: pkasting at chromium.org <pkasting at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Feb 20 00:45:45 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@55039 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index cdb2c43..c343854 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,13 @@
+2010-02-18  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-19  Alexey Proskuryakov  <ap at apple.com>
 
         Reviewed by Geoffrey Garen.
diff --git a/WebCore/platform/graphics/BitmapImage.cpp b/WebCore/platform/graphics/BitmapImage.cpp
index 2b9c612..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.
@@ -307,7 +307,7 @@ void BitmapImage::startAnimation(bool catchUpIfNecessary)
     // switch tabs (and thus stop drawing the animation, which will pause it)
     // during that initial loop, then switch back later.
     if (nextFrame == 0 && m_repetitionsComplete == 0 && m_desiredFrameStartTime < time)
-      m_desiredFrameStartTime = time;
+        m_desiredFrameStartTime = time;
 
     if (!catchUpIfNecessary || time < m_desiredFrameStartTime) {
         // Haven't yet reached time for next frame to start; delay until then.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list