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

mrowe at apple.com mrowe at apple.com
Fri Feb 26 22:23:28 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 86c96a7900238e2768855cadc4fc90c97d228e26
Author: mrowe at apple.com <mrowe at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Feb 18 02:19:30 2010 +0000

    Bug 35065: Delay between page loading and animated GIF playing
    <http://webkit.org/b/35065> / <rdar://problem/7109548>
    
    Reviewed by Darin Adler.
    
    BitmapImage::startAnimation was adding the current frame duration to the desired start time
    of the frame for every time it was called.  If the function then bailed out due to not having
    sufficient data to render the frame, this would lead to the desired start time of the frame
    being pushed out multiple times.  On an animated GIF that took mulitple seconds to load this
    could happen many times for a single frame, resulting in the start time of the second frame
    of the animation being pushed out by as much as five seconds.
    
    * platform/graphics/BitmapImage.cpp:
    (WebCore::BitmapImage::startAnimation): Change the order of the code slightly so that the
    desired start time is only updated after determining that we have sufficient data to handle
    the next frame.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54919 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8681d44..648b550 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-02-17  Mark Rowe  <mrowe at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Bug 35065: Delay between page loading and animated GIF playing
+        <http://webkit.org/b/35065> / <rdar://problem/7109548>
+
+        BitmapImage::startAnimation was adding the current frame duration to the desired start time
+        of the frame for every time it was called.  If the function then bailed out due to not having
+        sufficient data to render the frame, this would lead to the desired start time of the frame
+        being pushed out multiple times.  On an animated GIF that took mulitple seconds to load this
+        could happen many times for a single frame, resulting in the start time of the second frame
+        of the animation being pushed out by as much as five seconds.
+
+        * platform/graphics/BitmapImage.cpp:
+        (WebCore::BitmapImage::startAnimation): Change the order of the code slightly so that the
+        desired start time is only updated after determining that we have sufficient data to handle
+        the next frame.
+
 2010-02-17  Stephan Aßmus  <superstippi at gmx.de>
 
         Reviewed by Eric Seidel.
diff --git a/WebCore/platform/graphics/BitmapImage.cpp b/WebCore/platform/graphics/BitmapImage.cpp
index 32aefc9..2b9c612 100644
--- a/WebCore/platform/graphics/BitmapImage.cpp
+++ b/WebCore/platform/graphics/BitmapImage.cpp
@@ -266,6 +266,18 @@ void BitmapImage::startAnimation(bool catchUpIfNecessary)
     if (m_frameTimer || !shouldAnimate() || frameCount() <= 1)
         return;
 
+    // Don't advance the animation to an incomplete frame.
+    size_t nextFrame = (m_currentFrame + 1) % frameCount();
+    if (!m_allDataReceived && !frameIsCompleteAtIndex(nextFrame))
+        return;
+
+    // Don't advance past the last frame if we haven't decoded the whole image
+    // yet and our repetition count is potentially unset.  The repetition count
+    // in a GIF can potentially come after all the rest of the image data, so
+    // wait on it.
+    if (!m_allDataReceived && repetitionCount(false) == cAnimationLoopOnce && m_currentFrame >= (frameCount() - 1))
+        return;
+
     // Determine time for next frame to start.  By ignoring paint and timer lag
     // in this calculation, we make the animation appear to run at its desired
     // rate regardless of how fast it's being repainted.
@@ -284,18 +296,6 @@ void BitmapImage::startAnimation(bool catchUpIfNecessary)
             m_desiredFrameStartTime = time + currentDuration;
     }
 
-    // Don't advance the animation to an incomplete frame.
-    size_t nextFrame = (m_currentFrame + 1) % frameCount();
-    if (!m_allDataReceived && !frameIsCompleteAtIndex(nextFrame))
-        return;
-
-    // Don't advance past the last frame if we haven't decoded the whole image
-    // yet and our repetition count is potentially unset.  The repetition count
-    // in a GIF can potentially come after all the rest of the image data, so
-    // wait on it.
-    if (!m_allDataReceived && repetitionCount(false) == cAnimationLoopOnce && m_currentFrame >= (frameCount() - 1))
-        return;
-
     // 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.
     // Clamp the desired frame start time in this case, so that we don't skip

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list