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 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 } | 847 } |
848 | 848 |
849 void AnimationPlayer::endUpdatingState() | 849 void AnimationPlayer::endUpdatingState() |
850 { | 850 { |
851 ASSERT(m_stateIsBeingUpdated); | 851 ASSERT(m_stateIsBeingUpdated); |
852 m_stateIsBeingUpdated = false; | 852 m_stateIsBeingUpdated = false; |
853 } | 853 } |
854 | 854 |
855 void AnimationPlayer::createCompositorPlayer() | 855 void AnimationPlayer::createCompositorPlayer() |
856 { | 856 { |
857 if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled() && !m_comp
ositorPlayer && Platform::current()->compositorSupport()) { | 857 if (!m_compositorPlayer) { |
858 m_compositorPlayer = adoptPtr(Platform::current()->compositorSupport()->
createAnimationPlayer()); | 858 m_compositorPlayer = adoptPtr(Platform::current()->compositorSupport()->
createAnimationPlayer()); |
859 ASSERT(m_compositorPlayer); | 859 ASSERT(m_compositorPlayer); |
860 m_compositorPlayer->setAnimationDelegate(this); | 860 m_compositorPlayer->setAnimationDelegate(this); |
861 attachCompositorTimeline(); | 861 attachCompositorTimeline(); |
862 } | 862 } |
863 | 863 |
864 attachCompositedLayers(); | 864 attachCompositedLayers(); |
865 } | 865 } |
866 | 866 |
867 void AnimationPlayer::destroyCompositorPlayer() | 867 void AnimationPlayer::destroyCompositorPlayer() |
(...skipping 20 matching lines...) Expand all Loading... |
888 { | 888 { |
889 if (m_compositorPlayer) { | 889 if (m_compositorPlayer) { |
890 WebCompositorAnimationTimeline* timeline = m_timeline ? m_timeline->comp
ositorTimeline() : nullptr; | 890 WebCompositorAnimationTimeline* timeline = m_timeline ? m_timeline->comp
ositorTimeline() : nullptr; |
891 if (timeline) | 891 if (timeline) |
892 timeline->playerDestroyed(*this); | 892 timeline->playerDestroyed(*this); |
893 } | 893 } |
894 } | 894 } |
895 | 895 |
896 void AnimationPlayer::attachCompositedLayers() | 896 void AnimationPlayer::attachCompositedLayers() |
897 { | 897 { |
898 if (!RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled() || !m_com
positorPlayer) | 898 if (!m_compositorPlayer) |
899 return; | 899 return; |
900 | 900 |
901 ASSERT(m_content); | 901 ASSERT(m_content); |
902 ASSERT(m_content->isAnimation()); | 902 ASSERT(m_content->isAnimation()); |
903 | 903 |
904 if (toAnimation(m_content.get())->canAttachCompositedLayers()) | 904 if (toAnimation(m_content.get())->canAttachCompositedLayers()) |
905 toAnimation(m_content.get())->attachCompositedLayers(); | 905 toAnimation(m_content.get())->attachCompositedLayers(); |
906 } | 906 } |
907 | 907 |
908 void AnimationPlayer::detachCompositedLayers() | 908 void AnimationPlayer::detachCompositedLayers() |
909 { | 909 { |
910 if (m_compositorPlayer && m_compositorPlayer->isLayerAttached()) | 910 if (m_compositorPlayer && m_compositorPlayer->isLayerAttached()) |
911 m_compositorPlayer->detachLayer(); | 911 m_compositorPlayer->detachLayer(); |
912 } | 912 } |
913 | 913 |
914 void AnimationPlayer::notifyAnimationStarted(double monotonicTime, int group) | 914 void AnimationPlayer::notifyAnimationStarted(double monotonicTime, int group) |
915 { | 915 { |
916 ASSERT(RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()); | |
917 timeline()->document()->compositorPendingAnimations().notifyCompositorAnimat
ionStarted(monotonicTime, group); | 916 timeline()->document()->compositorPendingAnimations().notifyCompositorAnimat
ionStarted(monotonicTime, group); |
918 } | 917 } |
919 | 918 |
920 AnimationPlayer::PlayStateUpdateScope::PlayStateUpdateScope(AnimationPlayer& pla
yer, TimingUpdateReason reason, CompositorPendingChange compositorPendingChange) | 919 AnimationPlayer::PlayStateUpdateScope::PlayStateUpdateScope(AnimationPlayer& pla
yer, TimingUpdateReason reason, CompositorPendingChange compositorPendingChange) |
921 : m_player(player) | 920 : m_player(player) |
922 , m_initialPlayState(m_player->playStateInternal()) | 921 , m_initialPlayState(m_player->playStateInternal()) |
923 , m_compositorPendingChange(compositorPendingChange) | 922 , m_compositorPendingChange(compositorPendingChange) |
924 { | 923 { |
925 m_player->beginUpdatingState(); | 924 m_player->beginUpdatingState(); |
926 m_player->updateCurrentTimingState(reason); | 925 m_player->updateCurrentTimingState(reason); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1023 visitor->trace(m_content); | 1022 visitor->trace(m_content); |
1024 visitor->trace(m_timeline); | 1023 visitor->trace(m_timeline); |
1025 visitor->trace(m_pendingFinishedEvent); | 1024 visitor->trace(m_pendingFinishedEvent); |
1026 visitor->trace(m_finishedPromise); | 1025 visitor->trace(m_finishedPromise); |
1027 visitor->trace(m_readyPromise); | 1026 visitor->trace(m_readyPromise); |
1028 EventTargetWithInlineData::trace(visitor); | 1027 EventTargetWithInlineData::trace(visitor); |
1029 ActiveDOMObject::trace(visitor); | 1028 ActiveDOMObject::trace(visitor); |
1030 } | 1029 } |
1031 | 1030 |
1032 } // namespace | 1031 } // namespace |
OLD | NEW |