Changeset 167356 in webkit
- Timestamp:
- Apr 16, 2014 10:50:57 AM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r167353 r167356 1 2014-04-16 Simon Fraser <simon.fraser@apple.com> 2 3 Convert the boolean param of Image::startAnimation() to an enum 4 https://bugs.webkit.org/show_bug.cgi?id=131742 5 6 Reviewed by Tim Horton. 7 8 Use an enum to make the code more readable. 9 10 * platform/graphics/BitmapImage.cpp: 11 (WebCore::BitmapImage::startAnimation): 12 * platform/graphics/BitmapImage.h: 13 * platform/graphics/Image.cpp: 14 (WebCore::Image::drawTiled): 15 * platform/graphics/Image.h: 16 (WebCore::Image::startAnimation): 17 * svg/graphics/SVGImage.cpp: 18 (WebCore::SVGImage::startAnimation): 19 * svg/graphics/SVGImage.h: 20 1 21 2014-04-16 David Hyatt <hyatt@apple.com> 2 22 -
trunk/Source/WebCore/platform/graphics/BitmapImage.cpp
r166582 r167356 540 540 } 541 541 542 void BitmapImage::startAnimation( boolcatchUpIfNecessary)542 void BitmapImage::startAnimation(CatchUpAnimation catchUpIfNecessary) 543 543 { 544 544 if (m_frameTimer || !shouldAnimate() || frameCount() <= 1) … … 594 594 m_desiredFrameStartTime = time; 595 595 596 if ( !catchUpIfNecessary|| time < m_desiredFrameStartTime) {596 if (catchUpIfNecessary == DoNotCatchUp || time < m_desiredFrameStartTime) { 597 597 // Haven't yet reached time for next frame to start; delay until then. 598 598 m_frameTimer = std::make_unique<Timer<BitmapImage>>(this, &BitmapImage::advanceAnimation); … … 637 637 // as possible, so force startAnimation() to set a zero-delay timer 638 638 // and bail out if we're not caught up. 639 startAnimation( false);639 startAnimation(DoNotCatchUp); 640 640 } 641 641 } -
trunk/Source/WebCore/platform/graphics/BitmapImage.h
r166582 r167356 273 273 int repetitionCount(bool imageKnownToBeComplete); // |imageKnownToBeComplete| should be set if the caller knows the entire image has been decoded. 274 274 bool shouldAnimate(); 275 virtual void startAnimation( bool catchUpIfNecessary = true) override;275 virtual void startAnimation(CatchUpAnimation = CatchUp) override; 276 276 void advanceAnimation(Timer<BitmapImage>&); 277 277 -
trunk/Source/WebCore/platform/graphics/Image.cpp
r166582 r167356 186 186 187 187 #if PLATFORM(IOS) 188 startAnimation( false);188 startAnimation(DoNotCatchUp); 189 189 #else 190 190 startAnimation(); … … 224 224 225 225 #if PLATFORM(IOS) 226 startAnimation( false);226 startAnimation(DoNotCatchUp); 227 227 #else 228 228 startAnimation(); -
trunk/Source/WebCore/platform/graphics/Image.h
r166582 r167356 116 116 // Animation begins whenever someone draws the image, so startAnimation() is not normally called. 117 117 // It will automatically pause once all observers no longer want to render the image anywhere. 118 virtual void startAnimation(bool /*catchUpIfNecessary*/ = true) { } 118 enum CatchUpAnimation { DoNotCatchUp, CatchUp }; 119 virtual void startAnimation(CatchUpAnimation = CatchUp) { } 119 120 virtual void stopAnimation() {} 120 121 virtual void resetAnimation() {} -
trunk/Source/WebCore/svg/graphics/SVGImage.cpp
r166582 r167356 317 317 318 318 // FIXME: support catchUpIfNecessary. 319 void SVGImage::startAnimation( bool /* catchUpIfNecessary */)319 void SVGImage::startAnimation(CatchUpAnimation) 320 320 { 321 321 if (!m_page) -
trunk/Source/WebCore/svg/graphics/SVGImage.h
r166582 r167356 61 61 virtual bool hasRelativeHeight() const override; 62 62 63 virtual void startAnimation( bool /*catchUpIfNecessary*/ = true) override;63 virtual void startAnimation(CatchUpAnimation = CatchUp) override; 64 64 virtual void stopAnimation() override; 65 65 virtual void resetAnimation() override;
Note: See TracChangeset
for help on using the changeset viewer.