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

Unified Diff: third_party/WebKit/Source/platform/graphics/GraphicsLayerTest.cpp

Issue 1944623002: CC Animation: Use ElementId to attach CC animation players. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@erasedomids
Patch Set: Let CC clients generate their own ElementIds locally. 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/platform/graphics/GraphicsLayerTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayerTest.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayerTest.cpp
index 60c4b34931d14270c7c6d23ae90b3a448c53ca4a..dff726505e6cd3f934ee7ee11895724494aa31dc 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsLayerTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayerTest.cpp
@@ -53,11 +53,13 @@ public:
m_clipLayer = adoptPtr(new FakeGraphicsLayer(&m_client));
m_scrollElasticityLayer = adoptPtr(new FakeGraphicsLayer(&m_client));
m_graphicsLayer = adoptPtr(new FakeGraphicsLayer(&m_client));
+ m_graphicsLayer->setElementId(nextCompositorElementId());
m_clipLayer->addChild(m_scrollElasticityLayer.get());
m_scrollElasticityLayer->addChild(m_graphicsLayer.get());
m_graphicsLayer->platformLayer()->setScrollClipLayer(
m_clipLayer->platformLayer());
m_platformLayer = m_graphicsLayer->platformLayer();
+
m_layerTreeView = adoptPtr(new WebLayerTreeViewImplForTesting);
ASSERT(m_layerTreeView);
m_layerTreeView->setRootLayer(*m_clipLayer->platformLayer());
@@ -115,8 +117,8 @@ TEST_F(GraphicsLayerTest, updateLayerShouldFlattenTransformWithAnimations)
layerTreeView()->attachCompositorAnimationTimeline(compositorTimeline->animationTimeline());
compositorTimeline->playerAttached(player);
- player.compositorPlayer()->attachLayer(m_platformLayer);
- ASSERT_TRUE(player.compositorPlayer()->isLayerAttached());
+ player.compositorPlayer()->attachElement(m_platformLayer->elementId());
+ ASSERT_TRUE(player.compositorPlayer()->isElementAttached());
player.compositorPlayer()->addAnimation(floatAnimation.leakPtr());
@@ -138,8 +140,8 @@ TEST_F(GraphicsLayerTest, updateLayerShouldFlattenTransformWithAnimations)
ASSERT_FALSE(m_platformLayer->hasActiveAnimationForTesting());
- player.compositorPlayer()->detachLayer();
- ASSERT_FALSE(player.compositorPlayer()->isLayerAttached());
+ player.compositorPlayer()->detachElement();
+ ASSERT_FALSE(player.compositorPlayer()->isElementAttached());
compositorTimeline->playerDestroyed(player);
layerTreeView()->detachCompositorAnimationTimeline(compositorTimeline->animationTimeline());

Powered by Google App Engine
This is Rietveld 408576698