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

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

Issue 1362973004: Rename FROM_HERE to BLINK_FROM_HERE. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 5 years, 2 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 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 // the other hand, it makes animations "less accurate" for pages that try to 534 // the other hand, it makes animations "less accurate" for pages that try to
535 // sync an image and some other resource (e.g. audio), especially if users 535 // sync an image and some other resource (e.g. audio), especially if users
536 // switch tabs (and thus stop drawing the animation, which will pause it) 536 // switch tabs (and thus stop drawing the animation, which will pause it)
537 // during that initial loop, then switch back later. 537 // during that initial loop, then switch back later.
538 if (nextFrame == 0 && m_repetitionsComplete == 0 && m_desiredFrameStartTime < time) 538 if (nextFrame == 0 && m_repetitionsComplete == 0 && m_desiredFrameStartTime < time)
539 m_desiredFrameStartTime = time; 539 m_desiredFrameStartTime = time;
540 540
541 if (catchUpIfNecessary == DoNotCatchUp || time < m_desiredFrameStartTime) { 541 if (catchUpIfNecessary == DoNotCatchUp || time < m_desiredFrameStartTime) {
542 // Haven't yet reached time for next frame to start; delay until then. 542 // Haven't yet reached time for next frame to start; delay until then.
543 m_frameTimer = adoptPtr(new Timer<BitmapImage>(this, &BitmapImage::advan ceAnimation)); 543 m_frameTimer = adoptPtr(new Timer<BitmapImage>(this, &BitmapImage::advan ceAnimation));
544 m_frameTimer->startOneShot(std::max(m_desiredFrameStartTime - time, 0.), FROM_HERE); 544 m_frameTimer->startOneShot(std::max(m_desiredFrameStartTime - time, 0.), BLINK_FROM_HERE);
545 } else { 545 } else {
546 // We've already reached or passed the time for the next frame to start. 546 // We've already reached or passed the time for the next frame to start.
547 // See if we've also passed the time for frames after that to start, in 547 // See if we've also passed the time for frames after that to start, in
548 // case we need to skip some frames entirely. Remember not to advance 548 // case we need to skip some frames entirely. Remember not to advance
549 // to an incomplete frame. 549 // to an incomplete frame.
550 for (size_t frameAfterNext = (nextFrame + 1) % frameCount(); frameIsComp leteAtIndex(frameAfterNext); frameAfterNext = (nextFrame + 1) % frameCount()) { 550 for (size_t frameAfterNext = (nextFrame + 1) % frameCount(); frameIsComp leteAtIndex(frameAfterNext); frameAfterNext = (nextFrame + 1) % frameCount()) {
551 // Should we skip the next frame? 551 // Should we skip the next frame?
552 double frameAfterNextStartTime = m_desiredFrameStartTime + frameDura tionAtIndex(nextFrame); 552 double frameAfterNextStartTime = m_desiredFrameStartTime + frameDura tionAtIndex(nextFrame);
553 if (time < frameAfterNextStartTime) 553 if (time < frameAfterNextStartTime)
554 break; 554 break;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 destroyDecodedDataIfNecessary(); 663 destroyDecodedDataIfNecessary();
664 664
665 // We need to draw this frame if we advanced to it while not skipping, or if 665 // We need to draw this frame if we advanced to it while not skipping, or if
666 // while trying to skip frames we hit the last frame and thus had to stop. 666 // while trying to skip frames we hit the last frame and thus had to stop.
667 if (skippingFrames != advancedAnimation) 667 if (skippingFrames != advancedAnimation)
668 imageObserver()->animationAdvanced(this); 668 imageObserver()->animationAdvanced(this);
669 return advancedAnimation; 669 return advancedAnimation;
670 } 670 }
671 671
672 } // namespace blink 672 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698