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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 1973083002: Use element id's for animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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: cc/trees/layer_tree_host_common_unittest.cc
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc
index 5101cebe8e34bf37b49cac36767b9ef803922121..f47169e1bc05f94b32fc12ecb08cba7e5318a4f5 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -2666,25 +2666,27 @@ TEST_F(LayerTreeHostCommonTest, AnimationsForRenderSurfaceHierarchy) {
gfx::PointF(2.5f, 0.f), gfx::Size(10, 10), true, false, false);
parent->layer_tree_impl()->BuildLayerListAndPropertyTreesForTesting();
+ SetElementIdsForTesting();
// Put an animated opacity on the render surface.
- AddOpacityTransitionToLayerWithPlayer(render_surface1->id(), timeline_impl(),
- 10.0, 1.f, 0.f, false);
+ AddOpacityTransitionToElementWithPlayer(
+ render_surface1->element_id(), timeline_impl(), 10.0, 1.f, 0.f, false);
// Also put an animated opacity on a layer without descendants.
- AddOpacityTransitionToLayerWithPlayer(grand_child_of_root->id(),
- timeline_impl(), 10.0, 1.f, 0.f, false);
+ AddOpacityTransitionToElementWithPlayer(grand_child_of_root->element_id(),
+ timeline_impl(), 10.0, 1.f, 0.f,
+ false);
// Put a transform animation on the render surface.
- AddAnimatedTransformToLayerWithPlayer(render_surface2->id(), timeline_impl(),
- 10.0, 30, 0);
+ AddAnimatedTransformToElementWithPlayer(render_surface2->element_id(),
+ timeline_impl(), 10.0, 30, 0);
// Also put transform animations on grand_child_of_root, and
// grand_child_of_rs2
- AddAnimatedTransformToLayerWithPlayer(grand_child_of_root->id(),
- timeline_impl(), 10.0, 30, 0);
- AddAnimatedTransformToLayerWithPlayer(grand_child_of_rs2->id(),
- timeline_impl(), 10.0, 30, 0);
+ AddAnimatedTransformToElementWithPlayer(grand_child_of_root->element_id(),
+ timeline_impl(), 10.0, 30, 0);
+ AddAnimatedTransformToElementWithPlayer(grand_child_of_rs2->element_id(),
+ timeline_impl(), 10.0, 30, 0);
parent->layer_tree_impl()->property_trees()->needs_rebuild = true;
ExecuteCalculateDrawProperties(parent);
@@ -2803,14 +2805,16 @@ TEST_F(LayerTreeHostCommonTest,
gfx::PointF(), gfx::Size(10, 10), true, false,
false);
+ SetElementIdsForTesting();
+
// Add a transform animation with a start delay to |grand_child|.
std::unique_ptr<Animation> animation = Animation::Create(
std::unique_ptr<AnimationCurve>(new FakeTransformTransition(1.0)), 0, 1,
TargetProperty::TRANSFORM);
animation->set_fill_mode(Animation::FillMode::NONE);
animation->set_time_offset(base::TimeDelta::FromMilliseconds(-1000));
- AddAnimationToLayerWithPlayer(grand_child->id(), timeline_impl(),
- std::move(animation));
+ AddAnimationToElementWithPlayer(grand_child->element_id(), timeline_impl(),
+ std::move(animation));
ExecuteCalculateDrawProperties(parent);
EXPECT_FALSE(parent->screen_space_transform_is_animating());
@@ -4531,12 +4535,14 @@ TEST_F(LayerTreeHostCommonTest, BackFaceCullingWithAnimatingTransforms) {
backface_matrix.RotateAboutYAxis(180.0);
backface_matrix.Translate(-50.0, -50.0);
+ SetElementIdsForTesting();
+
// Animate the transform on the render surface.
- AddAnimatedTransformToLayerWithPlayer(animating_surface->id(),
- timeline_impl(), 10.0, 30, 0);
+ AddAnimatedTransformToElementWithPlayer(animating_surface->element_id(),
+ timeline_impl(), 10.0, 30, 0);
// This is just an animating layer, not a surface.
- AddAnimatedTransformToLayerWithPlayer(animating_child->id(), timeline_impl(),
- 10.0, 30, 0);
+ AddAnimatedTransformToElementWithPlayer(animating_child->element_id(),
+ timeline_impl(), 10.0, 30, 0);
SetLayerPropertiesForTesting(parent, identity_matrix, gfx::Point3F(),
gfx::PointF(), gfx::Size(100, 100), true, false);
@@ -5148,13 +5154,18 @@ TEST_F(LayerTreeHostCommonTest, OpacityAnimatingOnPendingTree) {
LayerImpl* root_layer = root.get();
host_impl.pending_tree()->SetRootLayer(std::move(root));
host_impl.pending_tree()->BuildLayerListAndPropertyTreesForTesting();
+
// Add opacity animation.
scoped_refptr<AnimationTimeline> timeline =
AnimationTimeline::Create(AnimationIdProvider::NextTimelineId());
host_impl.animation_host()->AddAnimationTimeline(timeline);
+ host_impl.pending_tree()->SetElementIdsForTesting();
- AddOpacityTransitionToLayerWithPlayer(child_id, timeline, 10.0, 0.0f, 1.0f,
- false);
+ ElementId child_element_id =
+ host_impl.pending_tree()->LayerById(child_id)->element_id();
+
+ AddOpacityTransitionToElementWithPlayer(child_element_id, timeline, 10.0,
+ 0.0f, 1.0f, false);
LayerImplList render_surface_layer_list;
LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs(
@@ -5266,6 +5277,8 @@ class LCDTextTest : public LayerTreeHostCommonTestBase,
root_->test_properties()->AddChild(std::move(child_ptr));
host_impl_.active_tree()->SetRootLayer(std::move(root_ptr));
+ host_impl_.active_tree()->SetElementIdsForTesting();
+
root_->SetContentsOpaque(true);
child_->SetContentsOpaque(true);
grand_child_->SetContentsOpaque(true);
@@ -5407,8 +5420,11 @@ TEST_P(LCDTextTest, CanUseLCDTextWithAnimation) {
// Add opacity animation.
child_->test_properties()->opacity = 0.9f;
child_->layer_tree_impl()->property_trees()->needs_rebuild = true;
- AddOpacityTransitionToLayerWithPlayer(child_->id(), timeline(), 10.0, 0.9f,
- 0.1f, false);
+
+ SetElementIdsForTesting();
+
+ AddOpacityTransitionToElementWithPlayer(child_->element_id(), timeline(),
+ 10.0, 0.9f, 0.1f, false);
ExecuteCalculateDrawProperties(root_, 1.f, 1.f, NULL);
// Text LCD should be adjusted while animation is active.
EXPECT_EQ(expect_lcd_text, root_->CanUseLCDText());
@@ -5425,11 +5441,12 @@ TEST_P(LCDTextTest, CanUseLCDTextWithAnimationContentsOpaque) {
EXPECT_EQ(expect_lcd_text, root_->CanUseLCDText());
EXPECT_EQ(expect_lcd_text, child_->CanUseLCDText());
EXPECT_EQ(expect_lcd_text, grand_child_->CanUseLCDText());
+ SetElementIdsForTesting();
// Mark contents non-opaque within the first animation frame.
child_->SetContentsOpaque(false);
- AddOpacityTransitionToLayerWithPlayer(child_->id(), timeline(), 10.0, 0.9f,
- 0.1f, false);
+ AddOpacityTransitionToElementWithPlayer(child_->element_id(), timeline(),
+ 10.0, 0.9f, 0.1f, false);
ExecuteCalculateDrawProperties(root_, 1.f, 1.f, NULL);
// LCD text should be disabled for non-opaque layers even during animations.
EXPECT_EQ(expect_lcd_text, root_->CanUseLCDText());
@@ -7258,8 +7275,11 @@ TEST_F(LayerTreeHostCommonTest,
start_operations.AppendMatrix(start_scale);
TransformOperations end_operations;
end_operations.AppendMatrix(end_scale);
- AddAnimatedTransformToLayerWithPlayer(animated_layer->id(), timeline_impl(),
- 1.0, start_operations, end_operations);
+ SetElementIdsForTesting();
+
+ AddAnimatedTransformToElementWithPlayer(animated_layer->element_id(),
+ timeline_impl(), 1.0,
+ start_operations, end_operations);
gfx::Vector2dF scroll_delta(5.f, 9.f);
SetScrollOffsetDelta(scroller, scroll_delta);
@@ -7362,8 +7382,10 @@ TEST_F(LayerTreeHostCommonTest, MaximumAnimationScaleFactor) {
timeline = AnimationTimeline::Create(AnimationIdProvider::NextTimelineId());
host_impl.animation_host()->AddAnimationTimeline(timeline);
- AddAnimatedTransformToLayerWithPlayer(parent_raw->id(), timeline, 1.0,
- TransformOperations(), translation);
+ host_impl.active_tree()->SetElementIdsForTesting();
+ AddAnimatedTransformToElementWithPlayer(parent_raw->element_id(), timeline,
+ 1.0, TransformOperations(),
+ translation);
// No layers have scale-affecting animations.
EXPECT_EQ(
@@ -7389,8 +7411,8 @@ TEST_F(LayerTreeHostCommonTest, MaximumAnimationScaleFactor) {
TransformOperations scale;
scale.AppendScale(5.f, 4.f, 3.f);
- AddAnimatedTransformToLayerWithPlayer(child_raw->id(), timeline, 1.0,
- TransformOperations(), scale);
+ AddAnimatedTransformToElementWithPlayer(child_raw->element_id(), timeline,
+ 1.0, TransformOperations(), scale);
child_raw->layer_tree_impl()->property_trees()->needs_rebuild = true;
ExecuteCalculateDrawProperties(grand_parent_raw);
@@ -7415,8 +7437,9 @@ TEST_F(LayerTreeHostCommonTest, MaximumAnimationScaleFactor) {
1.f,
grand_child_raw->draw_properties().starting_animation_contents_scale);
- AddAnimatedTransformToLayerWithPlayer(grand_parent_raw->id(), timeline, 1.0,
- TransformOperations(), scale);
+ AddAnimatedTransformToElementWithPlayer(grand_parent_raw->element_id(),
+ timeline, 1.0, TransformOperations(),
+ scale);
grand_parent_raw->layer_tree_impl()->property_trees()->needs_rebuild = true;
ExecuteCalculateDrawProperties(grand_parent_raw);
@@ -7443,8 +7466,8 @@ TEST_F(LayerTreeHostCommonTest, MaximumAnimationScaleFactor) {
0.f,
grand_child_raw->draw_properties().starting_animation_contents_scale);
- AddAnimatedTransformToLayerWithPlayer(parent_raw->id(), timeline, 1.0,
- TransformOperations(), scale);
+ AddAnimatedTransformToElementWithPlayer(parent_raw->element_id(), timeline,
+ 1.0, TransformOperations(), scale);
parent_raw->layer_tree_impl()->property_trees()->needs_rebuild = true;
ExecuteCalculateDrawProperties(grand_parent_raw);
@@ -7469,18 +7492,19 @@ TEST_F(LayerTreeHostCommonTest, MaximumAnimationScaleFactor) {
0.f,
grand_child_raw->draw_properties().starting_animation_contents_scale);
- AbortAnimationsOnLayerWithPlayer(grand_parent_raw->id(), timeline,
- TargetProperty::TRANSFORM);
- AbortAnimationsOnLayerWithPlayer(parent_raw->id(), timeline,
- TargetProperty::TRANSFORM);
- AbortAnimationsOnLayerWithPlayer(child_raw->id(), timeline,
- TargetProperty::TRANSFORM);
+ AbortAnimationsOnElementWithPlayer(grand_parent_raw->element_id(), timeline,
+ TargetProperty::TRANSFORM);
+ AbortAnimationsOnElementWithPlayer(parent_raw->element_id(), timeline,
+ TargetProperty::TRANSFORM);
+ AbortAnimationsOnElementWithPlayer(child_raw->element_id(), timeline,
+ TargetProperty::TRANSFORM);
TransformOperations perspective;
perspective.AppendPerspective(10.f);
- AddAnimatedTransformToLayerWithPlayer(child_raw->id(), timeline, 1.0,
- TransformOperations(), perspective);
+ AddAnimatedTransformToElementWithPlayer(child_raw->element_id(), timeline,
+ 1.0, TransformOperations(),
+ perspective);
child_raw->layer_tree_impl()->property_trees()->needs_rebuild = true;
ExecuteCalculateDrawProperties(grand_parent_raw);
@@ -7506,16 +7530,16 @@ TEST_F(LayerTreeHostCommonTest, MaximumAnimationScaleFactor) {
0.f,
grand_child_raw->draw_properties().starting_animation_contents_scale);
- AbortAnimationsOnLayerWithPlayer(child_raw->id(), timeline,
- TargetProperty::TRANSFORM);
+ AbortAnimationsOnElementWithPlayer(child_raw->element_id(), timeline,
+ TargetProperty::TRANSFORM);
gfx::Transform scale_matrix;
scale_matrix.Scale(1.f, 2.f);
grand_parent_raw->SetTransform(scale_matrix);
parent_raw->SetTransform(scale_matrix);
grand_parent_raw->layer_tree_impl()->property_trees()->needs_rebuild = true;
- AddAnimatedTransformToLayerWithPlayer(parent_raw->id(), timeline, 1.0,
- TransformOperations(), scale);
+ AddAnimatedTransformToElementWithPlayer(parent_raw->element_id(), timeline,
+ 1.0, TransformOperations(), scale);
ExecuteCalculateDrawProperties(grand_parent_raw);
// |grand_parent| and |parent| each have scale 2.f. |parent| has a scale
@@ -7923,6 +7947,8 @@ TEST_F(LayerTreeHostCommonTest, DrawPropertyScales) {
root->SetDrawsContent(true);
host_impl.active_tree()->SetRootLayer(std::move(root));
+ host_impl.active_tree()->SetElementIdsForTesting();
+
gfx::Transform identity_matrix, scale_transform_child1,
scale_transform_child2;
scale_transform_child1.Scale(2, 3);
@@ -7955,14 +7981,14 @@ TEST_F(LayerTreeHostCommonTest, DrawPropertyScales) {
AnimationTimeline::Create(AnimationIdProvider::NextTimelineId());
host_impl.animation_host()->AddAnimationTimeline(timeline);
- AddAnimatedTransformToLayerWithPlayer(child2_layer->id(), timeline, 1.0,
- TransformOperations(), scale);
-
SetLayerPropertiesForTesting(child2_layer, scale_transform_child2,
gfx::Point3F(), gfx::PointF(), gfx::Size(1, 1),
true, false, false);
child2_layer->SetDrawsContent(true);
+ AddAnimatedTransformToElementWithPlayer(child2_layer->element_id(), timeline,
+ 1.0, TransformOperations(), scale);
+
root_layer->layer_tree_impl()->property_trees()->needs_rebuild = true;
ExecuteCalculateDrawProperties(root_layer);
@@ -8210,6 +8236,8 @@ TEST_F(LayerTreeHostCommonTest, VisibleContentRectForAnimatedLayer) {
host()->SetRootLayer(root);
+ host()->SetElementIdsForTesting();
+
SetLayerPropertiesForTesting(root.get(), identity_matrix, gfx::Point3F(),
gfx::PointF(), gfx::Size(100, 100), true, false);
SetLayerPropertiesForTesting(animated.get(), identity_matrix, gfx::Point3F(),
@@ -8219,8 +8247,8 @@ TEST_F(LayerTreeHostCommonTest, VisibleContentRectForAnimatedLayer) {
root->SetForceRenderSurfaceForTesting(true);
animated->SetOpacity(0.f);
- AddOpacityTransitionToLayerWithPlayer(animated->id(), timeline(), 10.0, 0.f,
- 1.f, false);
+ AddOpacityTransitionToElementWithPlayer(animated->element_id(), timeline(),
+ 10.0, 0.f, 1.f, false);
ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get());
EXPECT_FALSE(animated->visible_layer_rect_for_testing().IsEmpty());
@@ -8248,6 +8276,8 @@ TEST_F(LayerTreeHostCommonTest,
host()->SetRootLayer(root);
+ host()->SetElementIdsForTesting();
+
gfx::Transform uninvertible_matrix;
uninvertible_matrix.Scale3d(6.f, 6.f, 0.f);
@@ -8268,9 +8298,10 @@ TEST_F(LayerTreeHostCommonTest,
start_transform_operations.AppendMatrix(uninvertible_matrix);
TransformOperations end_transform_operations;
- AddAnimatedTransformToLayerWithPlayer(animated->id(), timeline(), 10.0,
- start_transform_operations,
- end_transform_operations);
+ SetElementIdsForTesting();
+ AddAnimatedTransformToElementWithPlayer(animated->element_id(), timeline(),
+ 10.0, start_transform_operations,
+ end_transform_operations);
ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get());
// The animated layer has a singular transform and maps to a non-empty rect in
@@ -8317,8 +8348,9 @@ TEST_F(LayerTreeHostCommonTest, AnimatedFilterCreatesRenderSurface) {
SetLayerPropertiesForTesting(grandchild, identity_transform, gfx::Point3F(),
gfx::PointF(), gfx::Size(50, 50), true, false);
- AddAnimatedFilterToLayerWithPlayer(child->id(), timeline_impl(), 10.0, 0.1f,
- 0.2f);
+ SetElementIdsForTesting();
+ AddAnimatedFilterToElementWithPlayer(child->element_id(), timeline_impl(),
+ 10.0, 0.1f, 0.2f);
ExecuteCalculateDrawProperties(root);
EXPECT_TRUE(root->has_render_surface());
@@ -8349,6 +8381,8 @@ TEST_F(LayerTreeHostCommonTest, DelayedFilterAnimationCreatesRenderSurface) {
SetLayerPropertiesForTesting(grandchild, identity_transform, gfx::Point3F(),
gfx::PointF(), gfx::Size(50, 50), true, false);
+ SetElementIdsForTesting();
+
std::unique_ptr<KeyframedFilterAnimationCurve> curve(
KeyframedFilterAnimationCurve::Create());
FilterOperations start_filters;
@@ -8364,8 +8398,8 @@ TEST_F(LayerTreeHostCommonTest, DelayedFilterAnimationCreatesRenderSurface) {
animation->set_fill_mode(Animation::FillMode::NONE);
animation->set_time_offset(base::TimeDelta::FromMilliseconds(-1000));
- AddAnimationToLayerWithPlayer(child->id(), timeline_impl(),
- std::move(animation));
+ AddAnimationToElementWithPlayer(child->element_id(), timeline_impl(),
+ std::move(animation));
ExecuteCalculateDrawProperties(root);
EXPECT_TRUE(root->has_render_surface());
@@ -8727,6 +8761,8 @@ TEST_F(LayerTreeHostCommonTest, SkippingSubtreeMain) {
host()->SetRootLayer(root);
+ host()->SetElementIdsForTesting();
+
// Check the non-skipped case.
ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get());
EXPECT_EQ(gfx::Rect(10, 10), grandchild->visible_layer_rect_for_testing());
@@ -8761,13 +8797,14 @@ TEST_F(LayerTreeHostCommonTest, SkippingSubtreeMain) {
animation_id, 1, TargetProperty::TRANSFORM);
animation->set_fill_mode(Animation::FillMode::NONE);
animation->set_time_offset(base::TimeDelta::FromMilliseconds(-1000));
- AddAnimationToLayerWithPlayer(child->id(), timeline(), std::move(animation));
+ AddAnimationToElementWithPlayer(child->element_id(), timeline(),
+ std::move(animation));
ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get());
EXPECT_EQ(gfx::Rect(10, 10), grandchild->visible_layer_rect_for_testing());
grandchild->set_visible_layer_rect(gfx::Rect());
- RemoveAnimationFromLayerWithExistingPlayer(child->id(), timeline(),
- animation_id);
+ RemoveAnimationFromElementWithExistingPlayer(child->element_id(), timeline(),
+ animation_id);
child->SetTransform(identity);
child->SetOpacity(0.f);
ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get());
@@ -8789,8 +8826,8 @@ TEST_F(LayerTreeHostCommonTest, SkippingSubtreeMain) {
animation_id, 1, TargetProperty::OPACITY);
animation->set_fill_mode(Animation::FillMode::NONE);
animation->set_time_offset(base::TimeDelta::FromMilliseconds(-1000));
- AddAnimationToLayerWithExistingPlayer(child->id(), timeline(),
- std::move(animation));
+ AddAnimationToElementWithExistingPlayer(child->element_id(), timeline(),
+ std::move(animation));
ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get());
EXPECT_EQ(gfx::Rect(10, 10), grandchild->visible_layer_rect_for_testing());
}
@@ -8835,6 +8872,8 @@ TEST_F(LayerTreeHostCommonTest, SkippingLayerImpl) {
root->test_properties()->AddChild(std::move(child));
host_impl.active_tree()->SetRootLayer(std::move(root));
+ host_impl.active_tree()->SetElementIdsForTesting();
+
// Check the non-skipped case.
// ExecuteCalculateDrawPropertiesWithPropertyTrees(root_ptr);
// EXPECT_EQ(gfx::Rect(10, 10), grandchild_ptr->visible_layer_rect());
@@ -8930,10 +8969,10 @@ TEST_F(LayerTreeHostCommonTest, SkippingLayerImpl) {
Animation::Create(std::move(curve), 3, 3, TargetProperty::TRANSFORM));
scoped_refptr<AnimationPlayer> player(AnimationPlayer::Create(1));
host_impl.active_tree()->animation_host()->RegisterPlayerForElement(
- root_ptr->id(), player.get());
+ root_ptr->element_id(), player.get());
host_impl.active_tree()
->animation_host()
- ->GetElementAnimationsForElementId(root_ptr->id())
+ ->GetElementAnimationsForElementId(root_ptr->element_id())
->AddAnimation(std::move(transform_animation));
grandchild_ptr->set_visible_layer_rect(gfx::Rect());
child_ptr->SetScrollClipLayer(root_ptr->id());
@@ -8944,7 +8983,7 @@ TEST_F(LayerTreeHostCommonTest, SkippingLayerImpl) {
EXPECT_EQ(gfx::Rect(0, 0), grandchild_ptr->visible_layer_rect());
host_impl.active_tree()->animation_host()->UnregisterPlayerForElement(
- root_ptr->id(), player.get());
+ root_ptr->element_id(), player.get());
}
TEST_F(LayerTreeHostCommonTest, LayerSkippingInSubtreeOfSingularTransform) {
@@ -8960,6 +8999,7 @@ TEST_F(LayerTreeHostCommonTest, LayerSkippingInSubtreeOfSingularTransform) {
SetLayerPropertiesForTesting(grand_child, identity, gfx::Point3F(),
gfx::PointF(), gfx::Size(10, 10), true, false,
false);
+ SetElementIdsForTesting();
gfx::Transform singular;
singular.matrix().set(0, 0, 0);
@@ -8985,11 +9025,11 @@ TEST_F(LayerTreeHostCommonTest, LayerSkippingInSubtreeOfSingularTransform) {
Animation::Create(std::move(curve), 3, 3, TargetProperty::TRANSFORM));
scoped_refptr<AnimationPlayer> player(AnimationPlayer::Create(1));
host_impl()->active_tree()->animation_host()->RegisterPlayerForElement(
- grand_child->id(), player.get());
+ grand_child->element_id(), player.get());
host_impl()
->active_tree()
->animation_host()
- ->GetElementAnimationsForElementId(grand_child->id())
+ ->GetElementAnimationsForElementId(grand_child->element_id())
->AddAnimation(std::move(transform_animation));
ExecuteCalculateDrawProperties(root);
@@ -8997,7 +9037,7 @@ TEST_F(LayerTreeHostCommonTest, LayerSkippingInSubtreeOfSingularTransform) {
EXPECT_EQ(gfx::Rect(0, 0), child->visible_layer_rect());
host_impl()->active_tree()->animation_host()->UnregisterPlayerForElement(
- grand_child->id(), player.get());
+ grand_child->element_id(), player.get());
}
TEST_F(LayerTreeHostCommonTest, SkippingPendingLayerImpl) {
@@ -9040,6 +9080,7 @@ TEST_F(LayerTreeHostCommonTest, SkippingPendingLayerImpl) {
root->test_properties()->AddChild(std::move(child));
host_impl.pending_tree()->SetRootLayer(std::move(root));
+ host_impl.pending_tree()->SetElementIdsForTesting();
// Check the non-skipped case.
ExecuteCalculateDrawPropertiesWithPropertyTrees(root_ptr);
@@ -9058,10 +9099,10 @@ TEST_F(LayerTreeHostCommonTest, SkippingPendingLayerImpl) {
Animation::Create(std::move(curve), 3, 3, TargetProperty::OPACITY));
scoped_refptr<AnimationPlayer> player(AnimationPlayer::Create(1));
host_impl.active_tree()->animation_host()->RegisterPlayerForElement(
- root_ptr->id(), player.get());
+ root_ptr->element_id(), player.get());
host_impl.active_tree()
->animation_host()
- ->GetElementAnimationsForElementId(root_ptr->id())
+ ->GetElementAnimationsForElementId(root_ptr->element_id())
->AddAnimation(std::move(animation));
root_ptr->test_properties()->opacity = 0.f;
grandchild_ptr->set_visible_layer_rect(gfx::Rect());
@@ -9070,7 +9111,7 @@ TEST_F(LayerTreeHostCommonTest, SkippingPendingLayerImpl) {
EXPECT_EQ(gfx::Rect(10, 10), grandchild_ptr->visible_layer_rect());
host_impl.active_tree()->animation_host()->UnregisterPlayerForElement(
- root_ptr->id(), player.get());
+ root_ptr->element_id(), player.get());
}
TEST_F(LayerTreeHostCommonTest, SkippingLayer) {
@@ -9995,6 +10036,8 @@ TEST_F(LayerTreeHostCommonTest, OpacityAnimationsTrackingTest) {
host()->SetRootLayer(root);
+ host()->SetElementIdsForTesting();
+
SetLayerPropertiesForTesting(root.get(), identity_matrix, gfx::Point3F(),
gfx::PointF(), gfx::Size(100, 100), true, false);
SetLayerPropertiesForTesting(animated.get(), identity_matrix, gfx::Point3F(),
@@ -10006,7 +10049,8 @@ TEST_F(LayerTreeHostCommonTest, OpacityAnimationsTrackingTest) {
scoped_refptr<AnimationPlayer> player =
AnimationPlayer::Create(AnimationIdProvider::NextPlayerId());
timeline()->AttachPlayer(player);
- player->AttachElement(animated->id());
+
+ player->AttachElement(animated->element_id());
int animation_id = 0;
std::unique_ptr<Animation> animation = Animation::Create(
@@ -10015,8 +10059,8 @@ TEST_F(LayerTreeHostCommonTest, OpacityAnimationsTrackingTest) {
animation->set_fill_mode(Animation::FillMode::NONE);
animation->set_time_offset(base::TimeDelta::FromMilliseconds(-1000));
Animation* animation_ptr = animation.get();
- AddAnimationToLayerWithExistingPlayer(animated->id(), timeline(),
- std::move(animation));
+ AddAnimationToElementWithExistingPlayer(animated->element_id(), timeline(),
+ std::move(animation));
ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get());
@@ -10047,6 +10091,8 @@ TEST_F(LayerTreeHostCommonTest, TransformAnimationsTrackingTest) {
host()->SetRootLayer(root);
+ host()->SetElementIdsForTesting();
+
SetLayerPropertiesForTesting(root.get(), identity_matrix, gfx::Point3F(),
gfx::PointF(), gfx::Size(100, 100), true, false);
SetLayerPropertiesForTesting(animated.get(), identity_matrix, gfx::Point3F(),
@@ -10057,7 +10103,7 @@ TEST_F(LayerTreeHostCommonTest, TransformAnimationsTrackingTest) {
scoped_refptr<AnimationPlayer> player =
AnimationPlayer::Create(AnimationIdProvider::NextPlayerId());
timeline()->AttachPlayer(player);
- player->AttachElement(animated->id());
+ player->AttachElement(animated->element_id());
std::unique_ptr<KeyframedTransformAnimationCurve> curve(
KeyframedTransformAnimationCurve::Create());
@@ -10076,8 +10122,8 @@ TEST_F(LayerTreeHostCommonTest, TransformAnimationsTrackingTest) {
animation->set_fill_mode(Animation::FillMode::NONE);
animation->set_time_offset(base::TimeDelta::FromMilliseconds(-1000));
Animation* animation_ptr = animation.get();
- AddAnimationToLayerWithExistingPlayer(animated->id(), timeline(),
- std::move(animation));
+ AddAnimationToElementWithExistingPlayer(animated->element_id(), timeline(),
+ std::move(animation));
ExecuteCalculateDrawPropertiesWithPropertyTrees(root.get());

Powered by Google App Engine
This is Rietveld 408576698