From 867f49c4529ebc994571fc8fb72922343a7f912e Mon Sep 17 00:00:00 2001 From: "timothy_horton@apple.com" Date: Sun, 31 Aug 2014 22:02:47 +0000 Subject: [PATCH] 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. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173148 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 15 +++++++++++++++ Source/WebCore/platform/graphics/BitmapImage.cpp | 13 ++++--------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 6a104efb7420..b910f34466f0 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,18 @@ +2014-08-31 Tim Horton + + 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 Use SinkDocument instead of PDFDocument; get rid of PDFDocument diff --git a/Source/WebCore/platform/graphics/BitmapImage.cpp b/Source/WebCore/platform/graphics/BitmapImage.cpp index 6603146a1146..bfa9d0f747d5 100644 --- a/Source/WebCore/platform/graphics/BitmapImage.cpp +++ b/Source/WebCore/platform/graphics/BitmapImage.cpp @@ -124,17 +124,12 @@ void BitmapImage::destroyDecodedData(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) - 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; #else - 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 @@ -146,7 +141,7 @@ void BitmapImage::destroyDecodedDataIfNecessary(bool destroyAll) for (size_t i = 0; i < m_frames.size(); ++i) allFrameBytes += m_frames[i].m_frameBytes; - if (allFrameBytes > cLargeAnimationCutoff) + if (allFrameBytes > largeAnimationCutoff) destroyDecodedData(destroyAll); } -- 2.36.0