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/threading/thread_task_runner_handle.h" | 7 #include "base/threading/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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 all_players_timeline_ = | 60 all_players_timeline_ = |
61 AnimationTimeline::Create(AnimationIdProvider::NextTimelineId()); | 61 AnimationTimeline::Create(AnimationIdProvider::NextTimelineId()); |
62 host()->AddAnimationTimeline(all_players_timeline_); | 62 host()->AddAnimationTimeline(all_players_timeline_); |
63 | 63 |
64 first_player_id_ = AnimationIdProvider::NextPlayerId(); | 64 first_player_id_ = AnimationIdProvider::NextPlayerId(); |
65 last_player_id_ = first_player_id_; | 65 last_player_id_ = first_player_id_; |
66 | 66 |
67 for (int i = 0; i < num_players; ++i) { | 67 for (int i = 0; i < num_players; ++i) { |
68 scoped_refptr<Layer> layer = Layer::Create(); | 68 scoped_refptr<Layer> layer = Layer::Create(); |
69 root_layer_->AddChild(layer); | 69 root_layer_->AddChild(layer); |
70 layer->SetElementId(LayerIdToElementIdForTesting(layer->id())); | 70 ElementId element_id; |
| 71 element_id.id = layer->id(); |
| 72 layer->SetElementId(element_id); |
71 | 73 |
72 scoped_refptr<AnimationPlayer> player = | 74 scoped_refptr<AnimationPlayer> player = |
73 AnimationPlayer::Create(last_player_id_); | 75 AnimationPlayer::Create(last_player_id_); |
74 last_player_id_ = AnimationIdProvider::NextPlayerId(); | 76 last_player_id_ = AnimationIdProvider::NextPlayerId(); |
75 | 77 |
76 all_players_timeline_->AttachPlayer(player); | 78 all_players_timeline_->AttachPlayer(player); |
77 player->AttachElement(layer->element_id()); | 79 player->AttachElement(layer->element_id()); |
78 EXPECT_TRUE(player->element_animations()); | 80 EXPECT_TRUE(player->element_animations()); |
79 } | 81 } |
80 | 82 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 CreateTimelines(10); | 162 CreateTimelines(10); |
161 DoTest(); | 163 DoTest(); |
162 } | 164 } |
163 | 165 |
164 TEST_F(AnimationHostPerfTest, Push1000TimelinesPropertiesTo) { | 166 TEST_F(AnimationHostPerfTest, Push1000TimelinesPropertiesTo) { |
165 CreateTimelines(1000); | 167 CreateTimelines(1000); |
166 DoTest(); | 168 DoTest(); |
167 } | 169 } |
168 | 170 |
169 } // namespace cc | 171 } // namespace cc |
OLD | NEW |