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

Side by Side Diff: third_party/WebKit/Source/core/animation/Animation.cpp

Issue 1739743003: Blink Compositor Animation: Erase old animation system. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation. Created 4 years, 9 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) 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 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 } 897 }
898 898
899 void Animation::endUpdatingState() 899 void Animation::endUpdatingState()
900 { 900 {
901 ASSERT(m_stateIsBeingUpdated); 901 ASSERT(m_stateIsBeingUpdated);
902 m_stateIsBeingUpdated = false; 902 m_stateIsBeingUpdated = false;
903 } 903 }
904 904
905 void Animation::createCompositorPlayer() 905 void Animation::createCompositorPlayer()
906 { 906 {
907 if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled() && Platfor m::current()->isThreadedAnimationEnabled() && !m_compositorPlayer) { 907 if (Platform::current()->isThreadedAnimationEnabled() && !m_compositorPlayer ) {
908 ASSERT(Platform::current()->compositorSupport()); 908 ASSERT(Platform::current()->compositorSupport());
909 m_compositorPlayer = adoptPtr(CompositorFactory::current().createAnimati onPlayer()); 909 m_compositorPlayer = adoptPtr(CompositorFactory::current().createAnimati onPlayer());
910 ASSERT(m_compositorPlayer); 910 ASSERT(m_compositorPlayer);
911 m_compositorPlayer->setAnimationDelegate(this); 911 m_compositorPlayer->setAnimationDelegate(this);
912 attachCompositorTimeline(); 912 attachCompositorTimeline();
913 } 913 }
914 914
915 attachCompositedLayers(); 915 attachCompositedLayers();
916 } 916 }
917 917
(...skipping 21 matching lines...) Expand all
939 { 939 {
940 if (m_compositorPlayer) { 940 if (m_compositorPlayer) {
941 CompositorAnimationTimeline* timeline = m_timeline ? m_timeline->composi torTimeline() : nullptr; 941 CompositorAnimationTimeline* timeline = m_timeline ? m_timeline->composi torTimeline() : nullptr;
942 if (timeline) 942 if (timeline)
943 timeline->playerDestroyed(*this); 943 timeline->playerDestroyed(*this);
944 } 944 }
945 } 945 }
946 946
947 void Animation::attachCompositedLayers() 947 void Animation::attachCompositedLayers()
948 { 948 {
949 if (!RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled() || !m_com positorPlayer) 949 if (!m_compositorPlayer)
950 return; 950 return;
951 951
952 ASSERT(m_content); 952 ASSERT(m_content);
953 ASSERT(m_content->isKeyframeEffect()); 953 ASSERT(m_content->isKeyframeEffect());
954 954
955 if (toKeyframeEffect(m_content.get())->canAttachCompositedLayers()) 955 if (toKeyframeEffect(m_content.get())->canAttachCompositedLayers())
956 toKeyframeEffect(m_content.get())->attachCompositedLayers(); 956 toKeyframeEffect(m_content.get())->attachCompositedLayers();
957 } 957 }
958 958
959 void Animation::detachCompositedLayers() 959 void Animation::detachCompositedLayers()
960 { 960 {
961 if (m_compositorPlayer && m_compositorPlayer->isLayerAttached()) 961 if (m_compositorPlayer && m_compositorPlayer->isLayerAttached())
962 m_compositorPlayer->detachLayer(); 962 m_compositorPlayer->detachLayer();
963 } 963 }
964 964
965 void Animation::notifyAnimationStarted(double monotonicTime, int group) 965 void Animation::notifyAnimationStarted(double monotonicTime, int group)
966 { 966 {
967 ASSERT(RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled());
968 timeline()->document()->compositorPendingAnimations().notifyCompositorAnimat ionStarted(monotonicTime, group); 967 timeline()->document()->compositorPendingAnimations().notifyCompositorAnimat ionStarted(monotonicTime, group);
969 } 968 }
970 969
971 Animation::PlayStateUpdateScope::PlayStateUpdateScope(Animation& animation, Timi ngUpdateReason reason, CompositorPendingChange compositorPendingChange) 970 Animation::PlayStateUpdateScope::PlayStateUpdateScope(Animation& animation, Timi ngUpdateReason reason, CompositorPendingChange compositorPendingChange)
972 : m_animation(animation) 971 : m_animation(animation)
973 , m_initialPlayState(m_animation->playStateInternal()) 972 , m_initialPlayState(m_animation->playStateInternal())
974 , m_compositorPendingChange(compositorPendingChange) 973 , m_compositorPendingChange(compositorPendingChange)
975 { 974 {
976 ASSERT(m_initialPlayState != Unset); 975 ASSERT(m_initialPlayState != Unset);
977 m_animation->beginUpdatingState(); 976 m_animation->beginUpdatingState();
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 visitor->trace(m_timeline); 1081 visitor->trace(m_timeline);
1083 visitor->trace(m_pendingFinishedEvent); 1082 visitor->trace(m_pendingFinishedEvent);
1084 visitor->trace(m_pendingCancelledEvent); 1083 visitor->trace(m_pendingCancelledEvent);
1085 visitor->trace(m_finishedPromise); 1084 visitor->trace(m_finishedPromise);
1086 visitor->trace(m_readyPromise); 1085 visitor->trace(m_readyPromise);
1087 RefCountedGarbageCollectedEventTargetWithInlineData<Animation>::trace(visito r); 1086 RefCountedGarbageCollectedEventTargetWithInlineData<Animation>::trace(visito r);
1088 ActiveDOMObject::trace(visitor); 1087 ActiveDOMObject::trace(visitor);
1089 } 1088 }
1090 1089
1091 } // namespace blink 1090 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698