| 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/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 mouse_event.movementX = 1; | 652 mouse_event.movementX = 1; |
| 653 mouse_x_ += mouse_event.movementX; | 653 mouse_x_ += mouse_event.movementX; |
| 654 // Wrap mouse_x_ when it's near the edge of the tab. | 654 // Wrap mouse_x_ when it's near the edge of the tab. |
| 655 if (mouse_x_ > tab_width_ - 5) | 655 if (mouse_x_ > tab_width_ - 5) |
| 656 mouse_x_ = 1; | 656 mouse_x_ = 1; |
| 657 mouse_event.x = mouse_event.windowX = mouse_x_; | 657 mouse_event.x = mouse_event.windowX = mouse_x_; |
| 658 // Set y coordinate to be a few pixels down from the top of the window, | 658 // Set y coordinate to be a few pixels down from the top of the window, |
| 659 // so that it is between the top and bottom of the canvas. | 659 // so that it is between the top and bottom of the canvas. |
| 660 mouse_event.y = mouse_event.windowY = 5; | 660 mouse_event.y = mouse_event.windowY = 5; |
| 661 mouse_event.type = WebKit::WebInputEvent::MouseMove; | 661 mouse_event.type = WebKit::WebInputEvent::MouseMove; |
| 662 TRACE_EVENT_INSTANT1("test_latency", "MouseEventBegin", "x", mouse_x_); | 662 TRACE_EVENT_INSTANT1("test_latency", "MouseEventBegin", |
| 663 TRACE_EVENT_SCOPE_THREAD, "x", mouse_x_); |
| 663 rvh->ForwardMouseEvent(mouse_event); | 664 rvh->ForwardMouseEvent(mouse_event); |
| 664 } | 665 } |
| 665 | 666 |
| 666 void LatencyTest::PrintEvents(const TraceEventVector& events) { | 667 void LatencyTest::PrintEvents(const TraceEventVector& events) { |
| 667 bool is_software = (mode_ == kSoftware); | 668 bool is_software = (mode_ == kSoftware); |
| 668 int swap_count = 0; | 669 int swap_count = 0; |
| 669 for (size_t i = 0; i < events.size(); ++i) { | 670 for (size_t i = 0; i < events.size(); ++i) { |
| 670 if (events[i]->name == "MouseEventBegin") { | 671 if (events[i]->name == "MouseEventBegin") { |
| 671 printf("%03d ", events[i]->GetKnownArgAsInt("x")); | 672 printf("%03d ", events[i]->GetKnownArgAsInt("x")); |
| 672 } else if (events[i]->name == "DoClear") { | 673 } else if (events[i]->name == "DoClear") { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 kInputHeavy | kInputDirty | kRafHeavy, \ | 744 kInputHeavy | kInputDirty | kRafHeavy, \ |
| 744 kInputHeavy | kInputDirty | kRafHeavy | kPaintHeavy, \ | 745 kInputHeavy | kInputDirty | kRafHeavy | kPaintHeavy, \ |
| 745 kInputDirty | kPaintHeavy, \ | 746 kInputDirty | kPaintHeavy, \ |
| 746 kInputDirty | kRafHeavy | kPaintHeavy) | 747 kInputDirty | kRafHeavy | kPaintHeavy) |
| 747 | 748 |
| 748 INSTANTIATE_TEST_CASE_P(, LatencyTestWebGL, LATENCY_SUITE_MODES()); | 749 INSTANTIATE_TEST_CASE_P(, LatencyTestWebGL, LATENCY_SUITE_MODES()); |
| 749 INSTANTIATE_TEST_CASE_P(, LatencyTestWebGLThread, LATENCY_SUITE_MODES()); | 750 INSTANTIATE_TEST_CASE_P(, LatencyTestWebGLThread, LATENCY_SUITE_MODES()); |
| 750 INSTANTIATE_TEST_CASE_P(, LatencyTestSW, LATENCY_SUITE_MODES()); | 751 INSTANTIATE_TEST_CASE_P(, LatencyTestSW, LATENCY_SUITE_MODES()); |
| 751 | 752 |
| 752 } // namespace | 753 } // namespace |
| OLD | NEW |