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_util.h" | 6 #include "base/file_util.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 | 265 |
266 #if defined(OS_WIN) | 266 #if defined(OS_WIN) |
267 // Latency test doesn't work on WinXP. crbug.com/128066 | 267 // Latency test doesn't work on WinXP. crbug.com/128066 |
268 if (base::win::OSInfo::GetInstance()->version() == base::win::VERSION_XP) | 268 if (base::win::OSInfo::GetInstance()->version() == base::win::VERSION_XP) |
269 return; | 269 return; |
270 #endif | 270 #endif |
271 | 271 |
272 // Construct queries for searching trace events via TraceAnalyzer. | 272 // Construct queries for searching trace events via TraceAnalyzer. |
273 if (mode_ == kWebGL) { | 273 if (mode_ == kWebGL) { |
274 query_begin_swaps_ = query_instant_ && | 274 query_begin_swaps_ = query_instant_ && |
275 Query::EventName() == Query::String("SwapBuffers") && | 275 Query::EventName() == Query::String("SwapBuffersLantency") && |
276 Query::EventArg("width") != Query::Int(kWebGLCanvasWidth); | 276 Query::EventArg("width") != Query::Int(kWebGLCanvasWidth); |
277 query_end_swaps_ = query_instant_ && | 277 query_end_swaps_ = query_instant_ && |
278 Query::EventName() == Query::String("CompositorSwapBuffersComplete"); | 278 Query::EventName() == Query::String("CompositorSwapBuffersComplete"); |
279 } else if (mode_ == kSoftware) { | 279 } else if (mode_ == kSoftware) { |
280 // Software updates need to have x=0 and y=0 to contain the input color. | 280 // Software updates need to have x=0 and y=0 to contain the input color. |
281 query_begin_swaps_ = query_instant_ && | 281 query_begin_swaps_ = query_instant_ && |
282 Query::EventName() == Query::String("UpdateRect") && | 282 Query::EventName() == Query::String("UpdateRect") && |
283 Query::EventArg("x+y") == Query::Int(0); | 283 Query::EventArg("x+y") == Query::Int(0); |
284 query_end_swaps_ = query_instant_ && | 284 query_end_swaps_ = query_instant_ && |
285 Query::EventName() == Query::String("UpdateRectComplete") && | 285 Query::EventName() == Query::String("UpdateRectComplete") && |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 bool is_software = (mode_ == kSoftware); | 619 bool is_software = (mode_ == kSoftware); |
620 int swap_count = 0; | 620 int swap_count = 0; |
621 for (size_t i = 0; i < events.size(); ++i) { | 621 for (size_t i = 0; i < events.size(); ++i) { |
622 if (events[i]->name == "MouseEventBegin") { | 622 if (events[i]->name == "MouseEventBegin") { |
623 printf("%03d ", events[i]->GetKnownArgAsInt("x")); | 623 printf("%03d ", events[i]->GetKnownArgAsInt("x")); |
624 } else if (events[i]->name == "DoClear") { | 624 } else if (events[i]->name == "DoClear") { |
625 printf("Clr%03d ", events[i]->GetKnownArgAsInt("red")); | 625 printf("Clr%03d ", events[i]->GetKnownArgAsInt("red")); |
626 } else if (events[i]->name == "DoBlit") { | 626 } else if (events[i]->name == "DoBlit") { |
627 // WebGL context swap buffers. | 627 // WebGL context swap buffers. |
628 printf("BLT "); | 628 printf("BLT "); |
629 } else if (events[i]->name == "SwapBuffers") { | 629 } else if (events[i]->name == "SwapBuffersLatency") { |
630 // Compositor context swap buffers. | 630 // Compositor context swap buffers. |
631 ++swap_count; | 631 ++swap_count; |
632 printf("|\nframe %03d: ", swap_count + 1); | 632 printf("|\nframe %03d: ", swap_count + 1); |
633 } else if (is_software && events[i]->name == "UpdateRect") { | 633 } else if (is_software && events[i]->name == "UpdateRect") { |
634 ++swap_count; | 634 ++swap_count; |
635 printf("(%d)|\nframe %03d: ", | 635 printf("(%d)|\nframe %03d: ", |
636 events[i]->GetKnownArgAsInt("color"), swap_count + 1); | 636 events[i]->GetKnownArgAsInt("color"), swap_count + 1); |
637 } | 637 } |
638 } | 638 } |
639 printf("\n"); | 639 printf("\n"); |
(...skipping 25 matching lines...) Expand all Loading... |
665 INSTANTIATE_TEST_CASE_P(, LatencyTest, ::testing::Values( | 665 INSTANTIATE_TEST_CASE_P(, LatencyTest, ::testing::Values( |
666 0, | 666 0, |
667 kInputHeavy, | 667 kInputHeavy, |
668 kInputHeavy | kInputDirty | kRafHeavy, | 668 kInputHeavy | kInputDirty | kRafHeavy, |
669 kInputHeavy | kInputDirty | kRafHeavy | kPaintHeavy, | 669 kInputHeavy | kInputDirty | kRafHeavy | kPaintHeavy, |
670 kInputDirty | kPaintHeavy, | 670 kInputDirty | kPaintHeavy, |
671 kInputDirty | kRafHeavy | kPaintHeavy | 671 kInputDirty | kRafHeavy | kPaintHeavy |
672 )); | 672 )); |
673 | 673 |
674 } // namespace | 674 } // namespace |
OLD | NEW |