Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1148)

Unified Diff: third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.h

Issue 1567053002: Animated PNG implementation Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved some code to PNGImageReader.cpp and PNGImageReader.h Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 7ce6aa0faf83c7c6d2ece1ce6cc94ea5d07f7427..fb12ac0cb62037269817fa2c46be66fa7be47dce 100644
--- a/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.h
+++ b/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.h
@@ -45,6 +45,10 @@ class PLATFORM_EXPORT PNGImageDecoder final : public ImageDecoder {
// ImageDecoder:
String filenameExtension() const override { return "png"; }
+ bool frameIsCompleteAtIndex(size_t) const override;
+ float frameDurationAtIndex(size_t) const override;
+ int repetitionCount() const override;
+ size_t clearCacheExceptFrame(size_t) override;
// Callbacks from libpng
void headerAvailable();
@@ -53,16 +57,17 @@ class PLATFORM_EXPORT PNGImageDecoder final : public ImageDecoder {
private:
// ImageDecoder:
- void decodeSize() override { decode(true); }
- void decode(size_t) override { decode(false); }
+ void decodeSize() override { parse(); }
+ void decode(size_t) override;
+ size_t decodeFrameCount() override;
+ void initializeNewFrame(size_t) override;
- // 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);
+ bool initFrameBuffer();
+ bool parse();
std::unique_ptr<PNGImageReader> m_reader;
- const unsigned m_offset;
+ const size_t m_offset;
+ size_t m_currentFrame;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698