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

Side by Side Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 2032643003: CC Animation: Erase EaseTimingFunction helpers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gmock
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 unified diff | Download patch
« no previous file with comments | « cc/test/animation_test_common.cc ('k') | cc/trees/layer_tree_host_unittest_animation.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/test/animation_test_common.cc ('k') | cc/trees/layer_tree_host_unittest_animation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698