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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 layer_tree_host_->CommitAndCreateLayerImplTree(); | 98 layer_tree_host_->CommitAndCreateLayerImplTree(); |
99 | 99 |
100 // Check impl instances created. | 100 // Check impl instances created. |
101 for (int i = first_timeline_id; i < last_timeline_id; ++i) | 101 for (int i = first_timeline_id; i < last_timeline_id; ++i) |
102 EXPECT_TRUE(host_impl()->GetTimelineById(i)); | 102 EXPECT_TRUE(host_impl()->GetTimelineById(i)); |
103 } | 103 } |
104 | 104 |
105 void DoTest() { | 105 void DoTest() { |
106 timer_.Reset(); | 106 timer_.Reset(); |
107 do { | 107 do { |
108 host()->PushPropertiesTo(host_impl()); | 108 host()->PushPropertiesTo( |
| 109 host_impl(), |
| 110 layer_tree_host_->host_impl()->CurrentBeginFrameArgs().frame_time); |
109 timer_.NextLap(); | 111 timer_.NextLap(); |
110 } while (!timer_.HasTimeLimitExpired()); | 112 } while (!timer_.HasTimeLimitExpired()); |
111 | 113 |
112 perf_test::PrintResult("push_properties_to", "", "", timer_.LapsPerSecond(), | 114 perf_test::PrintResult("push_properties_to", "", "", timer_.LapsPerSecond(), |
113 "runs/s", true); | 115 "runs/s", true); |
114 } | 116 } |
115 | 117 |
116 protected: | 118 protected: |
117 std::unique_ptr<FakeLayerTreeHost> layer_tree_host_; | 119 std::unique_ptr<FakeLayerTreeHost> layer_tree_host_; |
118 scoped_refptr<Layer> root_layer_; | 120 scoped_refptr<Layer> root_layer_; |
(...skipping 13 matching lines...) Expand all 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 |