| Index: third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.h
|
| diff --git a/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.h b/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.h
|
| index c0c9ca872b0ab94e8fb7bf03370a5c2441ca247f..3f3e457fe9a083276a540877e22c9ea9e486e706 100644
|
| --- a/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.h
|
| +++ b/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.h
|
| @@ -39,26 +39,34 @@ public:
|
| PNGImageDecoder(AlphaOption, GammaAndColorProfileOption, size_t maxDecodedBytes, size_t offset = 0);
|
| ~PNGImageDecoder() override;
|
|
|
| + enum class PNGParseQuery { PNGSizeQuery, PNGFrameCountQuery, PNGFrameDataQuery };
|
| +
|
| // ImageDecoder:
|
| String filenameExtension() const override { return "png"; }
|
| + size_t decodeFrameCount() override;
|
| + int repetitionCount() const override;
|
| + void parse(PNGParseQuery);
|
|
|
| // Callbacks from libpng
|
| + void frameHeaderAvailable() {};
|
| void headerAvailable();
|
| void rowAvailable(unsigned char* row, unsigned rowIndex, int);
|
| void complete();
|
|
|
| + // Additional methods used for APNG
|
| + bool isDecodedFrameCountAvailable() const;
|
| + void animationControlAvailable(size_t numFrames, size_t numRepetitions);
|
| +
|
| private:
|
| // ImageDecoder:
|
| - void decodeSize() override { decode(true); }
|
| - void decode(size_t) override { decode(false); }
|
| -
|
| - // Decodes the image. If |onlySize| is true, stops decoding after
|
| - // calculating the image size. If decoding fails but there is no more
|
| - // data coming, sets the "decode failure" flag.
|
| - void decode(bool onlySize);
|
| + void decodeSize() override { parse(PNGParseQuery::PNGSizeQuery); }
|
| + void decode(size_t) override { parse(PNGParseQuery::PNGFrameDataQuery); }
|
|
|
| std::unique_ptr<PNGImageReader> m_reader;
|
| const unsigned m_offset;
|
| + bool m_frameCountDecoded;
|
| + size_t m_frameCount;
|
| + int m_repetitionCount;
|
| };
|
|
|
| } // namespace blink
|
|
|