OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 start_time_ = base::TimeTicks::HighResNow(); | 42 start_time_ = base::TimeTicks::HighResNow(); |
43 | 43 |
44 if (!start_time_.is_null() && (num_draws_ % kTimeCheckInterval) == 0) { | 44 if (!start_time_.is_null() && (num_draws_ % kTimeCheckInterval) == 0) { |
45 base::TimeDelta elapsed = base::TimeTicks::HighResNow() - start_time_; | 45 base::TimeDelta elapsed = base::TimeTicks::HighResNow() - start_time_; |
46 if (elapsed >= base::TimeDelta::FromMilliseconds(kTimeLimitMillis)) { | 46 if (elapsed >= base::TimeDelta::FromMilliseconds(kTimeLimitMillis)) { |
47 elapsed_ = elapsed; | 47 elapsed_ = elapsed; |
48 EndTest(); | 48 EndTest(); |
49 return; | 49 return; |
50 } | 50 } |
51 } | 51 } |
52 impl->setNeedsRedraw(); | 52 impl->SetNeedsRedraw(); |
53 if (full_damage_each_frame_) | 53 if (full_damage_each_frame_) |
54 impl->SetFullRootLayerDamage(); | 54 impl->SetFullRootLayerDamage(); |
55 } | 55 } |
56 | 56 |
57 virtual void BuildTree() {} | 57 virtual void BuildTree() {} |
58 | 58 |
59 virtual void AfterTest() OVERRIDE { | 59 virtual void AfterTest() OVERRIDE { |
60 // Format matches chrome/test/perf/perf_test.h:PrintResult | 60 // Format matches chrome/test/perf/perf_test.h:PrintResult |
61 printf("*RESULT %s: frames= %.2f runs/s\n", | 61 printf("*RESULT %s: frames= %.2f runs/s\n", |
62 test_name_.c_str(), | 62 test_name_.c_str(), |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 scoped_refptr<Layer> scrollable_; | 136 scoped_refptr<Layer> scrollable_; |
137 }; | 137 }; |
138 | 138 |
139 TEST_F(ScrollingLayerTreePerfTest, LongScrollablePage) { | 139 TEST_F(ScrollingLayerTreePerfTest, LongScrollablePage) { |
140 ReadTestFile("long_scrollable_page"); | 140 ReadTestFile("long_scrollable_page"); |
141 RunTest(false); | 141 RunTest(false); |
142 } | 142 } |
143 | 143 |
144 } // namespace | 144 } // namespace |
145 } // namespace cc | 145 } // namespace cc |
OLD | NEW |