Commit 02bbc2ca authored by hyatt@apple.com's avatar hyatt@apple.com
Browse files

2008-09-19 David Hyatt <hyatt@apple.com>

        https://bugs.webkit.org/show_bug.cgi?id=20954

        Roll out r36628 since it has caused horrible regressions with
        animated GIF CPU usage.

        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::cacheFrame):
        (WebCore::BitmapImage::startAnimation):
        * 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@36702 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 18b17a64
2008-09-19 David Hyatt <hyatt@apple.com>
https://bugs.webkit.org/show_bug.cgi?id=20954
Roll out r36628 since it has caused horrible regressions with
animated GIF CPU usage.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::cacheFrame):
(WebCore::BitmapImage::startAnimation):
* 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):
2008-09-20 Alp Toker <alp@nuanti.com>
Reviewed by Timothy Hatcher.
......
......@@ -130,7 +130,6 @@ void BitmapImage::cacheFrame(size_t index)
if (numFrames == 1 && m_frames[index].m_frame)
checkForSolidColor();
m_frames[index].m_isComplete = m_source.frameIsCompleteAtIndex(index);
if (shouldAnimate())
m_frames[index].m_duration = m_source.frameDurationAtIndex(index);
m_frames[index].m_hasAlpha = m_source.frameHasAlphaAtIndex(index);
......@@ -215,17 +214,6 @@ NativeImagePtr BitmapImage::frameAtIndex(size_t index)
return m_frames[index].m_frame;
}
bool BitmapImage::frameIsCompleteAtIndex(size_t index)
{
if (index >= frameCount())
return true;
if (index >= m_frames.size() || !m_frames[index].m_frame)
cacheFrame(index);
return m_frames[index].m_isComplete;
}
float BitmapImage::frameDurationAtIndex(size_t index)
{
if (index >= frameCount())
......@@ -259,7 +247,7 @@ void BitmapImage::startAnimation()
return;
// Don't advance the animation until the current frame has completely loaded.
if (!frameIsCompleteAtIndex(m_currentFrame))
if (!m_source.frameIsCompleteAtIndex(m_currentFrame))
return;
// Don't advance past the last frame if we haven't decoded the whole image
......@@ -294,7 +282,7 @@ void BitmapImage::startAnimation()
// See if we've also passed the time for frames after that to start, in
// case we need to skip some frames entirely.
size_t nextFrame = (m_currentFrame + 1) % frameCount();
while (frameIsCompleteAtIndex(nextFrame)) {
while (m_source.frameIsCompleteAtIndex(nextFrame)) {
// Should we skip the current frame?
double nextFrameStartTime = m_desiredFrameStartTime + frameDurationAtIndex(nextFrame);
if (time < nextFrameStartTime)
......
......@@ -66,7 +66,6 @@ template <typename T> class Timer;
struct FrameData : Noncopyable {
FrameData()
: m_frame(0)
, m_isComplete(false)
, m_duration(0)
, m_hasAlpha(true)
{
......@@ -80,7 +79,6 @@ struct FrameData : Noncopyable {
void clear();
NativeImagePtr m_frame;
bool m_isComplete;
float m_duration;
bool m_hasAlpha;
};
......@@ -152,7 +150,6 @@ protected:
size_t currentFrame() const { return m_currentFrame; }
size_t frameCount();
NativeImagePtr frameAtIndex(size_t);
bool frameIsCompleteAtIndex(size_t);
float frameDurationAtIndex(size_t);
bool frameHasAlphaAtIndex(size_t);
......
......@@ -43,7 +43,6 @@ void FrameData::clear()
if (m_frame) {
cairo_surface_destroy(m_frame);
m_frame = 0;
m_isComplete = false;
m_duration = 0.;
m_hasAlpha = true;
}
......
......@@ -52,7 +52,6 @@ void FrameData::clear()
if (m_frame) {
CGImageRelease(m_frame);
m_frame = 0;
m_isComplete = false;
m_duration = 0.0f;
m_hasAlpha = true;
}
......
......@@ -73,7 +73,6 @@ void FrameData::clear()
{
if (m_frame) {
m_frame = 0;
m_isComplete = false;
m_duration = 0.0f;
m_hasAlpha = true;
}
......
......@@ -57,7 +57,6 @@ void FrameData::clear()
if (m_frame) {
delete m_frame;
m_frame = 0;
m_isComplete = false;
m_duration = 0.;
m_hasAlpha = true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment