Index: Source/core/animation/AnimationTimeline.cpp |
diff --git a/Source/core/animation/AnimationTimeline.cpp b/Source/core/animation/AnimationTimeline.cpp |
index a9d7abfda6e1e39ed1396850c8a7cf600371b5d1..41bb866d9665bb3210ea3dadc78e48f6e447cfa4 100644 |
--- a/Source/core/animation/AnimationTimeline.cpp |
+++ b/Source/core/animation/AnimationTimeline.cpp |
@@ -37,7 +37,11 @@ |
#include "core/frame/FrameView.h" |
#include "core/loader/DocumentLoader.h" |
#include "core/page/Page.h" |
+#include "platform/RuntimeEnabledFeatures.h" |
#include "platform/TraceEvent.h" |
+#include "public/platform/Platform.h" |
+#include "public/platform/WebCompositorAnimationTimeline.h" |
+#include "public/platform/WebCompositorSupport.h" |
namespace blink { |
@@ -72,6 +76,9 @@ AnimationTimeline::AnimationTimeline(Document* document, PassOwnPtrWillBeRawPtr< |
else |
m_timing = timing; |
+ if (Platform::current()->compositorSupport() && RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) |
+ m_compositorTimeline = adoptPtr(Platform::current()->compositorSupport()->createAnimationTimeline()); |
+ |
ASSERT(document); |
} |
@@ -88,6 +95,9 @@ void AnimationTimeline::playerAttached(AnimationPlayer& player) |
ASSERT(player.timeline() == this); |
ASSERT(!m_players.contains(&player)); |
m_players.add(&player); |
+ |
+ if (m_compositorTimeline) |
+ m_compositorTimeline->playerAttached(player); |
} |
AnimationPlayer* AnimationTimeline::play(AnimationNode* child) |
@@ -159,6 +169,12 @@ void AnimationTimeline::scheduleNextService() |
} |
} |
+void AnimationTimeline::updateCompositorPlayerToElementAttachments() |
+{ |
+ for (AnimationPlayer* player : m_players) |
+ player->updateCompositorPlayerToElementAttachment(); |
+} |
+ |
void AnimationTimeline::AnimationTimelineTiming::wakeAfter(double duration) |
{ |
m_timer.startOneShot(duration, FROM_HERE); |