OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/trees/layer_tree_host_common.h" | 5 #include "cc/trees/layer_tree_host_common.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 8865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8876 root->AddChild(std::move(child)); | 8876 root->AddChild(std::move(child)); |
8877 | 8877 |
8878 host_impl.pending_tree()->SetRootLayer(std::move(root)); | 8878 host_impl.pending_tree()->SetRootLayer(std::move(root)); |
8879 | 8879 |
8880 // Check the non-skipped case. | 8880 // Check the non-skipped case. |
8881 ExecuteCalculateDrawPropertiesWithPropertyTrees(root_ptr); | 8881 ExecuteCalculateDrawPropertiesWithPropertyTrees(root_ptr); |
8882 EXPECT_EQ(gfx::Rect(10, 10), grandchild_ptr->visible_layer_rect()); | 8882 EXPECT_EQ(gfx::Rect(10, 10), grandchild_ptr->visible_layer_rect()); |
8883 | 8883 |
8884 std::unique_ptr<KeyframedFloatAnimationCurve> curve( | 8884 std::unique_ptr<KeyframedFloatAnimationCurve> curve( |
8885 KeyframedFloatAnimationCurve::Create()); | 8885 KeyframedFloatAnimationCurve::Create()); |
8886 std::unique_ptr<TimingFunction> func = EaseTimingFunction::Create(); | 8886 std::unique_ptr<TimingFunction> func = |
| 8887 CubicBezierTimingFunction::CreatePreset( |
| 8888 CubicBezierTimingFunction::EaseType::EASE); |
8887 curve->AddKeyframe( | 8889 curve->AddKeyframe( |
8888 FloatKeyframe::Create(base::TimeDelta(), 0.9f, std::move(func))); | 8890 FloatKeyframe::Create(base::TimeDelta(), 0.9f, std::move(func))); |
8889 curve->AddKeyframe( | 8891 curve->AddKeyframe( |
8890 FloatKeyframe::Create(base::TimeDelta::FromSecondsD(1.0), 0.3f, nullptr)); | 8892 FloatKeyframe::Create(base::TimeDelta::FromSecondsD(1.0), 0.3f, nullptr)); |
8891 std::unique_ptr<Animation> animation( | 8893 std::unique_ptr<Animation> animation( |
8892 Animation::Create(std::move(curve), 3, 3, TargetProperty::OPACITY)); | 8894 Animation::Create(std::move(curve), 3, 3, TargetProperty::OPACITY)); |
8893 scoped_refptr<AnimationPlayer> player(AnimationPlayer::Create(1)); | 8895 scoped_refptr<AnimationPlayer> player(AnimationPlayer::Create(1)); |
8894 host_impl.active_tree()->animation_host()->RegisterPlayerForElement( | 8896 host_impl.active_tree()->animation_host()->RegisterPlayerForElement( |
8895 root_ptr->id(), player.get()); | 8897 root_ptr->id(), player.get()); |
8896 host_impl.active_tree() | 8898 host_impl.active_tree() |
(...skipping 1189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10086 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); | 10088 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); |
10087 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); | 10089 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); |
10088 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); | 10090 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); |
10089 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); | 10091 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); |
10090 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); | 10092 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); |
10091 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); | 10093 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); |
10092 } | 10094 } |
10093 | 10095 |
10094 } // namespace | 10096 } // namespace |
10095 } // namespace cc | 10097 } // namespace cc |
OLD | NEW |