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

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

Issue 1973083002: Use element id's for animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: get element id's from scroll node data directly. Created 4 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: third_party/WebKit/Source/core/animation/CompositorAnimations.cpp
diff --git a/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp b/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp
index 4dcad3f8bde3196c35752fc13989f4839b47c59f..0888a268c69dc5c7161beb079cd0830fd794879b 100644
--- a/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp
+++ b/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp
@@ -37,6 +37,7 @@
#include "core/animation/animatable/AnimatableFilterOperations.h"
#include "core/animation/animatable/AnimatableTransform.h"
#include "core/animation/animatable/AnimatableValue.h"
+#include "core/dom/DOMNodeIds.h"
#include "core/layout/LayoutBoxModelObject.h"
#include "core/layout/LayoutObject.h"
#include "core/layout/compositing/CompositedLayerMapping.h"
@@ -390,39 +391,13 @@ void CompositorAnimations::pauseAnimationForTestingOnCompositor(const Element& e
compositorPlayer->pauseAnimation(id, pauseTime);
}
-bool CompositorAnimations::canAttachCompositedLayers(const Element& element, const Animation& animation)
+void CompositorAnimations::attachCompositedLayers(Element& element, const Animation& animation)
{
if (!animation.compositorPlayer())
- return false;
-
- if (!element.layoutObject() || !element.layoutObject()->isBoxModelObject())
- return false;
-
- PaintLayer* layer = toLayoutBoxModelObject(element.layoutObject())->layer();
-
- if (!layer || !layer->isAllowedToQueryCompositingState()
- || !layer->compositedLayerMapping()
- || !layer->compositedLayerMapping()->mainGraphicsLayer())
- return false;
-
- if (!layer->compositedLayerMapping()->mainGraphicsLayer()->platformLayer())
- return false;
-
- return true;
-}
-
-void CompositorAnimations::attachCompositedLayers(const Element& element, const Animation& animation)
-{
- ASSERT(element.layoutObject());
-
- PaintLayer* layer = toLayoutBoxModelObject(element.layoutObject())->layer();
- ASSERT(layer);
+ return;
CompositorAnimationPlayer* compositorPlayer = animation.compositorPlayer();
- ASSERT(compositorPlayer);
-
- ASSERT(layer->compositedLayerMapping());
- compositorPlayer->attachLayer(layer->compositedLayerMapping()->mainGraphicsLayer()->platformLayer());
+ compositorPlayer->attachElement(CompositorElementId(DOMNodeIds::idForNode(&element)));
Ian Vollick 2016/06/01 18:08:26 By not pulling from cc, we are able to simplify th
}
// -----------------------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698