Reduce memory footprint of BitmapImage Vectors.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Jun 2012 01:26:17 +0000 (01:26 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Jun 2012 01:26:17 +0000 (01:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=86563

Patch by Nick Carter <nick@chromium.org> on 2012-06-25
Reviewed by Simon Fraser.

No new tests, affects template params only.

* platform/graphics/BitmapImage.h:
(BitmapImage): use an inline capacity of 1 for the image frame Vector
* platform/image-decoders/ImageDecoder.h:
(ImageDecoder): use an inline capacity of 1 for the image frame Vector

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121208 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/BitmapImage.h
Source/WebCore/platform/image-decoders/ImageDecoder.h

index 40fd2f5..f34420c 100644 (file)
@@ -1,3 +1,17 @@
+2012-06-25  Nick Carter  <nick@chromium.org>
+
+        Reduce memory footprint of BitmapImage Vectors.
+        https://bugs.webkit.org/show_bug.cgi?id=86563
+
+        Reviewed by Simon Fraser.
+
+        No new tests, affects template params only.
+
+        * platform/graphics/BitmapImage.h:
+        (BitmapImage): use an inline capacity of 1 for the image frame Vector 
+        * platform/image-decoders/ImageDecoder.h:
+        (ImageDecoder): use an inline capacity of 1 for the image frame Vector
+
 2012-06-25  Kent Tamura  <tkent@chromium.org>
 
         Unreviewed, rolling out r121145.
index 2f1969e..64c81c7 100644 (file)
@@ -272,8 +272,8 @@ protected:
     mutable IntSize m_sizeRespectingOrientation;
     
     size_t m_currentFrame; // The index of the current frame of animation.
-    Vector<FrameData> m_frames; // An array of the cached frames of the animation. We have to ref frames to pin them in the cache.
-    
+    Vector<FrameData, 1> m_frames; // An array of the cached frames of the animation. We have to ref frames to pin them in the cache.
+
     Timer<BitmapImage>* m_frameTimer;
     int m_repetitionCount; // How many total animation loops we should do.  This will be cAnimationNone if this image type is incapable of animation.
     RepetitionCountStatus m_repetitionCountStatus;
index e92ba7d..2611be9 100644 (file)
@@ -362,7 +362,7 @@ namespace WebCore {
         int scaledY(int origY, int searchStart = 0);
 
         RefPtr<SharedBuffer> m_data; // The encoded data.
-        Vector<ImageFrame> m_frameBufferCache;
+        Vector<ImageFrame, 1> m_frameBufferCache;
         // FIXME: Do we need m_colorProfile any more, for any port?
         ColorProfile m_colorProfile;
         bool m_scaled;