| 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 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 } | 557 } |
| 558 | 558 |
| 559 void BitmapImage::advanceTime(double deltaTimeInSeconds) | 559 void BitmapImage::advanceTime(double deltaTimeInSeconds) |
| 560 { | 560 { |
| 561 if (m_desiredFrameStartTime) | 561 if (m_desiredFrameStartTime) |
| 562 m_desiredFrameStartTime -= deltaTimeInSeconds; | 562 m_desiredFrameStartTime -= deltaTimeInSeconds; |
| 563 else | 563 else |
| 564 m_desiredFrameStartTime = monotonicallyIncreasingTime() - deltaTimeInSec
onds; | 564 m_desiredFrameStartTime = monotonicallyIncreasingTime() - deltaTimeInSec
onds; |
| 565 } | 565 } |
| 566 | 566 |
| 567 void BitmapImage::advanceAnimation(Timer<BitmapImage>*) | 567 void BitmapImage::advanceAnimation(TimerBase*) |
| 568 { | 568 { |
| 569 internalAdvanceAnimation(false); | 569 internalAdvanceAnimation(false); |
| 570 // At this point the image region has been marked dirty, and if it's | 570 // At this point the image region has been marked dirty, and if it's |
| 571 // onscreen, we'll soon make a call to draw(), which will call | 571 // onscreen, we'll soon make a call to draw(), which will call |
| 572 // startAnimation() again to keep the animation moving. | 572 // startAnimation() again to keep the animation moving. |
| 573 } | 573 } |
| 574 | 574 |
| 575 void BitmapImage::advanceAnimationWithoutCatchUp(Timer<BitmapImage>*) | 575 void BitmapImage::advanceAnimationWithoutCatchUp(TimerBase*) |
| 576 { | 576 { |
| 577 if (internalAdvanceAnimation(false)) | 577 if (internalAdvanceAnimation(false)) |
| 578 startAnimation(DoNotCatchUp); | 578 startAnimation(DoNotCatchUp); |
| 579 } | 579 } |
| 580 | 580 |
| 581 bool BitmapImage::internalAdvanceAnimation(bool skippingFrames) | 581 bool BitmapImage::internalAdvanceAnimation(bool skippingFrames) |
| 582 { | 582 { |
| 583 // Stop the animation. | 583 // Stop the animation. |
| 584 stopAnimation(); | 584 stopAnimation(); |
| 585 | 585 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 610 | 610 |
| 611 // We need to draw this frame if we advanced to it while not skipping, or if | 611 // We need to draw this frame if we advanced to it while not skipping, or if |
| 612 // while trying to skip frames we hit the last frame and thus had to stop. | 612 // while trying to skip frames we hit the last frame and thus had to stop. |
| 613 if (skippingFrames != advancedAnimation) | 613 if (skippingFrames != advancedAnimation) |
| 614 getImageObserver()->animationAdvanced(this); | 614 getImageObserver()->animationAdvanced(this); |
| 615 | 615 |
| 616 return advancedAnimation; | 616 return advancedAnimation; |
| 617 } | 617 } |
| 618 | 618 |
| 619 } // namespace blink | 619 } // namespace blink |
| OLD | NEW |