[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.22-985-g3c00f00

mrowe at apple.com mrowe at apple.com
Wed Mar 17 17:57:44 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 8117a71c7d041a2e09b9510fb6a43d720235f51e
Author: mrowe at apple.com <mrowe at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Feb 23 22:01:09 2010 +0000

    <http://webkit.org/b/35287> ImageSourceCG::frameIsCompleteAtIndex returns false for all frames until image has completed loading
    
    Reviewed by Geoff Garen.
    
    CGImageSourceGetStatusAtIndex claims that all frames of a multi-frame image are incomplete when we've not yet received the
    complete data for an image that is using an incremental data source (<rdar://problem/7679174>). We work around this by
    special-casing all frames except the last in an image and treating them as complete if they are present and reported as
    being incomplete. We do this on the assumption that loading new data can only modify the existing last frame or append new
    frames. The last frame is only treated as being complete if the image source reports it as such. This ensures that it is
    truly the last frame of the image rather than just the last that we currently have data for.
    
    * platform/graphics/cg/ImageSourceCG.cpp:
    (WebCore::ImageSource::frameIsCompleteAtIndex):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55169 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 10c1dd9..29d32bb 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-02-23  Mark Rowe  <mrowe at apple.com>
+
+        Reviewed by Geoff Garen.
+
+        <http://webkit.org/b/35287> ImageSourceCG::frameIsCompleteAtIndex returns false for all frames until image has completed loading
+
+        CGImageSourceGetStatusAtIndex claims that all frames of a multi-frame image are incomplete when we've not yet received the
+        complete data for an image that is using an incremental data source (<rdar://problem/7679174>). We work around this by
+        special-casing all frames except the last in an image and treating them as complete if they are present and reported as
+        being incomplete. We do this on the assumption that loading new data can only modify the existing last frame or append new
+        frames. The last frame is only treated as being complete if the image source reports it as such. This ensures that it is
+        truly the last frame of the image rather than just the last that we currently have data for.
+
+        * platform/graphics/cg/ImageSourceCG.cpp:
+        (WebCore::ImageSource::frameIsCompleteAtIndex):
+
 2010-02-23  Enrica Casucci  <enrica at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/platform/graphics/cg/ImageSourceCG.cpp b/WebCore/platform/graphics/cg/ImageSourceCG.cpp
index 6e0ba50..a9179bc 100644
--- a/WebCore/platform/graphics/cg/ImageSourceCG.cpp
+++ b/WebCore/platform/graphics/cg/ImageSourceCG.cpp
@@ -234,7 +234,22 @@ CGImageRef ImageSource::createFrameAtIndex(size_t index)
 
 bool ImageSource::frameIsCompleteAtIndex(size_t index)
 {
-    return CGImageSourceGetStatusAtIndex(m_decoder, index) == kCGImageStatusComplete;
+    ASSERT(frameCount());
+
+    // CGImageSourceGetStatusAtIndex claims that all frames of a multi-frame image are incomplete
+    // when we've not yet received the complete data for an image that is using an incremental data
+    // source (<rdar://problem/7679174>). We work around this by special-casing all frames except the
+    // last in an image and treating them as complete if they are present and reported as being
+    // incomplete. We do this on the assumption that loading new data can only modify the existing last
+    // frame or append new frames. The last frame is only treated as being complete if the image source
+    // reports it as such. This ensures that it is truly the last frame of the image rather than just
+    // the last that we currently have data for.
+
+    CGImageSourceStatus frameStatus = CGImageSourceGetStatusAtIndex(m_decoder, index);
+    if (index < frameCount() - 1)
+        return frameStatus >= kCGImageStatusIncomplete;
+
+    return frameStatus == kCGImageStatusComplete;
 }
 
 float ImageSource::frameDurationAtIndex(size_t index)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list