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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 // Trace backwards through the events to find the input event that | 465 // Trace backwards through the events to find the input event that |
466 // matches the glClear that was presented by this SwapBuffers. | 466 // matches the glClear that was presented by this SwapBuffers. |
467 | 467 |
468 // Step 1: Find the last blit (which will be the WebGL blit). | 468 // Step 1: Find the last blit (which will be the WebGL blit). |
469 size_t blit_pos = 0; | 469 size_t blit_pos = 0; |
470 EXPECT_TRUE(FindLastOf(events, query_blits_, begin_swap_pos, | 470 EXPECT_TRUE(FindLastOf(events, query_blits_, begin_swap_pos, |
471 &blit_pos)); | 471 &blit_pos)); |
472 // Skip this SwapBuffers if the blit has already been consumed by a | 472 // Skip this SwapBuffers if the blit has already been consumed by a |
473 // previous SwapBuffers. This means the current frame did not receive | 473 // previous SwapBuffers. This means the current frame did not receive |
474 // an update from WebGL. | 474 // an update from WebGL. |
475 EXPECT_GT(blit_pos, previous_blit_pos); | |
476 if (blit_pos == previous_blit_pos) { | 475 if (blit_pos == previous_blit_pos) { |
477 if (verbose_) | 476 if (verbose_) |
478 printf(" %03d: ERROR\n", swap_count); | 477 printf(" %03d: MISS_BLIT\n", swap_count); |
479 else | 478 else |
480 printf(" ERROR"); | 479 printf(" MISS_BLIT"); |
481 continue; | 480 continue; |
482 } | 481 } |
483 previous_blit_pos = blit_pos; | 482 previous_blit_pos = blit_pos; |
484 | 483 |
485 // Step 2: find the last clear from the WebGL blit. This will be the | 484 // Step 2: find the last clear from the WebGL blit. This will be the |
486 // value of the latest mouse input that has affected this swap. | 485 // value of the latest mouse input that has affected this swap. |
487 size_t clear_pos = 0; | 486 size_t clear_pos = 0; |
488 EXPECT_TRUE(FindLastOf(events, query_clears_, blit_pos, &clear_pos)); | 487 EXPECT_TRUE(FindLastOf(events, query_clears_, blit_pos, &clear_pos)); |
489 mouse_x = events[clear_pos]->GetKnownArgAsInt("red"); | 488 mouse_x = events[clear_pos]->GetKnownArgAsInt("red"); |
490 } else if (mode_ == kSoftware) { | 489 } else if (mode_ == kSoftware) { |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 INSTANTIATE_TEST_CASE_P(, LatencyTest, ::testing::Values( | 666 INSTANTIATE_TEST_CASE_P(, LatencyTest, ::testing::Values( |
668 0, | 667 0, |
669 kInputHeavy, | 668 kInputHeavy, |
670 kInputHeavy | kInputDirty | kRafHeavy, | 669 kInputHeavy | kInputDirty | kRafHeavy, |
671 kInputHeavy | kInputDirty | kRafHeavy | kPaintHeavy, | 670 kInputHeavy | kInputDirty | kRafHeavy | kPaintHeavy, |
672 kInputDirty | kPaintHeavy, | 671 kInputDirty | kPaintHeavy, |
673 kInputDirty | kRafHeavy | kPaintHeavy | 672 kInputDirty | kRafHeavy | kPaintHeavy |
674 )); | 673 )); |
675 | 674 |
676 } // namespace | 675 } // namespace |
OLD | NEW |