OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "cc/base/tiling_data.h" | 5 #include "cc/base/tiling_data.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "cc/test/geometry_test_utils.h" | 10 #include "cc/test/geometry_test_utils.h" |
(...skipping 1690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1701 | 1701 |
1702 TestSpiralIterate(__LINE__, tiling_data, consider, ignore, center, expected); | 1702 TestSpiralIterate(__LINE__, tiling_data, consider, ignore, center, expected); |
1703 | 1703 |
1704 // Every rect is empty. | 1704 // Every rect is empty. |
1705 ignore = gfx::Rect(); | 1705 ignore = gfx::Rect(); |
1706 center = gfx::Rect(); | 1706 center = gfx::Rect(); |
1707 consider = gfx::Rect(); | 1707 consider = gfx::Rect(); |
1708 | 1708 |
1709 expected.clear(); | 1709 expected.clear(); |
1710 TestSpiralIterate(__LINE__, tiling_data, consider, ignore, center, expected); | 1710 TestSpiralIterate(__LINE__, tiling_data, consider, ignore, center, expected); |
| 1711 |
| 1712 // Center is just to the left of cover, and off of the tiling's left side. |
| 1713 consider = gfx::Rect(0, 0, 30, 30); |
| 1714 ignore = gfx::Rect(); |
| 1715 center = gfx::Rect(-20, 0, 19, 30); |
| 1716 |
| 1717 // Layout of the tiling data, and expected return order: |
| 1718 // x 0 1 2 |
| 1719 // y.------ |
| 1720 // *0| 3 6 9 |
| 1721 // *1| 2 5 8 |
| 1722 // *2| 1 4 7 |
| 1723 expected.clear(); |
| 1724 |
| 1725 expected.push_back(std::make_pair(0, 2)); |
| 1726 expected.push_back(std::make_pair(0, 1)); |
| 1727 expected.push_back(std::make_pair(0, 0)); |
| 1728 expected.push_back(std::make_pair(1, 2)); |
| 1729 expected.push_back(std::make_pair(1, 1)); |
| 1730 expected.push_back(std::make_pair(1, 0)); |
| 1731 expected.push_back(std::make_pair(2, 2)); |
| 1732 expected.push_back(std::make_pair(2, 1)); |
| 1733 expected.push_back(std::make_pair(2, 0)); |
| 1734 |
| 1735 TestSpiralIterate(__LINE__, tiling_data, consider, ignore, center, expected); |
1711 } | 1736 } |
1712 } // namespace | 1737 } // namespace |
| 1738 |
1713 } // namespace cc | 1739 } // namespace cc |
OLD | NEW |