| Index: Source/core/platform/image-decoders/webp/WEBPImageDecoder.h
|
| diff --git a/Source/core/platform/image-decoders/webp/WEBPImageDecoder.h b/Source/core/platform/image-decoders/webp/WEBPImageDecoder.h
|
| index 6cb469c18012ff63a1e96afe673c3d2800fc6427..4c212733964e77e22d715f77c719e44eb337aef3 100644
|
| --- a/Source/core/platform/image-decoders/webp/WEBPImageDecoder.h
|
| +++ b/Source/core/platform/image-decoders/webp/WEBPImageDecoder.h
|
| @@ -32,9 +32,13 @@
|
| #include "core/platform/image-decoders/ImageDecoder.h"
|
|
|
| #include "webp/decode.h"
|
| -#if USE(QCMSLIB) && (WEBP_DECODER_ABI_VERSION > 0x200)
|
| +#if (WEBP_DECODER_ABI_VERSION > 0x200)
|
| +#include "webp/demux.h"
|
| +#define WEBP_ICC_ANIMATION_SUPPORT
|
| +#if USE(QCMSLIB)
|
| #define QCMS_WEBP_COLOR_CORRECTION
|
| #endif
|
| +#endif
|
|
|
| namespace WebCore {
|
|
|
| @@ -45,29 +49,52 @@ public:
|
|
|
| virtual String filenameExtension() const { return "webp"; }
|
| virtual bool isSizeAvailable();
|
| + virtual size_t frameCount();
|
| virtual ImageFrame* frameBufferAtIndex(size_t index);
|
| +#ifdef WEBP_ICC_ANIMATION_SUPPORT
|
| + virtual void setData(SharedBuffer* data, bool allDataReceived);
|
| + virtual int repetitionCount() const;
|
| + virtual bool frameIsCompleteAtIndex(size_t) const;
|
| + virtual float frameDurationAtIndex(size_t) const;
|
| + virtual void clearFrameBufferCache(size_t clearBeforeFrame);
|
| +#endif
|
|
|
| private:
|
| - bool decode(bool onlySize);
|
| + bool decode(const uint8_t* dataBytes, size_t dataSize, bool onlySize, size_t frameIndex);
|
|
|
| WebPIDecoder* m_decoder;
|
| WebPDecBuffer m_decoderBuffer;
|
| - bool m_hasAlpha;
|
| int m_formatFlags;
|
|
|
| #ifdef QCMS_WEBP_COLOR_CORRECTION
|
| qcms_transform* colorTransform() const { return m_transform; }
|
| void createColorTransform(const char* data, size_t);
|
| - void readColorProfile(const uint8_t* data, size_t);
|
| - void applyColorProfile(const uint8_t* data, size_t, ImageFrame&);
|
| + void readColorProfile();
|
|
|
| bool m_haveReadProfile;
|
| qcms_transform* m_transform;
|
| - int m_decodedHeight;
|
| +#endif
|
| +
|
| +#ifdef WEBP_ICC_ANIMATION_SUPPORT
|
| + bool updateDemuxer();
|
| + // Called to initialize the frame buffer at the given index based on
|
| + // the previous frame's disposal method. Returns true on success. On
|
| + // failure, marks the image as failed.
|
| + bool initFrameBuffer(const WebPIterator&, size_t frameIndex);
|
| + void applyPostProcessing(size_t frameIndex);
|
| +
|
| + WebPDemuxer* m_demux;
|
| + WebPDemuxState m_demuxState;
|
| + bool m_haveAlreadyParsedThisData;
|
| + bool m_haveReadAnimationParameters;
|
| + int m_repetitionCount;
|
| + int m_decodedHeight; // Number of rows decoded and post-processed so far in the current frame.
|
| #else
|
| - void applyColorProfile(const uint8_t*, size_t, ImageFrame&) { };
|
| + void applyPostProcessing(size_t) { };
|
| #endif
|
| +
|
| void clear();
|
| + void clearDecoder();
|
| };
|
|
|
| } // namespace WebCore
|
|
|