2009-01-09 Peter Kasting <pkasting@google.com>
Reviewed by David Hyatt.
https://bugs.webkit.org/show_bug.cgi?id=22995
Fix flaky image animation by resetting the metadata for a frame when
we get new data for that frame. This fixes animations that halted
when the next frame of the animation wasn't complete by the time the
current frame's duration expired.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::destroyDecodedData):
(WebCore::BitmapImage::dataChanged):
* platform/graphics/BitmapImage.h:
(WebCore::FrameData::~FrameData):
* platform/graphics/cairo/ImageCairo.cpp:
(WebCore::FrameData::clear):
* platform/graphics/cg/ImageCG.cpp:
(WebCore::FrameData::clear):
* platform/graphics/qt/ImageQt.cpp:
(WebCore::FrameData::clear):
* platform/graphics/wx/ImageWx.cpp:
(WebCore::FrameData::clear):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@39751 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/platform/graphics/qt/ImageQt.cpp b/WebCore/platform/graphics/qt/ImageQt.cpp
index 37d2b72..99062f9 100644
--- a/WebCore/platform/graphics/qt/ImageQt.cpp
+++ b/WebCore/platform/graphics/qt/ImageQt.cpp
@@ -69,14 +69,16 @@
namespace WebCore {
-void FrameData::clear()
+bool FrameData::clear(bool clearMetadata)
{
+ if (clearMetadata)
+ m_haveMetadata = false;
+
if (m_frame) {
m_frame = 0;
- // NOTE: We purposefully don't reset metadata here, so that even if we
- // throw away previously-decoded data, animation loops can still access
- // properties like frame durations without re-decoding.
+ return true;
}
+ return false;
}