OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "cc/base/tiling_data.h" | 10 #include "cc/base/tiling_data.h" |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 expected.push_back(std::make_pair(0, 1)); | 664 expected.push_back(std::make_pair(0, 1)); |
665 expected.push_back(std::make_pair(0, 0)); | 665 expected.push_back(std::make_pair(0, 0)); |
666 expected.push_back(std::make_pair(1, 2)); | 666 expected.push_back(std::make_pair(1, 2)); |
667 expected.push_back(std::make_pair(1, 1)); | 667 expected.push_back(std::make_pair(1, 1)); |
668 expected.push_back(std::make_pair(1, 0)); | 668 expected.push_back(std::make_pair(1, 0)); |
669 expected.push_back(std::make_pair(2, 2)); | 669 expected.push_back(std::make_pair(2, 2)); |
670 expected.push_back(std::make_pair(2, 1)); | 670 expected.push_back(std::make_pair(2, 1)); |
671 expected.push_back(std::make_pair(2, 0)); | 671 expected.push_back(std::make_pair(2, 0)); |
672 | 672 |
673 TestSpiralIterate(__LINE__, tiling_data, consider, ignore, center, expected); | 673 TestSpiralIterate(__LINE__, tiling_data, consider, ignore, center, expected); |
| 674 |
| 675 // Tiling is smaller than tile size and center rect is not intersecting to |
| 676 // tiling rect. |
| 677 TilingData smaller_tiling(gfx::Size(10, 10), gfx::Size(1, 1), false); |
| 678 consider = gfx::Rect(10, 10); |
| 679 ignore = gfx::Rect(); |
| 680 center = gfx::Rect(2, 2, 10, 10); |
| 681 |
| 682 // Layout of the tiling data, and expected return order: |
| 683 // x 0 |
| 684 // y ┌───────┐ |
| 685 // │ 1 │ |
| 686 // 0 │ │ |
| 687 // │ * │ |
| 688 // └───────┘ |
| 689 expected.clear(); |
| 690 expected.push_back(std::make_pair(0, 0)); |
| 691 |
| 692 TestSpiralIterate(__LINE__, smaller_tiling, consider, ignore, center, |
| 693 expected); |
674 } | 694 } |
675 | 695 |
676 } // namespace | 696 } // namespace |
677 | 697 |
678 } // namespace cc | 698 } // namespace cc |
OLD | NEW |