| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |