Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1226)

Unified Diff: cc/animation/animation_host_perftest.cc

Issue 1823773003: CC Animation: Add perf tests for AnimationHost with AnimationTimelines (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698