Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: cc/trees/layer_tree_host_common_perftest.cc

Issue 2251143002: cc: Reland Move data to LayerTree from LayerTreeHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: better fix? Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 void ReadTestFile(const std::string& name) { 45 void ReadTestFile(const std::string& name) {
46 base::FilePath test_data_dir; 46 base::FilePath test_data_dir;
47 ASSERT_TRUE(PathService::Get(CCPaths::DIR_TEST_DATA, &test_data_dir)); 47 ASSERT_TRUE(PathService::Get(CCPaths::DIR_TEST_DATA, &test_data_dir));
48 base::FilePath json_file = test_data_dir.AppendASCII(name + ".json"); 48 base::FilePath json_file = test_data_dir.AppendASCII(name + ".json");
49 ASSERT_TRUE(base::ReadFileToString(json_file, &json_)); 49 ASSERT_TRUE(base::ReadFileToString(json_file, &json_));
50 } 50 }
51 51
52 void SetupTree() override { 52 void SetupTree() override {
53 gfx::Size viewport = gfx::Size(720, 1038); 53 gfx::Size viewport = gfx::Size(720, 1038);
54 layer_tree_host()->SetViewportSize(viewport); 54 layer_tree()->SetViewportSize(viewport);
55 scoped_refptr<Layer> root = 55 scoped_refptr<Layer> root =
56 ParseTreeFromJson(json_, &content_layer_client_); 56 ParseTreeFromJson(json_, &content_layer_client_);
57 ASSERT_TRUE(root.get()); 57 ASSERT_TRUE(root.get());
58 layer_tree_host()->SetRootLayer(root); 58 layer_tree()->SetRootLayer(root);
59 content_layer_client_.set_bounds(viewport); 59 content_layer_client_.set_bounds(viewport);
60 } 60 }
61 61
62 void SetTestName(const std::string& name) { test_name_ = name; } 62 void SetTestName(const std::string& name) { test_name_ = name; }
63 63
64 void AfterTest() override { 64 void AfterTest() override {
65 CHECK(!test_name_.empty()) << "Must SetTestName() before TearDown()."; 65 CHECK(!test_name_.empty()) << "Must SetTestName() before TearDown().";
66 perf_test::PrintResult("calc_draw_props_time", 66 perf_test::PrintResult("calc_draw_props_time",
67 "", 67 "",
68 test_name_, 68 test_name_,
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698