Index: Source/core/platform/image-decoders/gif/GIFImageDecoder.cpp |
diff --git a/Source/core/platform/image-decoders/gif/GIFImageDecoder.cpp b/Source/core/platform/image-decoders/gif/GIFImageDecoder.cpp |
index 9a69d6605e4baac8f0315fa9bd5b05eeda330ac1..f9984a50d9e7f3627e898b6bf17eb80dc45c9928 100644 |
--- a/Source/core/platform/image-decoders/gif/GIFImageDecoder.cpp |
+++ b/Source/core/platform/image-decoders/gif/GIFImageDecoder.cpp |
@@ -135,8 +135,7 @@ bool GIFImageDecoder::setFailed() |
return ImageDecoder::setFailed(); |
} |
-// FIXME: Can the intermediate |rowBuffer| be avoided? |
-bool GIFImageDecoder::haveDecodedRow(size_t frameIndex, const Vector<unsigned char>& rowBuffer, size_t width, size_t rowNumber, unsigned repeatCount, bool writeTransparentPixels) |
+bool GIFImageDecoder::haveDecodedRow(size_t frameIndex, GIFRow::const_iterator rowBegin, size_t width, size_t rowNumber, unsigned repeatCount, bool writeTransparentPixels) |
{ |
const GIFFrameContext* frameContext = m_reader->frameContext(frameIndex); |
// The pixel data and coordinates supplied to us are relative to the frame's |
@@ -149,7 +148,7 @@ bool GIFImageDecoder::haveDecodedRow(size_t frameIndex, const Vector<unsigned ch |
const int yBegin = frameContext->yOffset() + rowNumber; |
const int xEnd = std::min(static_cast<int>(frameContext->xOffset() + width), size().width()); |
const int yEnd = std::min(static_cast<int>(frameContext->yOffset() + rowNumber + repeatCount), size().height()); |
- if (rowBuffer.isEmpty() || (xBegin < 0) || (yBegin < 0) || (xEnd <= xBegin) || (yEnd <= yBegin)) |
+ if (!width || (xBegin < 0) || (yBegin < 0) || (xEnd <= xBegin) || (yEnd <= yBegin)) |
return true; |
const GIFColorMap::Table& colorTable = frameContext->localColorMap().isDefined() ? frameContext->localColorMap().table() : m_reader->globalColorMap().table(); |
@@ -165,8 +164,7 @@ bool GIFImageDecoder::haveDecodedRow(size_t frameIndex, const Vector<unsigned ch |
return false; |
const size_t transparentPixel = frameContext->transparentPixel(); |
- Vector<unsigned char>::const_iterator rowBegin = rowBuffer.begin(); |
- Vector<unsigned char>::const_iterator rowEnd = rowBegin + (xEnd - xBegin); |
+ GIFRow::const_iterator rowEnd = rowBegin + (xEnd - xBegin); |
ImageFrame::PixelData* currentAddress = buffer.getAddr(xBegin, yBegin); |
// We may or may not need to write transparent pixels to the buffer. |