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

Side by Side Diff: Source/core/animation/AnimationPlayer.cpp

Issue 649563003: Web Animations: Compositor timeOffset should be sensitive to playback rate (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « ManualTests/animation/compositor-reverse.html ('k') | 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 } 616 }
617 617
618 bool AnimationPlayer::maybeStartAnimationOnCompositor() 618 bool AnimationPlayer::maybeStartAnimationOnCompositor()
619 { 619 {
620 if (!canStartAnimationOnCompositor()) 620 if (!canStartAnimationOnCompositor())
621 return false; 621 return false;
622 622
623 double startTime = timeline()->zeroTime() + startTimeInternal(); 623 double startTime = timeline()->zeroTime() + startTimeInternal();
624 double timeOffset = 0; 624 double timeOffset = 0;
625 if (std::isnan(startTime)) { 625 if (std::isnan(startTime)) {
626 timeOffset = currentTimeInternal(); 626 timeOffset = m_playbackRate < 0 ? sourceEnd() - currentTimeInternal() : currentTimeInternal();
627 } 627 }
628 return toAnimation(m_content.get())->maybeStartAnimationOnCompositor(startTi me, timeOffset, m_playbackRate); 628 return toAnimation(m_content.get())->maybeStartAnimationOnCompositor(startTi me, timeOffset, m_playbackRate);
629 } 629 }
630 630
631 void AnimationPlayer::setCompositorPending(bool sourceChanged) 631 void AnimationPlayer::setCompositorPending(bool sourceChanged)
632 { 632 {
633 // FIXME: Animation could notify this directly? 633 // FIXME: Animation could notify this directly?
634 if (!hasActiveAnimationsOnCompositor()) { 634 if (!hasActiveAnimationsOnCompositor()) {
635 m_compositorState.release(); 635 m_compositorState.release();
636 } 636 }
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 801
802 void AnimationPlayer::trace(Visitor* visitor) 802 void AnimationPlayer::trace(Visitor* visitor)
803 { 803 {
804 visitor->trace(m_content); 804 visitor->trace(m_content);
805 visitor->trace(m_timeline); 805 visitor->trace(m_timeline);
806 visitor->trace(m_pendingFinishedEvent); 806 visitor->trace(m_pendingFinishedEvent);
807 EventTargetWithInlineData::trace(visitor); 807 EventTargetWithInlineData::trace(visitor);
808 } 808 }
809 809
810 } // namespace 810 } // namespace
OLDNEW
« no previous file with comments | « ManualTests/animation/compositor-reverse.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698