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

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: respond to reviewer feedback. 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: 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 97b1f57f1637a8de880c02d61210c42349057cdc..57472b709a79b1ad36ebf37a9711a28502f3e558 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -2553,25 +2553,27 @@ TEST_F(LayerTreeHostCommonTest, AnimationsForRenderSurfaceHierarchy) {
gfx::PointF(2.5f, 0.f), gfx::Size(10, 10), true, false, false);
parent->layer_tree_impl()->BuildPropertyTreesForTesting();
+ 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);
@@ -2690,14 +2692,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());
@@ -4418,12 +4422,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);
@@ -5035,13 +5041,18 @@ TEST_F(LayerTreeHostCommonTest, OpacityAnimatingOnPendingTree) {
LayerImpl* root_layer = root.get();
host_impl.pending_tree()->SetRootLayer(std::move(root));
host_impl.pending_tree()->BuildPropertyTreesForTesting();
+
// 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(
@@ -5153,6 +5164,8 @@ class LCDTextTest : public LayerTreeHostCommonTestBase,
root_->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);
@@ -5294,8 +5307,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());
@@ -5312,11 +5328,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());
@@ -7081,8 +7098,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);
@@ -7185,8 +7205,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(
@@ -7212,8 +7234,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);
@@ -7238,8 +7260,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);
@@ -7266,8 +7289,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);
@@ -7292,18 +7315,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);
@@ -7329,16 +7353,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
@@ -7741,6 +7765,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);
@@ -7771,14 +7797,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);
@@ -8046,6 +8072,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(),
@@ -8055,8 +8083,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());
@@ -8084,6 +8112,8 @@ TEST_F(LayerTreeHostCommonTest,
host()->SetRootLayer(root);
+ host()->SetElementIdsForTesting();
+
gfx::Transform uninvertible_matrix;
uninvertible_matrix.Scale3d(6.f, 6.f, 0.f);
@@ -8104,9 +8134,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
@@ -8153,8 +8184,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());
@@ -8185,6 +8217,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;
@@ -8200,8 +8234,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());
@@ -8563,6 +8597,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());
@@ -8597,13 +8633,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());
@@ -8625,8 +8662,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());
}
@@ -8671,6 +8708,8 @@ TEST_F(LayerTreeHostCommonTest, SkippingLayerImpl) {
root->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());
@@ -8766,10 +8805,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());
@@ -8780,7 +8819,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) {
@@ -8796,6 +8835,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);
@@ -8821,11 +8861,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);
@@ -8833,7 +8873,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) {
@@ -8876,6 +8916,7 @@ TEST_F(LayerTreeHostCommonTest, SkippingPendingLayerImpl) {
root->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);
@@ -8892,10 +8933,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());
@@ -8904,7 +8945,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) {
@@ -9755,6 +9796,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(),
@@ -9766,7 +9809,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(
@@ -9775,8 +9819,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());
@@ -9807,6 +9851,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(),
@@ -9817,7 +9863,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());
@@ -9836,8 +9882,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