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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 // the count again once the whole image is decoded. | 430 // the count again once the whole image is decoded. |
431 m_repetitionCount = m_source.repetitionCount(); | 431 m_repetitionCount = m_source.repetitionCount(); |
432 m_repetitionCountStatus = (imageKnownToBeComplete || m_repetitionCount =
= cAnimationNone) ? Certain : Uncertain; | 432 m_repetitionCountStatus = (imageKnownToBeComplete || m_repetitionCount =
= cAnimationNone) ? Certain : Uncertain; |
433 } | 433 } |
434 return m_repetitionCount; | 434 return m_repetitionCount; |
435 } | 435 } |
436 | 436 |
437 bool BitmapImage::shouldAnimate() | 437 bool BitmapImage::shouldAnimate() |
438 { | 438 { |
439 bool animated = repetitionCount(false) != cAnimationNone && !m_animationFini
shed && imageObserver(); | 439 bool animated = repetitionCount(false) != cAnimationNone && !m_animationFini
shed && imageObserver(); |
440 if (imageObserver()) { | 440 if (animated && m_animationPolicy == ImageAnimationPolicyNoAnimation) |
441 ImageAnimationPolicy oldPolicy = m_animationPolicy; | 441 animated = false; |
442 imageObserver()->imageAnimationPolicy(this, m_animationPolicy); | |
443 if (oldPolicy != m_animationPolicy) | |
444 resetAnimation(); | |
445 if (animated && m_animationPolicy == ImageAnimationPolicyNoAnimation) | |
446 animated = false; | |
447 } | |
448 return animated; | 442 return animated; |
449 } | 443 } |
450 | 444 |
451 void BitmapImage::startAnimation(CatchUpAnimation catchUpIfNecessary) | 445 void BitmapImage::startAnimation(CatchUpAnimation catchUpIfNecessary) |
452 { | 446 { |
453 if (m_frameTimer || !shouldAnimate() || frameCount() <= 1) | 447 if (m_frameTimer || !shouldAnimate() || frameCount() <= 1) |
454 return; | 448 return; |
455 | 449 |
456 // If we aren't already animating, set now as the animation start time. | 450 // If we aren't already animating, set now as the animation start time. |
457 const double time = monotonicallyIncreasingTime(); | 451 const double time = monotonicallyIncreasingTime(); |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 | 645 |
652 return m_isSolidColor && !m_currentFrame; | 646 return m_isSolidColor && !m_currentFrame; |
653 } | 647 } |
654 | 648 |
655 Color BitmapImage::solidColor() const | 649 Color BitmapImage::solidColor() const |
656 { | 650 { |
657 return m_solidColor; | 651 return m_solidColor; |
658 } | 652 } |
659 | 653 |
660 } // namespace blink | 654 } // namespace blink |
OLD | NEW |