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

Side by Side Diff: third_party/gif/SkGifImageReader.cpp

Issue 2447863002: Report repetition count in SkCodec (Closed)
Patch Set: 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 unified diff | Download patch
« include/codec/SkCodec.h ('K') | « third_party/gif/SkGifImageReader.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK ***** 2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 * 4 *
5 * The contents of this file are subject to the Mozilla Public License Version 5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with 6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at 7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/ 8 * http://www.mozilla.org/MPL/
9 * 9 *
10 * Software distributed under the License is distributed on an "AS IS" basis, 10 * Software distributed under the License is distributed on an "AS IS" basis,
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 reinterpret_cast<const unsigned char*>(m_streamBuffer.get()); 655 reinterpret_cast<const unsigned char*>(m_streamBuffer.get());
656 656
657 int netscapeExtension = currentComponent[0] & 7; 657 int netscapeExtension = currentComponent[0] & 7;
658 658
659 // Loop entire animation specified # of times. Only read the loop co unt during the first iteration. 659 // Loop entire animation specified # of times. Only read the loop co unt during the first iteration.
660 if (netscapeExtension == 1) { 660 if (netscapeExtension == 1) {
661 m_loopCount = GETINT16(currentComponent + 1); 661 m_loopCount = GETINT16(currentComponent + 1);
662 662
663 // Zero loop count is infinite animation loop request. 663 // Zero loop count is infinite animation loop request.
664 if (!m_loopCount) 664 if (!m_loopCount)
665 m_loopCount = SkCodecAnimation::kAnimationLoopInfinite; 665 m_loopCount = SkCodec::kRepetitionCountInfinite;
666 666
667 GETN(1, GIFNetscapeExtensionBlock); 667 GETN(1, GIFNetscapeExtensionBlock);
668 } else if (netscapeExtension == 2) { 668 } else if (netscapeExtension == 2) {
669 // Wait for specified # of bytes to enter buffer. 669 // Wait for specified # of bytes to enter buffer.
670 670
671 // Don't do this, this extension doesn't exist (isn't used at al l) 671 // Don't do this, this extension doesn't exist (isn't used at al l)
672 // and doesn't do anything, as our streaming/buffering takes car e of it all... 672 // and doesn't do anything, as our streaming/buffering takes car e of it all...
673 // See: http://semmix.pl/color/exgraf/eeg24.htm 673 // See: http://semmix.pl/color/exgraf/eeg24.htm
674 GETN(1, GIFNetscapeExtensionBlock); 674 GETN(1, GIFNetscapeExtensionBlock);
675 } else { 675 } else {
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 rowsRemaining = m_frameContext->height(); 932 rowsRemaining = m_frameContext->height();
933 933
934 // Clearing the whole suffix table lets us be more tolerant of bad data. 934 // Clearing the whole suffix table lets us be more tolerant of bad data.
935 for (int i = 0; i < clearCode; ++i) { 935 for (int i = 0; i < clearCode; ++i) {
936 suffix[i] = i; 936 suffix[i] = i;
937 suffixLength[i] = 1; 937 suffixLength[i] = 1;
938 } 938 }
939 return true; 939 return true;
940 } 940 }
941 941
OLDNEW
« include/codec/SkCodec.h ('K') | « third_party/gif/SkGifImageReader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698