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

Unified Diff: Source/core/animation/CompositorAnimations.cpp

Issue 1131833002: [Sketch] Animations: Torpedo the old intrusive animation system. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@scroll
Patch Set: Delete more. Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/animation/CompositorAnimations.cpp
diff --git a/Source/core/animation/CompositorAnimations.cpp b/Source/core/animation/CompositorAnimations.cpp
index 854000fcdb5d57f77d0cc2ae37a80b05e24d3787..ef2db21575b918f99ffc0bf9838da75b503dd4f3 100644
--- a/Source/core/animation/CompositorAnimations.cpp
+++ b/Source/core/animation/CompositorAnimations.cpp
@@ -287,17 +287,9 @@ bool CompositorAnimations::startAnimationOnCompositor(const Element& element, in
ASSERT(!animations.isEmpty());
for (auto& animation : animations) {
int id = animation->id();
- if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) {
- WebCompositorAnimationPlayer* compositorPlayer = player.compositorPlayer();
- ASSERT(compositorPlayer);
- compositorPlayer->addAnimation(animation.leakPtr());
- } else if (!layer->compositedDeprecatedPaintLayerMapping()->mainGraphicsLayer()->addAnimation(animation.release())) {
- // FIXME: We should know ahead of time whether these animations can be started.
- for (int startedAnimationId : startedAnimationIds)
- cancelAnimationOnCompositor(element, player, startedAnimationId);
- startedAnimationIds.clear();
- return false;
- }
+ WebCompositorAnimationPlayer* compositorPlayer = player.compositorPlayer();
+ ASSERT(compositorPlayer);
+ compositorPlayer->addAnimation(animation.leakPtr());
startedAnimationIds.append(id);
}
ASSERT(!startedAnimationIds.isEmpty());
@@ -314,13 +306,10 @@ void CompositorAnimations::cancelAnimationOnCompositor(const Element& element, c
// compositing update.
return;
}
- if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) {
- WebCompositorAnimationPlayer* compositorPlayer = player.compositorPlayer();
- ASSERT(compositorPlayer);
- compositorPlayer->removeAnimation(id);
- } else {
- toLayoutBoxModelObject(element.layoutObject())->layer()->compositedDeprecatedPaintLayerMapping()->mainGraphicsLayer()->removeAnimation(id);
- }
+
+ WebCompositorAnimationPlayer* compositorPlayer = player.compositorPlayer();
+ ASSERT(compositorPlayer);
+ compositorPlayer->removeAnimation(id);
}
void CompositorAnimations::pauseAnimationForTestingOnCompositor(const Element& element, const AnimationPlayer& player, int id, double pauseTime)
@@ -333,20 +322,14 @@ void CompositorAnimations::pauseAnimationForTestingOnCompositor(const Element& e
ASSERT_NOT_REACHED();
return;
}
- if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) {
- WebCompositorAnimationPlayer* compositorPlayer = player.compositorPlayer();
- ASSERT(compositorPlayer);
- compositorPlayer->pauseAnimation(id, pauseTime);
- } else {
- toLayoutBoxModelObject(element.layoutObject())->layer()->compositedDeprecatedPaintLayerMapping()->mainGraphicsLayer()->pauseAnimation(id, pauseTime);
- }
+
+ WebCompositorAnimationPlayer* compositorPlayer = player.compositorPlayer();
+ ASSERT(compositorPlayer);
+ compositorPlayer->pauseAnimation(id, pauseTime);
}
bool CompositorAnimations::canAttachCompositedLayers(const Element& element, const AnimationPlayer& player)
{
- if (!RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled())
- return false;
-
if (!player.compositorPlayer())
return false;
« no previous file with comments | « Source/core/animation/AnimationTimeline.cpp ('k') | Source/core/layout/compositing/CompositedDeprecatedPaintLayerMapping.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698