| 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 <deque> | 7 #include <deque> |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 ASSERT_TRUE(base::ReadFileToString(json_file, &json_)); | 48 ASSERT_TRUE(base::ReadFileToString(json_file, &json_)); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void SetupTree() override { | 51 void SetupTree() override { |
| 52 gfx::Size viewport = gfx::Size(720, 1038); | 52 gfx::Size viewport = gfx::Size(720, 1038); |
| 53 layer_tree_host()->SetViewportSize(viewport); | 53 layer_tree_host()->SetViewportSize(viewport); |
| 54 scoped_refptr<Layer> root = | 54 scoped_refptr<Layer> root = |
| 55 ParseTreeFromJson(json_, &content_layer_client_); | 55 ParseTreeFromJson(json_, &content_layer_client_); |
| 56 ASSERT_TRUE(root.get()); | 56 ASSERT_TRUE(root.get()); |
| 57 layer_tree_host()->SetRootLayer(root); | 57 layer_tree_host()->SetRootLayer(root); |
| 58 content_layer_client_.set_bounds(viewport); |
| 58 } | 59 } |
| 59 | 60 |
| 60 void SetTestName(const std::string& name) { test_name_ = name; } | 61 void SetTestName(const std::string& name) { test_name_ = name; } |
| 61 | 62 |
| 62 void AfterTest() override { | 63 void AfterTest() override { |
| 63 CHECK(!test_name_.empty()) << "Must SetTestName() before TearDown()."; | 64 CHECK(!test_name_.empty()) << "Must SetTestName() before TearDown()."; |
| 64 perf_test::PrintResult("calc_draw_props_time", | 65 perf_test::PrintResult("calc_draw_props_time", |
| 65 "", | 66 "", |
| 66 test_name_, | 67 test_name_, |
| 67 1000 * timer_.MsPerLap(), | 68 1000 * timer_.MsPerLap(), |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 | 262 |
| 262 TEST_F(BspTreePerfTest, BspTreeCubes_4) { | 263 TEST_F(BspTreePerfTest, BspTreeCubes_4) { |
| 263 SetTestName("bsp_tree_cubes_4"); | 264 SetTestName("bsp_tree_cubes_4"); |
| 264 SetNumberOfDuplicates(4); | 265 SetNumberOfDuplicates(4); |
| 265 ReadTestFile("layer_sort_cubes"); | 266 ReadTestFile("layer_sort_cubes"); |
| 266 RunSortLayers(); | 267 RunSortLayers(); |
| 267 } | 268 } |
| 268 | 269 |
| 269 } // namespace | 270 } // namespace |
| 270 } // namespace cc | 271 } // namespace cc |
| OLD | NEW |