Changeset 160260 in webkit
- Timestamp:
- Dec 6, 2013 4:45:11 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r160259 r160260 1 2013-12-06 Tim Horton <timothy_horton@apple.com> 2 3 [mac] Keep around more decoded image data, since it's purgeable 4 https://bugs.webkit.org/show_bug.cgi?id=125273 5 <rdar://problem/13205438> 6 7 Reviewed by Simon Fraser. 8 9 No new tests, just an optimization. 10 11 Instead of throwing away decoded image data eagerly, allow the operating 12 system to manage the memory via the standard purgeability mechanism, 13 where it can. 14 15 This improves the performance on some pathological cases (extremely large 16 animated GIFs) by up to 8x. 17 18 * loader/cache/MemoryCache.cpp: 19 (WebCore::MemoryCache::pruneLiveResourcesToSize): 20 Don't prune live resources' decoded data if it is purgeable. 21 22 * platform/graphics/BitmapImage.cpp: 23 (WebCore::BitmapImage::destroyDecodedDataIfNecessary): 24 Don't eagerly throw away decoded image data if it's purgeable. 25 26 * loader/cache/CachedImage.h: 27 * loader/cache/CachedResource.h: 28 (WebCore::CachedResource::decodedDataIsPurgeable): 29 * platform/graphics/BitmapImage.h: 30 * platform/graphics/Image.h: 31 (WebCore::Image::decodedDataIsPurgeable): 32 1 33 2013-12-06 Antti Koivisto <antti@apple.com> 2 34 -
trunk/Source/WebCore/loader/cache/CachedImage.h
r159503 r160260 120 120 virtual bool stillNeedsLoad() const OVERRIDE { return !errorOccurred() && status() == Unknown && !isLoading(); } 121 121 122 virtual bool decodedDataIsPurgeable() const OVERRIDE { return m_image && m_image->decodedDataIsPurgeable(); } 123 122 124 // ImageObserver 123 125 virtual void decodedSizeChanged(const Image*, int delta) OVERRIDE; -
trunk/Source/WebCore/loader/cache/CachedResource.h
r157653 r160260 150 150 unsigned decodedSize() const { return m_decodedSize; } 151 151 unsigned overheadSize() const; 152 153 virtual bool decodedDataIsPurgeable() const { return false; } 152 154 153 155 bool isLoaded() const { return !m_loading; } // FIXME. Method name is inaccurate. Loading might not have started yet. -
trunk/Source/WebCore/loader/cache/MemoryCache.cpp
r159679 r160260 267 267 return; 268 268 269 if (current->decodedDataIsPurgeable()) 270 continue; 271 269 272 // Destroy our decoded data. This will remove us from 270 273 // m_liveDecodedResources, and possibly move us to a different LRU -
trunk/Source/WebCore/platform/graphics/BitmapImage.cpp
r160207 r160260 103 103 static const unsigned cLargeAnimationCutoff = 5242880; 104 104 105 // If decoded data is purgeable, the operating system will 106 // take care of throwing it away when the system is under pressure. 107 if (decodedDataIsPurgeable()) 108 return; 109 105 110 // If we have decoded frames but there is no encoded data, we shouldn't destroy 106 111 // the decoded image since we won't be able to reconstruct it later. -
trunk/Source/WebCore/platform/graphics/BitmapImage.h
r160212 r160260 261 261 262 262 private: 263 virtual bool decodedDataIsPurgeable() const OVERRIDE 264 { 265 #if PLATFORM(MAC) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 266 return true; 267 #else 268 return false; 269 #endif 270 } 271 263 272 ImageSource m_source; 264 273 mutable IntSize m_size; // The size to use for the overall image (will just be the size of the first image). -
trunk/Source/WebCore/platform/graphics/Image.h
r160212 r160260 125 125 126 126 virtual void destroyDecodedData(bool destroyAll = true) = 0; 127 virtual bool decodedDataIsPurgeable() const { return false; } 127 128 128 129 SharedBuffer* data() { return m_encodedImageData.get(); }
Note: See TracChangeset
for help on using the changeset viewer.