Changeset 20184 in webkit
- Timestamp:
- Mar 14, 2007, 2:20:47 AM (18 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r20183 r20184 1 2007-03-14 David Hyatt <hyatt@apple.com> 2 3 Fix Radar 5050688. 4 5 For large animated GIFs, destroy and recreate the source for every animation frame. This keeps 6 the memory consumption down while giant images are animating. 7 8 Reviewed by andersca 9 10 * platform/graphics/BitmapImage.cpp: 11 (WebCore::BitmapImage::BitmapImage): 12 (WebCore::BitmapImage::destroyDecodedData): 13 (WebCore::BitmapImage::dataChanged): 14 (WebCore::BitmapImage::advanceAnimation): 15 * platform/graphics/BitmapImage.h: 16 1 17 2007-03-14 David Hyatt <hyatt@apple.com> 2 18 -
trunk/WebCore/platform/graphics/BitmapImage.cpp
r20182 r20184 52 52 , m_animatingImageType(true) 53 53 , m_animationFinished(false) 54 , m_allDataReceived(false) 54 55 , m_haveSize(false) 55 56 , m_sizeAvailable(false) … … 95 96 // while animating that it seems to never clear. 96 97 m_source.clear(); 97 dataChanged(true);98 m_source.setData(m_data.get(), m_allDataReceived); 98 99 } 99 100 } … … 143 144 144 145 // Feed all the data we've seen so far to the image decoder. 146 m_allDataReceived = allDataReceived; 145 147 m_source.setData(m_data.get(), allDataReceived); 146 148 … … 265 267 int frameSize = m_size.width() * m_size.height() * 4; 266 268 if (frameCount() * frameSize > cLargeAnimationCutoff) { 267 // Go ahead and decode the next frame so that it can rely on the previous frame. 269 // Clear and reset the source. 270 m_source.clear(); 271 m_source.setData(m_data.get(), m_allDataReceived); 272 273 // Go ahead and decode the next frame. 268 274 frameAtIndex(m_currentFrame); 269 275 … … 271 277 if (m_frames[previousFrame].m_frame) { 272 278 m_frames[previousFrame].clear(); 273 m_source.destroyFrameAtIndex(previousFrame);274 279 m_decodedSize -= frameSize; 275 280 if (imageObserver()) -
trunk/WebCore/platform/graphics/BitmapImage.h
r20182 r20184 183 183 bool m_animationFinished; // Whether or not we've completed the entire animation. 184 184 185 bool m_allDataReceived; // Whether or not we've received all our data. 186 185 187 mutable bool m_haveSize; // Whether or not our |m_size| member variable has the final overall image size yet. 186 188 bool m_sizeAvailable; // Whether or not we can obtain the size of the first image frame yet from ImageIO.
Note:
See TracChangeset
for help on using the changeset viewer.