Fix a harmless mismerge in BitmapImage::destroyDecodedDataIfNecessary
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 31 Aug 2014 22:02:47 +0000 (22:02 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 31 Aug 2014 22:02:47 +0000 (22:02 +0000)
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
Source/WebCore/platform/graphics/BitmapImage.cpp

index 6a104efb7420ef429107d8e88243e56907704edb..b910f34466f0adb868cc3587758ea3fd75e14119 100644 (file)
@@ -1,3 +1,18 @@
+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
index 6603146a114620cf57f31823c66818d64dee1742..bfa9d0f747d5151a64ff5db9e4c4d3e142f8eae2 100644 (file)
@@ -124,17 +124,12 @@ void BitmapImage::destroyDecodedData(bool destroyAll)
 
 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;
 #else
 #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
 #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;
 
     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);
 }