| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/animation/animation_host.h" | 5 #include "cc/animation/animation_host.h" |
| 6 | 6 |
| 7 #include "base/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
| 8 #include "cc/animation/animation_id_provider.h" | 8 #include "cc/animation/animation_id_provider.h" |
| 9 #include "cc/animation/animation_player.h" | 9 #include "cc/animation/animation_player.h" |
| 10 #include "cc/animation/animation_timeline.h" | 10 #include "cc/animation/animation_timeline.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 for (int i = 0; i < num_players; ++i) { | 62 for (int i = 0; i < num_players; ++i) { |
| 63 scoped_refptr<Layer> layer = Layer::Create(); | 63 scoped_refptr<Layer> layer = Layer::Create(); |
| 64 root_layer_->AddChild(layer); | 64 root_layer_->AddChild(layer); |
| 65 | 65 |
| 66 scoped_refptr<AnimationPlayer> player = | 66 scoped_refptr<AnimationPlayer> player = |
| 67 AnimationPlayer::Create(last_player_id); | 67 AnimationPlayer::Create(last_player_id); |
| 68 last_player_id = AnimationIdProvider::NextPlayerId(); | 68 last_player_id = AnimationIdProvider::NextPlayerId(); |
| 69 | 69 |
| 70 timeline->AttachPlayer(player); | 70 timeline->AttachPlayer(player); |
| 71 player->AttachElement(layer->id()); | 71 player->AttachElement2(layer->id()); |
| 72 EXPECT_TRUE(player->element_animations()); | 72 EXPECT_TRUE(player->element_animations()); |
| 73 } | 73 } |
| 74 | 74 |
| 75 // Create impl players. | 75 // Create impl players. |
| 76 layer_tree_host_->CommitAndCreateLayerImplTree(); | 76 layer_tree_host_->CommitAndCreateLayerImplTree(); |
| 77 | 77 |
| 78 // Check impl instances created. | 78 // Check impl instances created. |
| 79 scoped_refptr<AnimationTimeline> timeline_impl = | 79 scoped_refptr<AnimationTimeline> timeline_impl = |
| 80 host_impl()->GetTimelineById(timeline->id()); | 80 host_impl()->GetTimelineById(timeline->id()); |
| 81 EXPECT_TRUE(timeline_impl); | 81 EXPECT_TRUE(timeline_impl); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 CreateTimelines(10); | 132 CreateTimelines(10); |
| 133 DoTest(); | 133 DoTest(); |
| 134 } | 134 } |
| 135 | 135 |
| 136 TEST_F(AnimationHostPerfTest, Push1000TimelinesPropertiesTo) { | 136 TEST_F(AnimationHostPerfTest, Push1000TimelinesPropertiesTo) { |
| 137 CreateTimelines(1000); | 137 CreateTimelines(1000); |
| 138 DoTest(); | 138 DoTest(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 } // namespace cc | 141 } // namespace cc |
| OLD | NEW |