| 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 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 } | 755 } |
| 756 ASSERT(m_compositorGroup != 0); | 756 ASSERT(m_compositorGroup != 0); |
| 757 return toKeyframeEffect(m_content.get())->maybeStartAnimationOnCompositor(m_
compositorGroup, startTime, timeOffset, m_playbackRate); | 757 return toKeyframeEffect(m_content.get())->maybeStartAnimationOnCompositor(m_
compositorGroup, startTime, timeOffset, m_playbackRate); |
| 758 } | 758 } |
| 759 | 759 |
| 760 void Animation::setCompositorPending(bool effectChanged) | 760 void Animation::setCompositorPending(bool effectChanged) |
| 761 { | 761 { |
| 762 // FIXME: KeyframeEffect could notify this directly? | 762 // FIXME: KeyframeEffect could notify this directly? |
| 763 if (!hasActiveAnimationsOnCompositor()) { | 763 if (!hasActiveAnimationsOnCompositor()) { |
| 764 destroyCompositorPlayer(); | 764 destroyCompositorPlayer(); |
| 765 m_compositorState.clear(); | 765 m_compositorState.reset(); |
| 766 } | 766 } |
| 767 if (effectChanged && m_compositorState) { | 767 if (effectChanged && m_compositorState) { |
| 768 m_compositorState->effectChanged = true; | 768 m_compositorState->effectChanged = true; |
| 769 } | 769 } |
| 770 if (m_compositorPending || m_isPausedForTesting) { | 770 if (m_compositorPending || m_isPausedForTesting) { |
| 771 return; | 771 return; |
| 772 } | 772 } |
| 773 if (!m_compositorState || m_compositorState->effectChanged | 773 if (!m_compositorState || m_compositorState->effectChanged |
| 774 || m_compositorState->playbackRate != m_playbackRate | 774 || m_compositorState->playbackRate != m_playbackRate |
| 775 || m_compositorState->startTime != m_startTime) { | 775 || m_compositorState->startTime != m_startTime) { |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 912 attachCompositedLayers(); | 912 attachCompositedLayers(); |
| 913 } | 913 } |
| 914 | 914 |
| 915 void Animation::destroyCompositorPlayer() | 915 void Animation::destroyCompositorPlayer() |
| 916 { | 916 { |
| 917 detachCompositedLayers(); | 917 detachCompositedLayers(); |
| 918 | 918 |
| 919 if (m_compositorPlayer) { | 919 if (m_compositorPlayer) { |
| 920 detachCompositorTimeline(); | 920 detachCompositorTimeline(); |
| 921 m_compositorPlayer->setAnimationDelegate(nullptr); | 921 m_compositorPlayer->setAnimationDelegate(nullptr); |
| 922 m_compositorPlayer.clear(); | 922 m_compositorPlayer.reset(); |
| 923 } | 923 } |
| 924 } | 924 } |
| 925 | 925 |
| 926 void Animation::attachCompositorTimeline() | 926 void Animation::attachCompositorTimeline() |
| 927 { | 927 { |
| 928 if (m_compositorPlayer) { | 928 if (m_compositorPlayer) { |
| 929 CompositorAnimationTimeline* timeline = m_timeline ? m_timeline->composi
torTimeline() : nullptr; | 929 CompositorAnimationTimeline* timeline = m_timeline ? m_timeline->composi
torTimeline() : nullptr; |
| 930 if (timeline) | 930 if (timeline) |
| 931 timeline->playerAttached(*this); | 931 timeline->playerAttached(*this); |
| 932 } | 932 } |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1085 visitor->trace(m_timeline); | 1085 visitor->trace(m_timeline); |
| 1086 visitor->trace(m_pendingFinishedEvent); | 1086 visitor->trace(m_pendingFinishedEvent); |
| 1087 visitor->trace(m_pendingCancelledEvent); | 1087 visitor->trace(m_pendingCancelledEvent); |
| 1088 visitor->trace(m_finishedPromise); | 1088 visitor->trace(m_finishedPromise); |
| 1089 visitor->trace(m_readyPromise); | 1089 visitor->trace(m_readyPromise); |
| 1090 EventTargetWithInlineData::trace(visitor); | 1090 EventTargetWithInlineData::trace(visitor); |
| 1091 ActiveDOMObject::trace(visitor); | 1091 ActiveDOMObject::trace(visitor); |
| 1092 } | 1092 } |
| 1093 | 1093 |
| 1094 } // namespace blink | 1094 } // namespace blink |
| OLD | NEW |