| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <deque> | 7 #include <deque> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 | 10 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 protected: | 74 protected: |
| 75 FakeContentLayerClient content_layer_client_; | 75 FakeContentLayerClient content_layer_client_; |
| 76 LapTimer timer_; | 76 LapTimer timer_; |
| 77 std::string test_name_; | 77 std::string test_name_; |
| 78 std::string json_; | 78 std::string json_; |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 class CalcDrawPropsTest : public LayerTreeHostCommonPerfTest { | 81 class CalcDrawPropsTest : public LayerTreeHostCommonPerfTest { |
| 82 public: | 82 public: |
| 83 void RunCalcDrawProps() { RunTest(CompositorMode::SINGLE_THREADED, false); } | 83 void RunCalcDrawProps() { RunTest(CompositorMode::SINGLE_THREADED); } |
| 84 | 84 |
| 85 void BeginTest() override { PostSetNeedsCommitToMainThread(); } | 85 void BeginTest() override { PostSetNeedsCommitToMainThread(); } |
| 86 | 86 |
| 87 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { | 87 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { |
| 88 timer_.Reset(); | 88 timer_.Reset(); |
| 89 LayerTreeImpl* active_tree = host_impl->active_tree(); | 89 LayerTreeImpl* active_tree = host_impl->active_tree(); |
| 90 | 90 |
| 91 do { | 91 do { |
| 92 bool can_render_to_separate_surface = true; | 92 bool can_render_to_separate_surface = true; |
| 93 int max_texture_size = 8096; | 93 int max_texture_size = 8096; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 121 false, // do not verify_clip_tree_calculation for perf tests | 121 false, // do not verify_clip_tree_calculation for perf tests |
| 122 false, // do not verify_transform_tree_calculation for perf tests | 122 false, // do not verify_transform_tree_calculation for perf tests |
| 123 &update_list, active_tree->property_trees()); | 123 &update_list, active_tree->property_trees()); |
| 124 LayerTreeHostCommon::CalculateDrawProperties(&inputs); | 124 LayerTreeHostCommon::CalculateDrawProperties(&inputs); |
| 125 } | 125 } |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 class BspTreePerfTest : public CalcDrawPropsTest { | 128 class BspTreePerfTest : public CalcDrawPropsTest { |
| 129 public: | 129 public: |
| 130 BspTreePerfTest() : num_duplicates_(1) {} | 130 BspTreePerfTest() : num_duplicates_(1) {} |
| 131 void RunSortLayers() { RunTest(CompositorMode::SINGLE_THREADED, false); } | 131 void RunSortLayers() { RunTest(CompositorMode::SINGLE_THREADED); } |
| 132 | 132 |
| 133 void SetNumberOfDuplicates(int num_duplicates) { | 133 void SetNumberOfDuplicates(int num_duplicates) { |
| 134 num_duplicates_ = num_duplicates; | 134 num_duplicates_ = num_duplicates; |
| 135 } | 135 } |
| 136 | 136 |
| 137 void BeginTest() override { PostSetNeedsCommitToMainThread(); } | 137 void BeginTest() override { PostSetNeedsCommitToMainThread(); } |
| 138 | 138 |
| 139 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { | 139 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { |
| 140 LayerTreeImpl* active_tree = host_impl->active_tree(); | 140 LayerTreeImpl* active_tree = host_impl->active_tree(); |
| 141 // First build the tree and then we'll start running tests on layersorter | 141 // First build the tree and then we'll start running tests on layersorter |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 247 |
| 248 TEST_F(BspTreePerfTest, BspTreeCubes_4) { | 248 TEST_F(BspTreePerfTest, BspTreeCubes_4) { |
| 249 SetTestName("bsp_tree_cubes_4"); | 249 SetTestName("bsp_tree_cubes_4"); |
| 250 SetNumberOfDuplicates(4); | 250 SetNumberOfDuplicates(4); |
| 251 ReadTestFile("layer_sort_cubes"); | 251 ReadTestFile("layer_sort_cubes"); |
| 252 RunSortLayers(); | 252 RunSortLayers(); |
| 253 } | 253 } |
| 254 | 254 |
| 255 } // namespace | 255 } // namespace |
| 256 } // namespace cc | 256 } // namespace cc |
| OLD | NEW |