Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(718)

Side by Side Diff: cc/base/tiling_data_unittest.cc

Issue 188863002: cc: Spiral iterator fix for negative center. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/base/tiling_data.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « cc/base/tiling_data.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698