Chromium Code Reviews| Index: cc/animation/animation_host_perftest.cc |
| diff --git a/cc/animation/animation_host_perftest.cc b/cc/animation/animation_host_perftest.cc |
| index bd3cdeb5a1f1581c56624c3982f7282e6cc9d27f..ce82f63f4383bbdeebac0cbb72ef697c9c556559 100644 |
| --- a/cc/animation/animation_host_perftest.cc |
| +++ b/cc/animation/animation_host_perftest.cc |
| @@ -20,8 +20,6 @@ |
| namespace cc { |
| -static const int kNumberOfAnimationPlayers = 1000; |
| - |
| class AnimationHostPerfTest : public testing::Test { |
| public: |
| AnimationHostPerfTest() : fake_client_(FakeLayerTreeHostClient::DIRECT_3D) {} |
| @@ -47,7 +45,9 @@ class AnimationHostPerfTest : public testing::Test { |
| FakeLayerTreeHostClient fake_client_; |
| }; |
| -TEST_F(AnimationHostPerfTest, PushPropertiesTo) { |
| +TEST_F(AnimationHostPerfTest, PushPlayersPropertiesTo) { |
| + static const int kNumberOfAnimationPlayers = 1000; |
| + |
| AnimationHost* host = layer_tree_host_->animation_host(); |
| AnimationHost* host_impl = layer_tree_host_->host_impl()->animation_host(); |
| @@ -97,4 +97,56 @@ TEST_F(AnimationHostPerfTest, PushPropertiesTo) { |
| "runs/s", true); |
| } |
| +TEST_F(AnimationHostPerfTest, PushSeveralTimelinesPropertiesTo) { |
| + static const int kNumberOfAnimationTimelines = 10; |
| + |
| + AnimationHost* host = layer_tree_host_->animation_host(); |
| + AnimationHost* host_impl = layer_tree_host_->host_impl()->animation_host(); |
| + |
| + for (int i = 0; i < kNumberOfAnimationTimelines; ++i) { |
| + scoped_refptr<AnimationTimeline> timeline = |
| + AnimationTimeline::Create(AnimationIdProvider::NextTimelineId()); |
| + host->AddAnimationTimeline(timeline); |
| + |
| + scoped_refptr<AnimationTimeline> timeline_impl = |
| + timeline->CreateImplInstance(); |
| + host_impl->AddAnimationTimeline(timeline_impl); |
| + } |
| + |
| + timer_.Reset(); |
| + do { |
| + host->PushPropertiesTo(host_impl); |
| + timer_.NextLap(); |
| + } while (!timer_.HasTimeLimitExpired()); |
| + |
| + perf_test::PrintResult("push_properties_to", "", "", timer_.LapsPerSecond(), |
| + "runs/s", true); |
| +} |
| + |
| +TEST_F(AnimationHostPerfTest, PushManyTimelinesPropertiesTo) { |
| + static const int kNumberOfAnimationTimelines = 1000; |
| + |
| + AnimationHost* host = layer_tree_host_->animation_host(); |
| + AnimationHost* host_impl = layer_tree_host_->host_impl()->animation_host(); |
| + |
| + for (int i = 0; i < kNumberOfAnimationTimelines; ++i) { |
| + scoped_refptr<AnimationTimeline> timeline = |
| + AnimationTimeline::Create(AnimationIdProvider::NextTimelineId()); |
| + host->AddAnimationTimeline(timeline); |
| + |
| + scoped_refptr<AnimationTimeline> timeline_impl = |
| + timeline->CreateImplInstance(); |
| + host_impl->AddAnimationTimeline(timeline_impl); |
| + } |
| + |
| + timer_.Reset(); |
| + do { |
| + host->PushPropertiesTo(host_impl); |
| + timer_.NextLap(); |
| + } while (!timer_.HasTimeLimitExpired()); |
| + |
| + perf_test::PrintResult("push_properties_to", "", "", timer_.LapsPerSecond(), |
| + "runs/s", true); |
|
ajuma
2016/03/22 13:28:27
A couple nits:
1) These two tests have the same lo
|
| +} |
| + |
| } // namespace cc |