Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: third_party/WebKit/Source/platform/graphics/BitmapImage.cpp

Issue 2191533003: Refactor Timer classes in preparation for landing FrameTimers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Android build fix Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698