From 0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Tue, 11 Aug 2009 17:01:47 +0100 Subject: Merge in WebKit r47029. --- WebCore/platform/graphics/qt/ImageDecoderQt.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'WebCore/platform/graphics/qt/ImageDecoderQt.cpp') 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(); -- cgit v1.1