https://bugs.webkit.org/show_bug.cgi?id=136412
Reviewed by Alexey Proskuryakov.
No new tests, just cleanup.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::destroyDecodedDataIfNecessary):
Drop the leading 'c' and the 'static' on the cutoff parameter.
Remove the duplicated early return (seems like it happened in the merge).
Remove reference to the exact size in the comment, since it's different on iOS.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173148
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-08-31 Tim Horton <timothy_horton@apple.com>
+
+ Fix a harmless mismerge in BitmapImage::destroyDecodedDataIfNecessary
+ https://bugs.webkit.org/show_bug.cgi?id=136412
+
+ Reviewed by Alexey Proskuryakov.
+
+ No new tests, just cleanup.
+
+ * platform/graphics/BitmapImage.cpp:
+ (WebCore::BitmapImage::destroyDecodedDataIfNecessary):
+ Drop the leading 'c' and the 'static' on the cutoff parameter.
+ Remove the duplicated early return (seems like it happened in the merge).
+ Remove reference to the exact size in the comment, since it's different on iOS.
+
2014-08-31 Tim Horton <timothy_horton@apple.com>
Use SinkDocument instead of PDFDocument; get rid of PDFDocument
2014-08-31 Tim Horton <timothy_horton@apple.com>
Use SinkDocument instead of PDFDocument; get rid of PDFDocument
void BitmapImage::destroyDecodedDataIfNecessary(bool destroyAll)
{
void BitmapImage::destroyDecodedDataIfNecessary(bool destroyAll)
{
- // Animated images >5MB are considered large enough that we'll only hang on
+ // Animated images over a certain size are considered large enough that we'll only hang on
// to one frame at a time.
#if PLATFORM(IOS)
// to one frame at a time.
#if PLATFORM(IOS)
- static const unsigned cLargeAnimationCutoff = 2097152;
-
- // If we have decoded frames but there is no encoded data, we shouldn't destroy
- // the decoded image since we won't be able to reconstruct it later.
- if (!data() && m_frames.size())
- return;
+ const unsigned largeAnimationCutoff = 2097152;
- static const unsigned cLargeAnimationCutoff = 5242880;
+ const unsigned largeAnimationCutoff = 5242880;
#endif
// If we have decoded frames but there is no encoded data, we shouldn't destroy
#endif
// If we have decoded frames but there is no encoded data, we shouldn't destroy
for (size_t i = 0; i < m_frames.size(); ++i)
allFrameBytes += m_frames[i].m_frameBytes;
for (size_t i = 0; i < m_frames.size(); ++i)
allFrameBytes += m_frames[i].m_frameBytes;
- if (allFrameBytes > cLargeAnimationCutoff)
+ if (allFrameBytes > largeAnimationCutoff)
destroyDecodedData(destroyAll);
}
destroyDecodedData(destroyAll);
}