OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // | 99 // |
100 // Second, a GIF might never set a loop count at all, in which case we | 100 // Second, a GIF might never set a loop count at all, in which case we |
101 // should continue to treat it as a "loop once" animation. We don't need | 101 // should continue to treat it as a "loop once" animation. We don't need |
102 // special code here either, because in this case we'll never change | 102 // special code here either, because in this case we'll never change |
103 // |m_repetitionCount| from its default value. | 103 // |m_repetitionCount| from its default value. |
104 // | 104 // |
105 // Third, we use the same GIFImageReader for counting frames and we might | 105 // Third, we use the same GIFImageReader for counting frames and we might |
106 // see the loop count and then encounter a decoding error which happens | 106 // see the loop count and then encounter a decoding error which happens |
107 // later in the stream. It is also possible that no frames are in the | 107 // later in the stream. It is also possible that no frames are in the |
108 // stream. In these cases we should just loop once. | 108 // stream. In these cases we should just loop once. |
109 if (failed() || (m_reader && (!m_reader->imagesCount() || m_reader->parseFai
led()))) | 109 if (failed() || (m_reader && (!m_reader->imagesCount()))) |
110 m_repetitionCount = cAnimationLoopOnce; | 110 m_repetitionCount = cAnimationLoopOnce; |
111 else if (m_reader && m_reader->loopCount() != cLoopCountNotSeen) | 111 else if (m_reader && m_reader->loopCount() != cLoopCountNotSeen) |
112 m_repetitionCount = m_reader->loopCount(); | 112 m_repetitionCount = m_reader->loopCount(); |
113 return m_repetitionCount; | 113 return m_repetitionCount; |
114 } | 114 } |
115 | 115 |
116 ImageFrame* GIFImageDecoder::frameBufferAtIndex(size_t index) | 116 ImageFrame* GIFImageDecoder::frameBufferAtIndex(size_t index) |
117 { | 117 { |
118 if (index >= frameCount()) | 118 if (index >= frameCount()) |
119 return 0; | 119 return 0; |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 | 411 |
412 // Update our status to be partially complete. | 412 // Update our status to be partially complete. |
413 buffer->setStatus(ImageFrame::FramePartial); | 413 buffer->setStatus(ImageFrame::FramePartial); |
414 | 414 |
415 // Reset the alpha pixel tracker for this frame. | 415 // Reset the alpha pixel tracker for this frame. |
416 m_currentBufferSawAlpha = false; | 416 m_currentBufferSawAlpha = false; |
417 return true; | 417 return true; |
418 } | 418 } |
419 | 419 |
420 } // namespace WebCore | 420 } // namespace WebCore |
OLD | NEW |