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

Side by Side Diff: third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp

Issue 1780463007: WebP animation: Loop once more than stored loop count. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gif_loop_fix
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoderTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 m_formatFlags = WebPDemuxGetI(m_demux, WEBP_FF_FORMAT_FLAGS); 220 m_formatFlags = WebPDemuxGetI(m_demux, WEBP_FF_FORMAT_FLAGS);
221 if (!(m_formatFlags & ANIMATION_FLAG)) { 221 if (!(m_formatFlags & ANIMATION_FLAG)) {
222 m_repetitionCount = cAnimationNone; 222 m_repetitionCount = cAnimationNone;
223 } else { 223 } else {
224 // Since we have parsed at least one frame, even if partially, 224 // Since we have parsed at least one frame, even if partially,
225 // the global animation (ANIM) properties have been read since 225 // the global animation (ANIM) properties have been read since
226 // an ANIM chunk must precede the ANMF frame chunks. 226 // an ANIM chunk must precede the ANMF frame chunks.
227 m_repetitionCount = WebPDemuxGetI(m_demux, WEBP_FF_LOOP_COUNT); 227 m_repetitionCount = WebPDemuxGetI(m_demux, WEBP_FF_LOOP_COUNT);
228 // Repetition count is always <= 16 bits. 228 // Repetition count is always <= 16 bits.
229 ASSERT(m_repetitionCount == (m_repetitionCount & 0xffff)); 229 ASSERT(m_repetitionCount == (m_repetitionCount & 0xffff));
230 // Repetition count is the number of animation cycles to show, 230 if (!m_repetitionCount)
231 // where 0 means "infinite". But ImageSource::repetitionCount() 231 m_repetitionCount = cAnimationLoopInfinite;
232 // returns -1 for "infinite", and 0 and up for "show the image
233 // animation one cycle more than the value". Subtract one here
234 // to correctly handle the finite and infinite cases.
235 --m_repetitionCount;
236 // FIXME: Implement ICC profile support for animated images. 232 // FIXME: Implement ICC profile support for animated images.
237 m_formatFlags &= ~ICCP_FLAG; 233 m_formatFlags &= ~ICCP_FLAG;
238 } 234 }
239 235
240 #if USE(QCMSLIB) 236 #if USE(QCMSLIB)
241 if ((m_formatFlags & ICCP_FLAG) && !ignoresGammaAndColorProfile()) 237 if ((m_formatFlags & ICCP_FLAG) && !ignoresGammaAndColorProfile())
242 readColorProfile(); 238 readColorProfile();
243 #endif 239 #endif
244 } 240 }
245 241
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 return false; 552 return false;
557 } 553 }
558 // FALLTHROUGH 554 // FALLTHROUGH
559 default: 555 default:
560 clear(); 556 clear();
561 return setFailed(); 557 return setFailed();
562 } 558 }
563 } 559 }
564 560
565 } // namespace blink 561 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698