OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/layers/layer.h" | 5 #include "cc/layers/layer.h" |
6 | 6 |
7 #include "base/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
8 #include "cc/debug/lap_timer.h" | 8 #include "cc/debug/lap_timer.h" |
9 #include "cc/resources/layer_painter.h" | |
10 #include "cc/test/fake_impl_proxy.h" | 9 #include "cc/test/fake_impl_proxy.h" |
11 #include "cc/test/fake_layer_tree_host.h" | 10 #include "cc/test/fake_layer_tree_host.h" |
12 #include "cc/test/fake_layer_tree_host_client.h" | 11 #include "cc/test/fake_layer_tree_host_client.h" |
13 #include "cc/test/fake_layer_tree_host_impl.h" | 12 #include "cc/test/fake_layer_tree_host_impl.h" |
14 #include "cc/test/test_task_graph_runner.h" | 13 #include "cc/test/test_task_graph_runner.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "testing/perf/perf_test.h" | 15 #include "testing/perf/perf_test.h" |
17 | 16 |
18 namespace cc { | 17 namespace cc { |
19 namespace { | 18 namespace { |
20 | 19 |
21 static const int kTimeLimitMillis = 3000; | 20 static const int kTimeLimitMillis = 3000; |
22 static const int kWarmupRuns = 5; | 21 static const int kWarmupRuns = 5; |
23 static const int kTimeCheckInterval = 10; | 22 static const int kTimeCheckInterval = 10; |
24 | 23 |
25 class MockLayerPainter : public LayerPainter { | |
26 public: | |
27 void Paint(SkCanvas* canvas, const gfx::Rect& content_rect) override {} | |
28 }; | |
29 | |
30 | |
31 class LayerPerfTest : public testing::Test { | 24 class LayerPerfTest : public testing::Test { |
32 public: | 25 public: |
33 LayerPerfTest() | 26 LayerPerfTest() |
34 : host_impl_(&proxy_, &shared_bitmap_manager_, &task_graph_runner_), | 27 : host_impl_(&proxy_, &shared_bitmap_manager_, &task_graph_runner_), |
35 fake_client_(FakeLayerTreeHostClient::DIRECT_3D), | 28 fake_client_(FakeLayerTreeHostClient::DIRECT_3D), |
36 timer_(kWarmupRuns, | 29 timer_(kWarmupRuns, |
37 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), | 30 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), |
38 kTimeCheckInterval) {} | 31 kTimeCheckInterval) {} |
39 | 32 |
40 protected: | 33 protected: |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 "", | 108 "", |
116 "props_didnt_change", | 109 "props_didnt_change", |
117 timer_.LapsPerSecond(), | 110 timer_.LapsPerSecond(), |
118 "runs/s", | 111 "runs/s", |
119 true); | 112 true); |
120 } | 113 } |
121 | 114 |
122 | 115 |
123 } // namespace | 116 } // namespace |
124 } // namespace cc | 117 } // namespace cc |
OLD | NEW |