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" |
11 #include "cc/debug/lap_timer.h" | 11 #include "cc/debug/lap_timer.h" |
12 #include "cc/layers/layer.h" | 12 #include "cc/layers/layer.h" |
13 #include "cc/test/fake_impl_task_runner_provider.h" | 13 #include "cc/test/fake_impl_task_runner_provider.h" |
14 #include "cc/test/fake_layer_tree_host.h" | 14 #include "cc/test/fake_layer_tree_host.h" |
15 #include "cc/test/fake_layer_tree_host_client.h" | 15 #include "cc/test/fake_layer_tree_host_client.h" |
16 #include "cc/test/fake_layer_tree_host_impl.h" | 16 #include "cc/test/fake_layer_tree_host_impl.h" |
17 #include "cc/test/test_task_graph_runner.h" | 17 #include "cc/test/test_task_graph_runner.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 #include "testing/perf/perf_test.h" | 19 #include "testing/perf/perf_test.h" |
20 | 20 |
21 namespace cc { | 21 namespace cc { |
22 | 22 |
23 class AnimationHostPerfTest : public testing::Test { | 23 class AnimationHostPerfTest : public testing::Test { |
24 public: | |
25 AnimationHostPerfTest() : fake_client_(FakeLayerTreeHostClient::DIRECT_3D) {} | |
26 | |
27 protected: | 24 protected: |
28 void SetUp() override { | 25 void SetUp() override { |
29 LayerTreeSettings settings; | 26 LayerTreeSettings settings; |
30 layer_tree_host_ = | 27 layer_tree_host_ = |
31 FakeLayerTreeHost::Create(&fake_client_, &task_graph_runner_, settings); | 28 FakeLayerTreeHost::Create(&fake_client_, &task_graph_runner_, settings); |
32 layer_tree_host_->InitializeSingleThreaded( | 29 layer_tree_host_->InitializeSingleThreaded( |
33 &fake_client_, base::ThreadTaskRunnerHandle::Get(), nullptr); | 30 &fake_client_, base::ThreadTaskRunnerHandle::Get(), nullptr); |
34 | 31 |
35 root_layer_ = Layer::Create(); | 32 root_layer_ = Layer::Create(); |
36 layer_tree_host_->SetRootLayer(root_layer_); | 33 layer_tree_host_->SetRootLayer(root_layer_); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 CreateTimelines(10); | 130 CreateTimelines(10); |
134 DoTest(); | 131 DoTest(); |
135 } | 132 } |
136 | 133 |
137 TEST_F(AnimationHostPerfTest, Push1000TimelinesPropertiesTo) { | 134 TEST_F(AnimationHostPerfTest, Push1000TimelinesPropertiesTo) { |
138 CreateTimelines(1000); | 135 CreateTimelines(1000); |
139 DoTest(); | 136 DoTest(); |
140 } | 137 } |
141 | 138 |
142 } // namespace cc | 139 } // namespace cc |
OLD | NEW |