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 26 matching lines...) Expand all Loading... |
37 } | 37 } |
38 | 38 |
39 void TearDown() override { | 39 void TearDown() override { |
40 root_layer_ = nullptr; | 40 root_layer_ = nullptr; |
41 root_layer_impl_ = nullptr; | 41 root_layer_impl_ = nullptr; |
42 | 42 |
43 layer_tree_host_->SetRootLayer(nullptr); | 43 layer_tree_host_->SetRootLayer(nullptr); |
44 layer_tree_host_ = nullptr; | 44 layer_tree_host_ = nullptr; |
45 } | 45 } |
46 | 46 |
47 AnimationHost* host() const { return layer_tree_host_->animation_host(); } | 47 AnimationHost* host() const { |
| 48 return layer_tree_host_->GetLayerTree()->animation_host(); |
| 49 } |
48 AnimationHost* host_impl() const { | 50 AnimationHost* host_impl() const { |
49 return layer_tree_host_->host_impl()->animation_host(); | 51 return layer_tree_host_->host_impl()->animation_host(); |
50 } | 52 } |
51 | 53 |
52 void CreatePlayers(const int num_players) { | 54 void CreatePlayers(const int num_players) { |
53 scoped_refptr<AnimationTimeline> timeline = | 55 scoped_refptr<AnimationTimeline> timeline = |
54 AnimationTimeline::Create(AnimationIdProvider::NextTimelineId()); | 56 AnimationTimeline::Create(AnimationIdProvider::NextTimelineId()); |
55 host()->AddAnimationTimeline(timeline); | 57 host()->AddAnimationTimeline(timeline); |
56 | 58 |
57 const int first_player_id = AnimationIdProvider::NextPlayerId(); | 59 const int first_player_id = AnimationIdProvider::NextPlayerId(); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 CreateTimelines(10); | 134 CreateTimelines(10); |
133 DoTest(); | 135 DoTest(); |
134 } | 136 } |
135 | 137 |
136 TEST_F(AnimationHostPerfTest, Push1000TimelinesPropertiesTo) { | 138 TEST_F(AnimationHostPerfTest, Push1000TimelinesPropertiesTo) { |
137 CreateTimelines(1000); | 139 CreateTimelines(1000); |
138 DoTest(); | 140 DoTest(); |
139 } | 141 } |
140 | 142 |
141 } // namespace cc | 143 } // namespace cc |
OLD | NEW |