OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // This tool is used to benchmark the render model used by the compositor | 5 // This tool is used to benchmark the render model used by the compositor |
6 | 6 |
7 // Most of this file is derived from the source of the tile_render_bench tool, | 7 // Most of this file is derived from the source of the tile_render_bench tool, |
8 // and has been changed to support running a sequence of independent | 8 // and has been changed to support running a sequence of independent |
9 // simulations for our different render models and test cases. | 9 // simulations for our different render models and test cases. |
10 | 10 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 XCloseDisplay(display_); | 79 XCloseDisplay(display_); |
80 } | 80 } |
81 | 81 |
82 void QueueTest(const base::FilePath& path) { | 82 void QueueTest(const base::FilePath& path) { |
83 SimulationSpecification spec; | 83 SimulationSpecification spec; |
84 | 84 |
85 // To get a std::string, we'll try to get an ASCII simulation name. | 85 // To get a std::string, we'll try to get an ASCII simulation name. |
86 // If the name of the file wasn't ASCII, this will give an empty simulation | 86 // If the name of the file wasn't ASCII, this will give an empty simulation |
87 // name, but that's not really harmful (we'll still warn about it though.) | 87 // name, but that's not really harmful (we'll still warn about it though.) |
88 spec.simulation_name = path.BaseName().RemoveExtension().MaybeAsASCII(); | 88 spec.simulation_name = path.BaseName().RemoveExtension().MaybeAsASCII(); |
89 if (spec.simulation_name == "") { | 89 if (spec.simulation_name.empty()) { |
90 LOG(WARNING) << "Simulation for path " << path.LossyDisplayName() << | 90 LOG(WARNING) << "Simulation for path " << path.LossyDisplayName() << |
91 " will have a blank simulation name, since the file name isn't ASCII"; | 91 " will have a blank simulation name, since the file name isn't ASCII"; |
92 } | 92 } |
93 spec.input_path = path; | 93 spec.input_path = path; |
94 spec.model_under_test = ForwardRenderModel; | 94 spec.model_under_test = ForwardRenderModel; |
95 spec.frames_rendered = 0; | 95 spec.frames_rendered = 0; |
96 | 96 |
97 sims_remaining_.push(spec); | 97 sims_remaining_.push(spec); |
98 | 98 |
99 // The following lines are commented out pending the addition | 99 // The following lines are commented out pending the addition |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 } | 392 } |
393 } else { | 393 } else { |
394 LOG(INFO) << "(input path is a file)"; | 394 LOG(INFO) << "(input path is a file)"; |
395 sim.QueueTest(inPath); | 395 sim.QueueTest(inPath); |
396 } | 396 } |
397 | 397 |
398 sim.Run(); | 398 sim.Run(); |
399 | 399 |
400 return 0; | 400 return 0; |
401 } | 401 } |
OLD | NEW |