| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 sims_remaining_.push(spec); | 98 sims_remaining_.push(spec); |
| 99 | 99 |
| 100 // The following lines are commented out pending the addition | 100 // The following lines are commented out pending the addition |
| 101 // of the new render model once this version gets fully checked in. | 101 // of the new render model once this version gets fully checked in. |
| 102 // | 102 // |
| 103 // spec.model_under_test = KDTreeRenderModel; | 103 // spec.model_under_test = KDTreeRenderModel; |
| 104 // sims_remaining_.push(spec); | 104 // sims_remaining_.push(spec); |
| 105 } | 105 } |
| 106 | 106 |
| 107 void Run() { | 107 void Run() { |
| 108 if (!sims_remaining_.size()) { | 108 if (sims_remaining_.empty()) { |
| 109 LOG(WARNING) << "No configuration files loaded."; | 109 LOG(WARNING) << "No configuration files loaded."; |
| 110 return; | 110 return; |
| 111 } | 111 } |
| 112 | 112 |
| 113 base::AtExitManager at_exit; | 113 base::AtExitManager at_exit; |
| 114 base::MessageLoop loop; | 114 base::MessageLoop loop; |
| 115 if (!InitX11() || !InitGLContext()) { | 115 if (!InitX11() || !InitGLContext()) { |
| 116 LOG(FATAL) << "Failed to set up GUI."; | 116 LOG(FATAL) << "Failed to set up GUI."; |
| 117 } | 117 } |
| 118 | 118 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 if (sims_remaining_.size() && | 314 if (sims_remaining_.size() && |
| 315 sims_remaining_.front().simulation_start_time.is_null()) { | 315 sims_remaining_.front().simulation_start_time.is_null()) { |
| 316 while (sims_remaining_.size() && !InitializeNextTest()) { | 316 while (sims_remaining_.size() && !InitializeNextTest()) { |
| 317 sims_remaining_.pop(); | 317 sims_remaining_.pop(); |
| 318 } | 318 } |
| 319 if (sims_remaining_.size()) { | 319 if (sims_remaining_.size()) { |
| 320 sims_remaining_.front().simulation_start_time = TimeTicks::Now(); | 320 sims_remaining_.front().simulation_start_time = TimeTicks::Now(); |
| 321 } | 321 } |
| 322 } | 322 } |
| 323 | 323 |
| 324 if (!sims_remaining_.size()) { | 324 if (sims_remaining_.empty()) { |
| 325 DumpOutput(); | 325 DumpOutput(); |
| 326 base::MessageLoop::current()->QuitWhenIdle(); | 326 base::MessageLoop::current()->QuitWhenIdle(); |
| 327 return false; | 327 return false; |
| 328 } | 328 } |
| 329 | 329 |
| 330 return true; | 330 return true; |
| 331 } | 331 } |
| 332 | 332 |
| 333 void Resize(int width, int height) { | 333 void Resize(int width, int height) { |
| 334 window_width_ = width; | 334 window_width_ = width; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 } | 393 } |
| 394 } else { | 394 } else { |
| 395 LOG(INFO) << "(input path is a file)"; | 395 LOG(INFO) << "(input path is a file)"; |
| 396 sim.QueueTest(inPath); | 396 sim.QueueTest(inPath); |
| 397 } | 397 } |
| 398 | 398 |
| 399 sim.Run(); | 399 sim.Run(); |
| 400 | 400 |
| 401 return 0; | 401 return 0; |
| 402 } | 402 } |
| OLD | NEW |