summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2009-08-11 17:01:47 +0100
committerBen Murdoch <benm@google.com>2009-08-11 18:21:02 +0100
commit0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5 (patch)
tree2943df35f62d885c89d01063cc528dd73b480fea /WebCore/platform/graphics/qt/ImageDecoderQt.cpp
parent7e7a70bfa49a1122b2597a1e6367d89eb4035eca (diff)
downloadexternal_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.zip
external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.gz
external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.bz2
Merge in WebKit r47029.
Diffstat (limited to 'WebCore/platform/graphics/qt/ImageDecoderQt.cpp')
-rw-r--r--WebCore/platform/graphics/qt/ImageDecoderQt.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/WebCore/platform/graphics/qt/ImageDecoderQt.cpp b/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
index cd32428..7bbdcc0 100644
--- a/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
+++ b/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
@@ -118,7 +118,7 @@ ImageDecoderQt::ReadContext::ReadResult
// Attempt to construct an empty image of the matching size and format
// for efficient reading
QImage newImage = m_dataFormat != QImage::Format_Invalid ?
- QImage(m_size,m_dataFormat) : QImage();
+ QImage(m_size, m_dataFormat) : QImage();
m_target.push_back(ImageData(newImage));
}
@@ -137,8 +137,8 @@ ImageDecoderQt::ReadContext::ReadResult
const bool supportsAnimation = m_reader.supportsAnimation();
if (debugImageDecoderQt)
- qDebug() << "readImage(): #" << m_target.size() << " complete, " << m_size << " format " << m_dataFormat
- << " supportsAnimation=" << supportsAnimation ;
+ qDebug() << "readImage(): #" << m_target.size() << " complete, " << m_size
+ << " format " << m_dataFormat << " supportsAnimation=" << supportsAnimation;
// No point in readinfg further
if (!supportsAnimation)
return ReadComplete;
@@ -158,7 +158,7 @@ ImageDecoderQt::ReadContext::IncrementalReadResult
// set state to reflect complete header, etc.
// For now, we read the whole image.
- const qint64 startPos = m_buffer.pos ();
+ const qint64 startPos = m_buffer.pos();
// Oops, failed. Rewind.
if (!m_reader.read(&imageData.m_image)) {
m_buffer.seek(startPos);
@@ -217,9 +217,7 @@ void ImageDecoderQt::reset()
m_failed = false;
m_imageList.clear();
m_pixmapCache.clear();
- m_sizeAvailable = false;
m_loopCount = cAnimationNone;
- m_size = IntSize(-1, -1);
}
void ImageDecoderQt::setData(const IncomingData &data, bool allDataReceived)
@@ -238,7 +236,7 @@ void ImageDecoderQt::setData(const IncomingData &data, bool allDataReceived)
if (debugImageDecoderQt)
qDebug() << " read returns " << readResult;
- switch ( readResult) {
+ switch (readResult) {
case ReadContext::ReadFailed:
m_failed = true;
break;
@@ -247,8 +245,8 @@ void ImageDecoderQt::setData(const IncomingData &data, bool allDataReceived)
case ReadContext::ReadComplete:
// Did we read anything - try to set the size.
if (hasFirstImageHeader()) {
- m_sizeAvailable = true;
- m_size = m_imageList[0].m_image.size();
+ QSize imgSize = m_imageList[0].m_image.size();
+ setSize(imgSize.width(), imgSize.height());
if (readContext.reader()->supportsAnimation()) {
if (readContext.reader()->loopCount() != -1)
@@ -262,14 +260,14 @@ void ImageDecoderQt::setData(const IncomingData &data, bool allDataReceived)
}
-bool ImageDecoderQt::isSizeAvailable() const
+bool ImageDecoderQt::isSizeAvailable()
{
if (debugImageDecoderQt)
- qDebug() << " ImageDecoderQt::isSizeAvailable() returns" << m_sizeAvailable;
- return m_sizeAvailable;
+ qDebug() << " ImageDecoderQt::isSizeAvailable() returns" << ImageDecoder::isSizeAvailable();
+ return ImageDecoder::isSizeAvailable();
}
-int ImageDecoderQt::frameCount() const
+size_t ImageDecoderQt::frameCount() const
{
if (debugImageDecoderQt)
qDebug() << " ImageDecoderQt::frameCount() returns" << m_imageList.size();