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

Side by Side Diff: tests/PathOpsSimplifyTest.cpp

Issue 18058007: path ops work in progress (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: try try again Created 7 years, 5 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 | « tests/PathOpsOpTest.cpp ('k') | tests/PathOpsSkpClipTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2841 matching lines...) Expand 10 before | Expand all | Expand 10 after
2852 path.close(); 2852 path.close();
2853 path.moveTo(0, 6); 2853 path.moveTo(0, 6);
2854 path.lineTo(6, 12); 2854 path.lineTo(6, 12);
2855 path.lineTo(8, 3); 2855 path.lineTo(8, 3);
2856 path.close(); 2856 path.close();
2857 testSimplify(reporter, path); 2857 testSimplify(reporter, path);
2858 } 2858 }
2859 2859
2860 static void testQuadratic58(skiatest::Reporter* reporter) { 2860 static void testQuadratic58(skiatest::Reporter* reporter) {
2861 SkPath path; 2861 SkPath path;
2862 path.moveTo(283.714233f, 240); 2862 path.moveTo(283.714233f, 240);
2863 path.lineTo(283.714233f, 141.299606f); 2863 path.lineTo(283.714233f, 141.299606f);
2864 path.lineTo(303.12088f, 141.299606f); 2864 path.lineTo(303.12088f, 141.299606f);
2865 path.lineTo(330.463562f, 217.659027f); 2865 path.lineTo(330.463562f, 217.659027f);
2866 path.lineTo(358.606506f, 141.299606f); 2866 path.lineTo(358.606506f, 141.299606f);
2867 path.lineTo(362.874634f, 159.705902f); 2867 path.lineTo(362.874634f, 159.705902f);
2868 path.lineTo(335.665344f, 233.397751f); 2868 path.lineTo(335.665344f, 233.397751f);
2869 path.lineTo(322.12738f, 233.397751f); 2869 path.lineTo(322.12738f, 233.397751f);
2870 path.lineTo(295.718353f, 159.505829f); 2870 path.lineTo(295.718353f, 159.505829f);
2871 path.lineTo(295.718353f, 240); 2871 path.lineTo(295.718353f, 240);
2872 path.lineTo(283.714233f, 240); 2872 path.lineTo(283.714233f, 240);
2873 path.close(); 2873 path.close();
2874 path.moveTo(322.935669f, 231.030273f); 2874 path.moveTo(322.935669f, 231.030273f);
2875 path.quadTo(312.832214f, 220.393295f, 312.832214f, 203.454178f); 2875 path.quadTo(312.832214f, 220.393295f, 312.832214f, 203.454178f);
2876 path.quadTo(312.832214f, 186.981888f, 321.73526f, 176.444946f); 2876 path.quadTo(312.832214f, 186.981888f, 321.73526f, 176.444946f);
2877 path.quadTo(330.638306f, 165.90802f, 344.509705f, 165.90802f); 2877 path.quadTo(330.638306f, 165.90802f, 344.509705f, 165.90802f);
2878 path.quadTo(357.647522f, 165.90802f, 364.81665f, 175.244537f); 2878 path.quadTo(357.647522f, 165.90802f, 364.81665f, 175.244537f);
2879 path.lineTo(371.919067f, 205.854996f); 2879 path.lineTo(371.919067f, 205.854996f);
2880 path.lineTo(326.236786f, 205.854996f); 2880 path.lineTo(326.236786f, 205.854996f);
2881 path.quadTo(329.104431f, 231.663818f, 351.512085f, 231.663818f); 2881 path.quadTo(329.104431f, 231.663818f, 351.512085f, 231.663818f);
2882 path.lineTo(322.935669f, 231.030273f); 2882 path.lineTo(322.935669f, 231.030273f);
2883 path.close(); 2883 path.close();
2884 path.moveTo(326.837006f, 195.984955f); 2884 path.moveTo(326.837006f, 195.984955f);
2885 path.lineTo(358.78125f, 195.984955f); 2885 path.lineTo(358.78125f, 195.984955f);
2886 path.quadTo(358.78125f, 175.778046f, 343.709442f, 175.778046f); 2886 path.quadTo(358.78125f, 175.778046f, 343.709442f, 175.778046f);
2887 path.quadTo(328.570923f, 175.778046f, 326.837006f, 195.984955f); 2887 path.quadTo(328.570923f, 175.778046f, 326.837006f, 195.984955f);
2888 path.close(); 2888 path.close();
2889 testSimplify(reporter, path); 2889 testSimplify(reporter, path);
2890 } 2890 }
2891 2891
2892 static void testQuadratic59x(skiatest::Reporter* reporter) { 2892 static void testQuadratic59x(skiatest::Reporter* reporter) {
2893 SkPath path; 2893 SkPath path;
2894 path.setFillType(SkPath::kEvenOdd_FillType); 2894 path.setFillType(SkPath::kEvenOdd_FillType);
2895 path.moveTo(0, 0); 2895 path.moveTo(0, 0);
2896 path.quadTo(0, 0, 0, 0); 2896 path.quadTo(0, 0, 0, 0);
2897 path.lineTo(2, 2); 2897 path.lineTo(2, 2);
2898 path.close(); 2898 path.close();
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
3550 SkPath path; 3550 SkPath path;
3551 path.moveTo(0,2); 3551 path.moveTo(0,2);
3552 path.cubicTo(0,3, 2,1, 4,0); 3552 path.cubicTo(0,3, 2,1, 4,0);
3553 path.close(); 3553 path.close();
3554 path.moveTo(1,2); 3554 path.moveTo(1,2);
3555 path.cubicTo(0,4, 2,0, 3,0); 3555 path.cubicTo(0,4, 2,0, 3,0);
3556 path.close(); 3556 path.close();
3557 testSimplify(reporter, path); 3557 testSimplify(reporter, path);
3558 } 3558 }
3559 3559
3560 #if 01 // FIXME: enable and fix
3561 static void testQuad1(skiatest::Reporter* reporter) { 3560 static void testQuad1(skiatest::Reporter* reporter) {
3562 SkPath path; 3561 SkPath path;
3563 path.moveTo(0,0); 3562 path.moveTo(0,0);
3564 path.quadTo(0,0, 0,1); 3563 path.quadTo(0,0, 0,1);
3565 path.lineTo(1,1); 3564 path.lineTo(1,1);
3566 path.close(); 3565 path.close();
3567 path.moveTo(0,0); 3566 path.moveTo(0,0);
3568 path.quadTo(1,1, 0,2); 3567 path.quadTo(1,1, 0,2);
3569 path.close(); 3568 path.close();
3570 testSimplify(reporter, path); 3569 testSimplify(reporter, path);
3571 } 3570 }
3572 #endif
3573 3571
3574 static void testQuadralateral2(skiatest::Reporter* reporter) { 3572 static void testQuadralateral2(skiatest::Reporter* reporter) {
3575 SkPath path; 3573 SkPath path;
3576 path.moveTo(0, 0); 3574 path.moveTo(0, 0);
3577 path.lineTo(2, 2); 3575 path.lineTo(2, 2);
3578 path.lineTo(0, 3); 3576 path.lineTo(0, 3);
3579 path.lineTo(3, 3); 3577 path.lineTo(3, 3);
3580 path.close(); 3578 path.close();
3581 path.moveTo(2, 0); 3579 path.moveTo(2, 0);
3582 path.lineTo(3, 0); 3580 path.lineTo(3, 0);
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
3804 path.quadTo(3, 1, 0, 3); 3802 path.quadTo(3, 1, 0, 3);
3805 path.lineTo(1, 3); 3803 path.lineTo(1, 3);
3806 path.close(); 3804 path.close();
3807 path.moveTo(2, 0); 3805 path.moveTo(2, 0);
3808 path.lineTo(0, 1); 3806 path.lineTo(0, 1);
3809 path.quadTo(3, 1, 0, 2); 3807 path.quadTo(3, 1, 0, 2);
3810 path.close(); 3808 path.close();
3811 testSimplify(reporter, path); 3809 testSimplify(reporter, path);
3812 } 3810 }
3813 3811
3812 static void skphealth_com76(skiatest::Reporter* reporter) {
3813 SkPath path;
3814 path.setFillType(SkPath::kWinding_FillType);
3815 path.moveTo(708.099182f, 7.09919119f);
3816 path.lineTo(708.099182f, 7.09920025f);
3817 path.quadTo(704.000000f, 11.2010098f, 704.000000f, 17.0000000f);
3818 path.lineTo(704.000000f, 33.0000000f);
3819 path.lineTo(705.000000f, 33.0000000f);
3820 path.lineTo(705.000000f, 17.0000000f);
3821 path.cubicTo(705.000000f, 13.4101496f, 706.455078f, 10.1601505f, 708.807617f , 7.80761385f);
3822 path.lineTo(708.099182f, 7.09919119f);
3823 path.close();
3824 path.moveTo(704.000000f, 3.00000000f);
3825 path.lineTo(704.000000f, 33.0000000f);
3826 path.lineTo(705.000000f, 33.0000000f);
3827 path.lineTo(719.500000f, 3.00000000f);
3828 testSimplify(reporter, path);
3829 }
3830
3814 static void (*firstTest)(skiatest::Reporter* ) = 0; 3831 static void (*firstTest)(skiatest::Reporter* ) = 0;
3815 3832
3816 static TestDesc tests[] = { 3833 static TestDesc tests[] = {
3834 TEST(skphealth_com76),
3817 TEST(testQuadLineIntersect1), 3835 TEST(testQuadLineIntersect1),
3818 TEST(testQuadLineIntersect2), 3836 TEST(testQuadLineIntersect2),
3819 TEST(testQuadLineIntersect3), 3837 TEST(testQuadLineIntersect3),
3820 TEST(testQuad7), 3838 TEST(testQuad7),
3821 TEST(testQuad6), 3839 TEST(testQuad6),
3822 TEST(testQuad5), 3840 TEST(testQuad5),
3823 TEST(testQuad4), 3841 TEST(testQuad4),
3824 TEST(testQuad3), 3842 TEST(testQuad3),
3825 TEST(testQuad2), 3843 TEST(testQuad2),
3826 TEST(testAddTCoincident2), 3844 TEST(testAddTCoincident2),
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
4192 RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, run Reverse); 4210 RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, run Reverse);
4193 } 4211 }
4194 #ifdef SK_DEBUG 4212 #ifdef SK_DEBUG
4195 gDebugMaxWindSum = SK_MaxS32; 4213 gDebugMaxWindSum = SK_MaxS32;
4196 gDebugMaxWindValue = SK_MaxS32; 4214 gDebugMaxWindValue = SK_MaxS32;
4197 #endif 4215 #endif
4198 } 4216 }
4199 4217
4200 #include "TestClassDef.h" 4218 #include "TestClassDef.h"
4201 DEFINE_TESTCLASS_SHORT(PathOpsSimplifyTest) 4219 DEFINE_TESTCLASS_SHORT(PathOpsSimplifyTest)
OLDNEW
« no previous file with comments | « tests/PathOpsOpTest.cpp ('k') | tests/PathOpsSkpClipTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698