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/trees/layer_tree_host_common.h" | 5 #include "cc/trees/layer_tree_host_common.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 74 |
75 protected: | 75 protected: |
76 FakeContentLayerClient content_layer_client_; | 76 FakeContentLayerClient content_layer_client_; |
77 LapTimer timer_; | 77 LapTimer timer_; |
78 std::string test_name_; | 78 std::string test_name_; |
79 std::string json_; | 79 std::string json_; |
80 }; | 80 }; |
81 | 81 |
82 class CalcDrawPropsTest : public LayerTreeHostCommonPerfTest { | 82 class CalcDrawPropsTest : public LayerTreeHostCommonPerfTest { |
83 public: | 83 public: |
84 void RunCalcDrawProps() { RunTest(CompositorMode::SingleThreaded, false); } | 84 void RunCalcDrawProps() { RunTest(CompositorMode::SINGLE_THREADED, false); } |
85 | 85 |
86 void BeginTest() override { PostSetNeedsCommitToMainThread(); } | 86 void BeginTest() override { PostSetNeedsCommitToMainThread(); } |
87 | 87 |
88 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { | 88 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { |
89 timer_.Reset(); | 89 timer_.Reset(); |
90 LayerTreeImpl* active_tree = host_impl->active_tree(); | 90 LayerTreeImpl* active_tree = host_impl->active_tree(); |
91 | 91 |
92 do { | 92 do { |
93 bool can_render_to_separate_surface = true; | 93 bool can_render_to_separate_surface = true; |
94 int max_texture_size = 8096; | 94 int max_texture_size = 8096; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 host_impl->settings().layer_transforms_should_scale_layer_contents, | 127 host_impl->settings().layer_transforms_should_scale_layer_contents, |
128 verify_property_trees, use_property_trees, &update_list, | 128 verify_property_trees, use_property_trees, &update_list, |
129 active_tree->current_render_surface_list_id(), &property_trees); | 129 active_tree->current_render_surface_list_id(), &property_trees); |
130 LayerTreeHostCommon::CalculateDrawProperties(&inputs); | 130 LayerTreeHostCommon::CalculateDrawProperties(&inputs); |
131 } | 131 } |
132 }; | 132 }; |
133 | 133 |
134 class BspTreePerfTest : public CalcDrawPropsTest { | 134 class BspTreePerfTest : public CalcDrawPropsTest { |
135 public: | 135 public: |
136 BspTreePerfTest() : num_duplicates_(1) {} | 136 BspTreePerfTest() : num_duplicates_(1) {} |
137 void RunSortLayers() { RunTest(CompositorMode::SingleThreaded, false); } | 137 void RunSortLayers() { RunTest(CompositorMode::SINGLE_THREADED, false); } |
138 | 138 |
139 void SetNumberOfDuplicates(int num_duplicates) { | 139 void SetNumberOfDuplicates(int num_duplicates) { |
140 num_duplicates_ = num_duplicates; | 140 num_duplicates_ = num_duplicates; |
141 } | 141 } |
142 | 142 |
143 void BeginTest() override { PostSetNeedsCommitToMainThread(); } | 143 void BeginTest() override { PostSetNeedsCommitToMainThread(); } |
144 | 144 |
145 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { | 145 void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { |
146 LayerTreeImpl* active_tree = host_impl->active_tree(); | 146 LayerTreeImpl* active_tree = host_impl->active_tree(); |
147 // First build the tree and then we'll start running tests on layersorter | 147 // First build the tree and then we'll start running tests on layersorter |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 | 265 |
266 TEST_F(BspTreePerfTest, BspTreeCubes_4) { | 266 TEST_F(BspTreePerfTest, BspTreeCubes_4) { |
267 SetTestName("bsp_tree_cubes_4"); | 267 SetTestName("bsp_tree_cubes_4"); |
268 SetNumberOfDuplicates(4); | 268 SetNumberOfDuplicates(4); |
269 ReadTestFile("layer_sort_cubes"); | 269 ReadTestFile("layer_sort_cubes"); |
270 RunSortLayers(); | 270 RunSortLayers(); |
271 } | 271 } |
272 | 272 |
273 } // namespace | 273 } // namespace |
274 } // namespace cc | 274 } // namespace cc |
OLD | NEW |