This patch dramatically reduces the memory consumed by animated images. ...
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Mar 2007 08:43:35 +0000 (08:43 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Mar 2007 08:43:35 +0000 (08:43 +0000)
commite1901bf85e4b5bff66a799e9353887bfab843720
tree3a68388077700e1ce24a1679ad3cab337fa5da8f
parent14646eb26ecf4ea39e14724e93aa6b8d554f6d14
    This patch dramatically reduces the memory consumed by animated images.  For large animated GIFs (defined for
        now as >1mb in terms of decoded frame buffer size), we will now aggressively flush previous frames of the
        animated GIF and just re-decode them on the fly if the animation loops.

        Whenever a large animated GIF has its animation reset, we will also just throw out everything and start
        the animation over (in order to get rid of any cached detritus held in the ImageSource).

        With this patch and the sample GIF used to test, WebKit's memory consumption went from 160MB down to 16MB.

        Reviewed by mjs

        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::destroyDecodedData):
        (WebCore::BitmapImage::resetAnimation):
        (WebCore::BitmapImage::advanceAnimation):
        * platform/graphics/ImageSource.h:
        * platform/graphics/cg/ImageSourceCG.cpp:
        (WebCore::ImageSource::~ImageSource):
        (WebCore::ImageSource::clear):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@20056 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/platform/graphics/BitmapImage.cpp
WebCore/platform/graphics/ImageSource.h
WebCore/platform/graphics/cg/ImageSourceCG.cpp