Commit 60c2cceb authored by antti's avatar antti

Reviewed by Hyatt.

        Fix <rdar://problem/5092653>
        REGRESSION: Image decoding making scrolling slow
        
        If decoder gave back a null frame (which I think happens regularly if you don't have full frame 
        data yet for image that does not decode incrementally) m_decodedSize was incremented anyway. This
        led to massive growth in calculated image size and eventually made cache prune constantly. 
        
        No test, I don't know how to make one for this.

        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::cacheFrame):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20558 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent cc025d83
2007-03-28 Antti Koivisto <antti@apple.com>
Reviewed by Hyatt.
Fix <rdar://problem/5092653>
REGRESSION: Image decoding making scrolling slow
If decoder gave back a null frame (which I think happens regularly if you don't have full frame
data yet for image that does not decode incrementally) m_decodedSize was incremented anyway. This
led to massive growth in calculated image size and eventually made cache prune constantly.
No test, I don't know how to make one for this.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::cacheFrame):
2007-03-28 Adele Peterson <adele@apple.com>
Reviewed by Kevin M.
......
......@@ -103,6 +103,8 @@ void BitmapImage::destroyDecodedData(bool incremental)
void BitmapImage::cacheFrame(size_t index)
{
size_t numFrames = frameCount();
ASSERT(m_decodedSize == 0 || numFrames > 1);
if (!m_frames.size() && shouldAnimate()) {
// Snag the repetition count.
m_repetitionCount = m_source.repetitionCount();
......@@ -121,7 +123,7 @@ void BitmapImage::cacheFrame(size_t index)
m_frames[index].m_duration = m_source.frameDurationAtIndex(index);
m_frames[index].m_hasAlpha = m_source.frameHasAlphaAtIndex(index);
int sizeChange = m_size.width() * m_size.height() * 4;
int sizeChange = m_frames[index].m_frame ? m_size.width() * m_size.height() * 4 : 0;
if (sizeChange) {
if (imageObserver())
imageObserver()->decodedSizeWillChange(this, sizeChange);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment