| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 bool advancedAnimation = true; | 599 bool advancedAnimation = true; |
| 600 if (m_currentFrame >= frameCount()) { | 600 if (m_currentFrame >= frameCount()) { |
| 601 ++m_repetitionsComplete; | 601 ++m_repetitionsComplete; |
| 602 | 602 |
| 603 // Get the repetition count again. If we weren't able to get a | 603 // Get the repetition count again. If we weren't able to get a |
| 604 // repetition count before, we should have decoded the whole image by | 604 // repetition count before, we should have decoded the whole image by |
| 605 // now, so it should now be available. | 605 // now, so it should now be available. |
| 606 // Note that we don't need to special-case cAnimationLoopOnce here | 606 // Note that we don't need to special-case cAnimationLoopOnce here |
| 607 // because it is 0 (see comments on its declaration in ImageAnimation.h)
. | 607 // because it is 0 (see comments on its declaration in ImageAnimation.h)
. |
| 608 if ((repetitionCount(true) != cAnimationLoopInfinite && m_repetitionsCom
plete > m_repetitionCount) | 608 if ((repetitionCount(true) != cAnimationLoopInfinite && m_repetitionsCom
plete > m_repetitionCount) |
| 609 || (m_animationPolicy == ImageAnimationPolicyAnimateOnce && m_repeti
tionsComplete > 0)) { | 609 || m_animationPolicy == ImageAnimationPolicyAnimateOnce) { |
| 610 m_animationFinished = true; | 610 m_animationFinished = true; |
| 611 m_desiredFrameStartTime = 0; | 611 m_desiredFrameStartTime = 0; |
| 612 --m_currentFrame; | 612 --m_currentFrame; |
| 613 advancedAnimation = false; | 613 advancedAnimation = false; |
| 614 } else | 614 } else |
| 615 m_currentFrame = 0; | 615 m_currentFrame = 0; |
| 616 } | 616 } |
| 617 | 617 |
| 618 // We need to draw this frame if we advanced to it while not skipping, or if | 618 // We need to draw this frame if we advanced to it while not skipping, or if |
| 619 // while trying to skip frames we hit the last frame and thus had to stop. | 619 // while trying to skip frames we hit the last frame and thus had to stop. |
| 620 if (skippingFrames != advancedAnimation) | 620 if (skippingFrames != advancedAnimation) |
| 621 getImageObserver()->animationAdvanced(this); | 621 getImageObserver()->animationAdvanced(this); |
| 622 | 622 |
| 623 return advancedAnimation; | 623 return advancedAnimation; |
| 624 } | 624 } |
| 625 | 625 |
| 626 } // namespace blink | 626 } // namespace blink |
| OLD | NEW |