| 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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 EXPECT_EQ(0u, events_sw.size()); | 333 EXPECT_EQ(0u, events_sw.size()); |
| 334 } else { | 334 } else { |
| 335 frames = &events_sw; | 335 frames = &events_sw; |
| 336 EXPECT_EQ(0u, events_gpu.size()); | 336 EXPECT_EQ(0u, events_gpu.size()); |
| 337 } | 337 } |
| 338 ASSERT_GT(frames->size(), 20u); | 338 ASSERT_GT(frames->size(), 20u); |
| 339 // Cull a few leading and trailing events as they might be unreliable. | 339 // Cull a few leading and trailing events as they might be unreliable. |
| 340 TraceEventVector rate_events(frames->begin() + kIgnoreSomeFrames, | 340 TraceEventVector rate_events(frames->begin() + kIgnoreSomeFrames, |
| 341 frames->end() - kIgnoreSomeFrames); | 341 frames->end() - kIgnoreSomeFrames); |
| 342 trace_analyzer::RateStats stats; | 342 trace_analyzer::RateStats stats; |
| 343 ASSERT_TRUE(GetRateStats(rate_events, &stats)); | 343 ASSERT_TRUE(GetRateStats(rate_events, &stats, NULL)); |
| 344 LOG(INFO) << "FPS = " << 1000000.0 / stats.mean_us; | 344 LOG(INFO) << "FPS = " << 1000000.0 / stats.mean_us; |
| 345 | 345 |
| 346 // Print perf results. | 346 // Print perf results. |
| 347 double mean_ms = stats.mean_us / 1000.0; | 347 double mean_ms = stats.mean_us / 1000.0; |
| 348 double std_dev_ms = stats.standard_deviation_us / 1000.0 / 1000.0; | 348 double std_dev_ms = stats.standard_deviation_us / 1000.0 / 1000.0; |
| 349 std::string trace_name = ran_on_gpu ? "gpu" : "software"; | 349 std::string trace_name = ran_on_gpu ? "gpu" : "software"; |
| 350 std::string mean_and_error = base::StringPrintf("%f,%f", mean_ms, | 350 std::string mean_and_error = base::StringPrintf("%f,%f", mean_ms, |
| 351 std_dev_ms); | 351 std_dev_ms); |
| 352 perf_test::PrintResultMeanAndError(test_name, "", trace_name, | 352 perf_test::PrintResultMeanAndError(test_name, "", trace_name, |
| 353 mean_and_error, "frame_time", true); | 353 mean_and_error, "frame_time", true); |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 | 518 |
| 519 IN_PROC_BROWSER_TEST_F(ThroughputTestSW, CanvasManyImagesSW) { | 519 IN_PROC_BROWSER_TEST_F(ThroughputTestSW, CanvasManyImagesSW) { |
| 520 RunCanvasBenchTest("many_images", kNone); | 520 RunCanvasBenchTest("many_images", kNone); |
| 521 } | 521 } |
| 522 | 522 |
| 523 IN_PROC_BROWSER_TEST_F(ThroughputTestGPU, CanvasManyImagesGPU) { | 523 IN_PROC_BROWSER_TEST_F(ThroughputTestGPU, CanvasManyImagesGPU) { |
| 524 RunCanvasBenchTest("many_images", kNone); | 524 RunCanvasBenchTest("many_images", kNone); |
| 525 } | 525 } |
| 526 | 526 |
| 527 } // namespace | 527 } // namespace |
| OLD | NEW |