Index: Source/core/platform/image-decoders/gif/GIFImageDecoder.h |
diff --git a/Source/core/platform/image-decoders/gif/GIFImageDecoder.h b/Source/core/platform/image-decoders/gif/GIFImageDecoder.h |
index b05f2a177f47ff3b91de6830e77d54bb26fb957d..2a79b98659744575956d148ac4475c686a26bab4 100644 |
--- a/Source/core/platform/image-decoders/gif/GIFImageDecoder.h |
+++ b/Source/core/platform/image-decoders/gif/GIFImageDecoder.h |
@@ -27,7 +27,7 @@ |
#define GIFImageDecoder_h |
#include "core/platform/image-decoders/ImageDecoder.h" |
-#include <wtf/OwnPtr.h> |
+#include "wtf/OwnPtr.h" |
class GIFImageReader; |
@@ -39,7 +39,7 @@ namespace WebCore { |
GIFImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption); |
virtual ~GIFImageDecoder(); |
- enum GIFQuery { GIFFullQuery, GIFSizeQuery, GIFFrameCountQuery }; |
+ enum GIFParseQuery { GIFSizeQuery, GIFFrameCountQuery }; |
// ImageDecoder |
virtual String filenameExtension() const { return "gif"; } |
@@ -55,24 +55,25 @@ namespace WebCore { |
// accessing deleted memory, especially when calling this from inside |
// GIFImageReader! |
virtual bool setFailed(); |
- virtual void clearFrameBufferCache(size_t clearBeforeFrame); |
// Callbacks from the GIF reader. |
- bool haveDecodedRow(unsigned frameIndex, const Vector<unsigned char>& rowBuffer, size_t width, size_t rowNumber, unsigned repeatCount, bool writeTransparentPixels); |
- bool frameComplete(unsigned frameIndex, unsigned frameDuration, ImageFrame::FrameDisposalMethod disposalMethod); |
- void gifComplete(); |
+ bool haveDecodedRow(size_t frameIndex, const Vector<unsigned char>& rowBuffer, size_t width, size_t rowNumber, unsigned repeatCount, bool writeTransparentPixels); |
+ bool frameComplete(size_t frameIndex); |
private: |
- // If the query is GIFFullQuery, decodes the image up to (but not |
- // including) |haltAtFrame|. Otherwise, decodes as much as is needed to |
- // answer the query, ignoring bitmap data. If decoding fails but there |
- // is no more data coming, sets the "decode failure" flag. |
- void decode(unsigned haltAtFrame, GIFQuery); |
+ // Parses as much as is needed to answer the query, ignoring bitmap |
+ // data. If parsing fails, sets the "decode failure" flag. |
+ void parse(GIFParseQuery); |
+ |
+ // Decodes bitmap data of the frame. Depending on the disposal method |
+ // of prior frames, also decodes all required prior frames. If decoding |
+ // fails, sets the "decode failure" flag. |
+ void decode(size_t frameIndex); |
// Called to initialize the frame buffer with the given index, based on |
// the previous frame's disposal method. Returns true on success. On |
// failure, this will mark the image as failed. |
- bool initFrameBuffer(unsigned frameIndex); |
+ bool initFrameBuffer(size_t frameIndex); |
bool m_currentBufferSawAlpha; |
mutable int m_repetitionCount; |