OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 #include "PathOpsExtendedTest.h" | 7 #include "PathOpsExtendedTest.h" |
8 | 8 |
9 #define TEST(name) { name, #name } | 9 #define TEST(name) { name, #name } |
10 | 10 |
(...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1726 pathB.lineTo(704.000000f, 33.0000000f); | 1726 pathB.lineTo(704.000000f, 33.0000000f); |
1727 testPathOp(reporter, path, pathB, kIntersect_PathOp); | 1727 testPathOp(reporter, path, pathB, kIntersect_PathOp); |
1728 #else | 1728 #else |
1729 pathB.lineTo(704.000000f, 33.0000000f); | 1729 pathB.lineTo(704.000000f, 33.0000000f); |
1730 pathB.lineTo(705.000000f, 33.0000000f); | 1730 pathB.lineTo(705.000000f, 33.0000000f); |
1731 pathB.lineTo(719.500000f, 3.00000000f); | 1731 pathB.lineTo(719.500000f, 3.00000000f); |
1732 testPathOp(reporter, path, pathB, kIntersect_PathOp); | 1732 testPathOp(reporter, path, pathB, kIntersect_PathOp); |
1733 #endif | 1733 #endif |
1734 } | 1734 } |
1735 | 1735 |
| 1736 static void skpahrefs_com88(skiatest::Reporter* reporter) { |
| 1737 SkPath path; |
| 1738 path.setFillType(SkPath::kEvenOdd_FillType); |
| 1739 path.moveTo(1099.82886f, 7.17117119f); |
| 1740 path.lineTo(1099.12134f, 7.87867832f); |
| 1741 path.cubicTo(1099.66418f, 8.42157173f, 1100.00000f, 9.17157173f, 1100.00000f
, 10.0000000f); |
| 1742 path.lineTo(1100.00000f, 28.0000000f); |
| 1743 path.cubicTo(1100.00000f, 29.6568546f, 1098.65686f, 31.0000000f, 1097.00000f
, 31.0000000f); |
| 1744 path.lineTo(1088.00000f, 31.0000000f); |
| 1745 path.lineTo(1088.00000f, 32.0000000f); |
| 1746 path.lineTo(1097.00000f, 32.0000000f); |
| 1747 path.quadTo(1098.65686f, 32.0000000f, 1099.82886f, 30.8288002f); |
| 1748 path.quadTo(1101.00000f, 29.6568546f, 1101.00000f, 28.0000000f); |
| 1749 path.lineTo(1101.00000f, 10.0000000f); |
| 1750 path.quadTo(1101.00000f, 8.34314537f, 1099.82886f, 7.17119980f); |
| 1751 path.lineTo(1099.82886f, 7.17117119f); |
| 1752 path.close(); |
| 1753 SkPath pathB; |
| 1754 pathB.setFillType(SkPath::kWinding_FillType); |
| 1755 pathB.moveTo(1101.00000f, 6.00000000f); |
| 1756 pathB.lineTo(1088.00000f, 6.00000000f); |
| 1757 pathB.lineTo(1088.00000f, 19.0000000f); |
| 1758 pathB.lineTo(1101.00000f, 32.0000000f); |
| 1759 testPathOp(reporter, path, pathB, kIntersect_PathOp); |
| 1760 } |
| 1761 |
| 1762 static void skpahrefs_com29(skiatest::Reporter* reporter) { |
| 1763 SkPath path; |
| 1764 path.setFillType(SkPath::kEvenOdd_FillType); |
| 1765 path.moveTo(1037.17114f, 7.17119980f); |
| 1766 path.quadTo(1038.34314f, 6.00000000f, 1040.00000f, 6.00000000f); |
| 1767 path.lineTo(1074.00000f, 6.00000000f); |
| 1768 path.lineTo(1074.00000f, 32.0000000f); |
| 1769 path.lineTo(1040.00000f, 32.0000000f); |
| 1770 path.quadTo(1038.34314f, 32.0000000f, 1037.17114f, 30.8288002f); |
| 1771 path.quadTo(1036.00000f, 29.6568546f, 1036.00000f, 28.0000000f); |
| 1772 path.lineTo(1036.00000f, 10.0000000f); |
| 1773 path.quadTo(1036.00000f, 8.34314537f, 1037.17114f, 7.17119980f); |
| 1774 path.close(); |
| 1775 path.moveTo(1037.00000f, 10.0000000f); |
| 1776 path.cubicTo(1037.00000f, 8.34314537f, 1038.34314f, 7.00000000f, 1040.00000f
, 7.00000000f); |
| 1777 path.lineTo(1073.00000f, 7.00000000f); |
| 1778 path.lineTo(1073.00000f, 31.0000000f); |
| 1779 path.lineTo(1040.00000f, 31.0000000f); |
| 1780 path.cubicTo(1038.34314f, 31.0000000f, 1037.00000f, 29.6568546f, 1037.00000f
, 28.0000000f); |
| 1781 path.lineTo(1037.00000f, 10.0000000f); |
| 1782 path.close(); |
| 1783 SkPath pathB; |
| 1784 pathB.setFillType(SkPath::kWinding_FillType); |
| 1785 pathB.moveTo(1036.00000f, 32.0000000f); |
| 1786 pathB.lineTo(1049.00000f, 19.0000000f); |
| 1787 pathB.lineTo(1073.00000f, 31.0000000f); |
| 1788 pathB.lineTo(1074.00000f, 32.0000000f); |
| 1789 testPathOp(reporter, path, pathB, kIntersect_PathOp); |
| 1790 } |
| 1791 |
| 1792 static void cubicOp85d(skiatest::Reporter* reporter) { |
| 1793 SkPath path; |
| 1794 path.setFillType(SkPath::kWinding_FillType); |
| 1795 path.moveTo(0,1); |
| 1796 path.cubicTo(1,6, 1,0, 6,2); |
| 1797 path.close(); |
| 1798 SkPath pathB; |
| 1799 pathB.setFillType(SkPath::kWinding_FillType); |
| 1800 pathB.moveTo(0,1); |
| 1801 pathB.cubicTo(2,6, 1,0, 6,1); |
| 1802 pathB.close(); |
| 1803 testPathOp(reporter, path, pathB, kDifference_PathOp); |
| 1804 } |
| 1805 |
| 1806 #if 0 // FIXME |
| 1807 // this fails because the pair of nearly coincident cubics intersect at the ends |
| 1808 // but the line connected to one of the cubics at the same point does not inters
ect |
| 1809 // the other |
| 1810 static void skpkkiste_to98(skiatest::Reporter* reporter) { |
| 1811 SkPath path; |
| 1812 path.setFillType(SkPath::kEvenOdd_FillType); |
| 1813 path.moveTo(96, 122); |
| 1814 path.cubicTo(94.6192932f, 122, 93.3692932f, 122.559647f, 92.4644699f, 123.46
447f); |
| 1815 path.lineTo(94.1715698f, 125.17157f); |
| 1816 path.cubicTo(94.8954315f, 124.447708f, 95.8954315f, 124, 97, 124); |
| 1817 path.lineTo(257, 124); |
| 1818 path.cubicTo(258.104553f, 124, 259.104584f, 124.447708f, 259.82843f, 125.171
57f); |
| 1819 path.lineTo(261.535522f, 123.46447f); |
| 1820 path.cubicTo(260.630707f, 122.559647f, 259.380707f, 122, 258, 122); |
| 1821 path.lineTo(96, 122); |
| 1822 path.close(); |
| 1823 SkPath pathB; |
| 1824 pathB.setFillType(SkPath::kWinding_FillType); |
| 1825 pathB.moveTo(258, 122); |
| 1826 pathB.cubicTo(260.761414f, 122, 263, 124.238579f, 263, 127); |
| 1827 pathB.lineTo(263, 284); |
| 1828 pathB.cubicTo(263, 286.761414f, 260.761414f, 289, 258, 289); |
| 1829 pathB.lineTo(96, 289); |
| 1830 pathB.cubicTo(93.2385788f, 289, 91, 286.761414f, 91, 284); |
| 1831 pathB.lineTo(91, 127); |
| 1832 pathB.cubicTo(91, 124.238579f, 93.2385788f, 122, 96, 122); |
| 1833 pathB.lineTo(258, 122); |
| 1834 pathB.close(); |
| 1835 testPathOp(reporter, path, pathB, kIntersect_PathOp); |
| 1836 } |
| 1837 #endif |
| 1838 |
1736 static void (*firstTest)(skiatest::Reporter* ) = 0; | 1839 static void (*firstTest)(skiatest::Reporter* ) = 0; |
1737 | 1840 |
1738 static struct TestDesc tests[] = { | 1841 static struct TestDesc tests[] = { |
| 1842 // TEST(skpkkiste_to98), |
| 1843 TEST(skpahrefs_com29), |
| 1844 TEST(cubicOp85d), |
| 1845 TEST(skpahrefs_com88), |
1739 TEST(skphealth_com76), | 1846 TEST(skphealth_com76), |
1740 TEST(skpancestry_com1), | 1847 TEST(skpancestry_com1), |
1741 TEST(skpbyte_com1), | 1848 TEST(skpbyte_com1), |
1742 TEST(skpeldorado_com_ua1), | 1849 TEST(skpeldorado_com_ua1), |
1743 TEST(skp96prezzi1), | 1850 TEST(skp96prezzi1), |
1744 TEST(skpClip2), | 1851 TEST(skpClip2), |
1745 TEST(skpClip1), | 1852 TEST(skpClip1), |
1746 TEST(cubicOp84d), | 1853 TEST(cubicOp84d), |
1747 TEST(cubicOp83i), | 1854 TEST(cubicOp83i), |
1748 TEST(cubicOp82i), | 1855 TEST(cubicOp82i), |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1893 RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, run
Reverse); | 2000 RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, run
Reverse); |
1894 } | 2001 } |
1895 #ifdef SK_DEBUG | 2002 #ifdef SK_DEBUG |
1896 gDebugMaxWindSum = SK_MaxS32; | 2003 gDebugMaxWindSum = SK_MaxS32; |
1897 gDebugMaxWindValue = SK_MaxS32; | 2004 gDebugMaxWindValue = SK_MaxS32; |
1898 #endif | 2005 #endif |
1899 } | 2006 } |
1900 | 2007 |
1901 #include "TestClassDef.h" | 2008 #include "TestClassDef.h" |
1902 DEFINE_TESTCLASS_SHORT(PathOpsOpTest) | 2009 DEFINE_TESTCLASS_SHORT(PathOpsOpTest) |
OLD | NEW |