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

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

Issue 1312843006: Animated PNG implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 months 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
« no previous file with comments | « Source/platform/image-decoders/ImageFrame.h ('k') | Source/platform/image-decoders/png/PNGImageDecoder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/image-decoders/png/PNGImageDecoder.h
diff --git a/Source/platform/image-decoders/png/PNGImageDecoder.h b/Source/platform/image-decoders/png/PNGImageDecoder.h
index 7f54c2e360725981b96c9c96ce4cb6b331a77995..9ed6ebfc93d1d14dcb5b0d1cbed66dc8ffa8b197 100644
--- a/Source/platform/image-decoders/png/PNGImageDecoder.h
+++ b/Source/platform/image-decoders/png/PNGImageDecoder.h
@@ -43,6 +43,10 @@ public:
// ImageDecoder:
String filenameExtension() const override { return "png"; }
bool hasColorProfile() const override { return m_hasColorProfile; }
+ 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();
@@ -51,16 +55,17 @@ public:
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();
OwnPtr<PNGImageReader> m_reader;
bool m_hasColorProfile;
+ size_t m_currentFrame;
};
} // namespace blink
« no previous file with comments | « Source/platform/image-decoders/ImageFrame.h ('k') | Source/platform/image-decoders/png/PNGImageDecoder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698