2008-11-10 Stephanie Lewis <slewis@apple.com>
authorslewis@apple.com <slewis@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Nov 2008 07:06:41 +0000 (07:06 +0000)
committerslewis@apple.com <slewis@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Nov 2008 07:06:41 +0000 (07:06 +0000)
        Reviewed by Dan Bernstein.

        Clear the image source cache even if we haven't decoded any of the image data.
        We use the image source cache when calculating layout.

        * loader/Cache.cpp:
        (WebCore::Cache::pruneDeadResources):
        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::destroyDecodedData):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@38293 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/loader/Cache.cpp
WebCore/platform/graphics/BitmapImage.cpp

index 999ec36..6cc7e74 100644 (file)
@@ -1,3 +1,15 @@
+2008-11-10  Stephanie Lewis  <slewis@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Clear the image source cache even if we haven't decoded any of the image data.
+        We use the image source cache when calculating layout.
+
+        * loader/Cache.cpp:
+        (WebCore::Cache::pruneDeadResources):
+        * platform/graphics/BitmapImage.cpp:
+        (WebCore::BitmapImage::destroyDecodedData):
+
 2008-11-10  Adam Roben  <aroben@apple.com>
 
         Fix Bug 22161: Assertion failure in RenderThemeWin::systemColor when
 2008-11-10  Adam Roben  <aroben@apple.com>
 
         Fix Bug 22161: Assertion failure in RenderThemeWin::systemColor when
index c526d6a..ec3396c 100644 (file)
@@ -320,7 +320,7 @@ void Cache::pruneDeadResources()
         // First flush all the decoded data in this queue.
         while (current) {
             CachedResource* prev = current->m_prevInAllResourcesList;
         // First flush all the decoded data in this queue.
         while (current) {
             CachedResource* prev = current->m_prevInAllResourcesList;
-            if (!current->hasClients() && !current->isPreloaded() && current->isLoaded() && current->decodedSize()) {
+            if (!current->hasClients() && !current->isPreloaded() && current->isLoaded()) {
                 // Destroy our decoded data. This will remove us from 
                 // m_liveDecodedResources, and possibly move us to a differnt 
                 // LRU list in m_allResources.
                 // Destroy our decoded data. This will remove us from 
                 // m_liveDecodedResources, and possibly move us to a differnt 
                 // LRU list in m_allResources.
index 592487f..c893000 100644 (file)
@@ -99,14 +99,13 @@ void BitmapImage::destroyDecodedData(bool incremental, bool preserveNearbyFrames
             if (imageObserver())
                 imageObserver()->decodedSizeChanged(this, sizeChange);
         }
             if (imageObserver())
                 imageObserver()->decodedSizeChanged(this, sizeChange);
         }
-        
-        if (!incremental) {
-            // Reset the image source, since Image I/O has an underlying cache that it uses
-            // while animating that it seems to never clear.
-            m_source.clear();
-            m_source.setData(m_data.get(), m_allDataReceived);
-        }
     }
     }
+    if (!incremental) {
+        // Reset the image source, since Image I/O has an underlying cache that it uses
+        // while animating that it seems to never clear.
+        m_source.clear();
+        m_source.setData(m_data.get(), m_allDataReceived);
+    }    
 }
 
 void BitmapImage::cacheFrame(size_t index)
 }
 
 void BitmapImage::cacheFrame(size_t index)