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

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

Issue 2259083003: Remove redundant bitmap animation loop check: m_repetitionsComplete (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698