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

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: Exclude histograms.xml 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 883 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 } 894 }
895 895
896 void Animation::endUpdatingState() 896 void Animation::endUpdatingState()
897 { 897 {
898 ASSERT(m_stateIsBeingUpdated); 898 ASSERT(m_stateIsBeingUpdated);
899 m_stateIsBeingUpdated = false; 899 m_stateIsBeingUpdated = false;
900 } 900 }
901 901
902 void Animation::createCompositorPlayer() 902 void Animation::createCompositorPlayer()
903 { 903 {
904 if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled() && Platfor m::current()->isThreadedAnimationEnabled() && !m_compositorPlayer) { 904 if (Platform::current()->isThreadedAnimationEnabled() && !m_compositorPlayer ) {
905 ASSERT(Platform::current()->compositorSupport()); 905 ASSERT(Platform::current()->compositorSupport());
906 m_compositorPlayer = adoptPtr(CompositorFactory::current().createAnimati onPlayer()); 906 m_compositorPlayer = adoptPtr(CompositorFactory::current().createAnimati onPlayer());
907 ASSERT(m_compositorPlayer); 907 ASSERT(m_compositorPlayer);
908 m_compositorPlayer->setAnimationDelegate(this); 908 m_compositorPlayer->setAnimationDelegate(this);
909 attachCompositorTimeline(); 909 attachCompositorTimeline();
910 } 910 }
911 911
912 attachCompositedLayers(); 912 attachCompositedLayers();
913 } 913 }
914 914
(...skipping 21 matching lines...) Expand all
936 { 936 {
937 if (m_compositorPlayer) { 937 if (m_compositorPlayer) {
938 CompositorAnimationTimeline* timeline = m_timeline ? m_timeline->composi torTimeline() : nullptr; 938 CompositorAnimationTimeline* timeline = m_timeline ? m_timeline->composi torTimeline() : nullptr;
939 if (timeline) 939 if (timeline)
940 timeline->playerDestroyed(*this); 940 timeline->playerDestroyed(*this);
941 } 941 }
942 } 942 }
943 943
944 void Animation::attachCompositedLayers() 944 void Animation::attachCompositedLayers()
945 { 945 {
946 if (!RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled() || !m_com positorPlayer) 946 if (!m_compositorPlayer)
947 return; 947 return;
948 948
949 ASSERT(m_content); 949 ASSERT(m_content);
950 ASSERT(m_content->isKeyframeEffect()); 950 ASSERT(m_content->isKeyframeEffect());
951 951
952 if (toKeyframeEffect(m_content.get())->canAttachCompositedLayers()) 952 if (toKeyframeEffect(m_content.get())->canAttachCompositedLayers())
953 toKeyframeEffect(m_content.get())->attachCompositedLayers(); 953 toKeyframeEffect(m_content.get())->attachCompositedLayers();
954 } 954 }
955 955
956 void Animation::detachCompositedLayers() 956 void Animation::detachCompositedLayers()
957 { 957 {
958 if (m_compositorPlayer && m_compositorPlayer->isLayerAttached()) 958 if (m_compositorPlayer && m_compositorPlayer->isLayerAttached())
959 m_compositorPlayer->detachLayer(); 959 m_compositorPlayer->detachLayer();
960 } 960 }
961 961
962 void Animation::notifyAnimationStarted(double monotonicTime, int group) 962 void Animation::notifyAnimationStarted(double monotonicTime, int group)
963 { 963 {
964 ASSERT(RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled());
965 timeline()->document()->compositorPendingAnimations().notifyCompositorAnimat ionStarted(monotonicTime, group); 964 timeline()->document()->compositorPendingAnimations().notifyCompositorAnimat ionStarted(monotonicTime, group);
966 } 965 }
967 966
968 Animation::PlayStateUpdateScope::PlayStateUpdateScope(Animation& animation, Timi ngUpdateReason reason, CompositorPendingChange compositorPendingChange) 967 Animation::PlayStateUpdateScope::PlayStateUpdateScope(Animation& animation, Timi ngUpdateReason reason, CompositorPendingChange compositorPendingChange)
969 : m_animation(animation) 968 : m_animation(animation)
970 , m_initialPlayState(m_animation->playStateInternal()) 969 , m_initialPlayState(m_animation->playStateInternal())
971 , m_compositorPendingChange(compositorPendingChange) 970 , m_compositorPendingChange(compositorPendingChange)
972 { 971 {
973 ASSERT(m_initialPlayState != Unset); 972 ASSERT(m_initialPlayState != Unset);
974 m_animation->beginUpdatingState(); 973 m_animation->beginUpdatingState();
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 visitor->trace(m_timeline); 1078 visitor->trace(m_timeline);
1080 visitor->trace(m_pendingFinishedEvent); 1079 visitor->trace(m_pendingFinishedEvent);
1081 visitor->trace(m_pendingCancelledEvent); 1080 visitor->trace(m_pendingCancelledEvent);
1082 visitor->trace(m_finishedPromise); 1081 visitor->trace(m_finishedPromise);
1083 visitor->trace(m_readyPromise); 1082 visitor->trace(m_readyPromise);
1084 RefCountedGarbageCollectedEventTargetWithInlineData<Animation>::trace(visito r); 1083 RefCountedGarbageCollectedEventTargetWithInlineData<Animation>::trace(visito r);
1085 ContextLifecycleObserver::trace(visitor); 1084 ContextLifecycleObserver::trace(visitor);
1086 } 1085 }
1087 1086
1088 } // namespace blink 1087 } // namespace blink
OLDNEW
« no previous file with comments | « media/blink/webmediaplayer_impl.cc ('k') | third_party/WebKit/Source/core/animation/AnimationTimeline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698