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

Unified Diff: third_party/gif/SkGifImageReader.h

Issue 2447863002: Report repetition count in SkCodec (Closed)
Patch Set: Make colorTables.gif use a different loop count 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
« no previous file with comments | « tests/CodecAnimTest.cpp ('k') | third_party/gif/SkGifImageReader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/gif/SkGifImageReader.h
diff --git a/third_party/gif/SkGifImageReader.h b/third_party/gif/SkGifImageReader.h
index 5936350681e6509555fb54f86c8889a3e578ea48..2b1b2d942385d402caf986ac1eb61d7cb947525e 100644
--- a/third_party/gif/SkGifImageReader.h
+++ b/third_party/gif/SkGifImageReader.h
@@ -298,8 +298,6 @@ public:
{
}
- static constexpr int cLoopCountNotSeen = -2;
-
~SkGifImageReader()
{
}
@@ -317,6 +315,8 @@ public:
SkGIFSizeQuery = -1,
// Parse to the end, so we know about all frames.
SkGIFFrameCountQuery = -2,
+ // Parse until we see the loop count.
+ SkGIFLoopCountQuery = -3,
};
// Parse incoming GIF data stream into internal data structures.
@@ -340,7 +340,12 @@ public:
// FIXME: This extra complexity is not necessary and we should just report m_frames.size().
return m_frames.back()->isHeaderDefined() ? m_frames.size() : m_frames.size() - 1;
}
- int loopCount() const { return m_loopCount; }
+ int loopCount() const {
+ if (cLoopCountNotSeen == m_loopCount) {
+ return 0;
+ }
+ return m_loopCount;
+ }
const SkGIFColorMap& globalColorMap() const
{
@@ -389,6 +394,8 @@ private:
unsigned m_screenWidth; // Logical screen width & height.
unsigned m_screenHeight;
SkGIFColorMap m_globalColorMap;
+
+ static constexpr int cLoopCountNotSeen = -2;
int m_loopCount; // Netscape specific extension block to control the number of animation loops a GIF renders.
std::vector<std::unique_ptr<SkGIFFrameContext>> m_frames;
« no previous file with comments | « tests/CodecAnimTest.cpp ('k') | third_party/gif/SkGifImageReader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698