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

Side by Side Diff: tests/PathOpsCubicIntersectionTest.cpp

Issue 2357353002: split tight quads and cubics (Closed)
Patch Set: fix linux build Created 4 years, 3 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
« no previous file with comments | « tests/PathOpsConicLineIntersectionTest.cpp ('k') | tests/PathOpsOpTest.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 "PathOpsCubicIntersectionTestData.h" 7 #include "PathOpsCubicIntersectionTestData.h"
8 #include "PathOpsTestCommon.h" 8 #include "PathOpsTestCommon.h"
9 #include "SkGeometry.h" 9 #include "SkGeometry.h"
10 #include "SkIntersections.h" 10 #include "SkIntersections.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 158
159 {{{18.1312339, 31.6473732}, {95.5711034, 63.5350219}, {92.3283165, 62.0158945}, 159 {{{18.1312339, 31.6473732}, {95.5711034, 63.5350219}, {92.3283165, 62.0158945},
160 {18.5656052, 32.1268808}}}, 160 {18.5656052, 32.1268808}}},
161 {{{97.402018, 35.7169972}, {33.1127443, 25.8935163}, {1.13970027, 54.9424981}, 161 {{{97.402018, 35.7169972}, {33.1127443, 25.8935163}, {1.13970027, 54.9424981},
162 {56.4860195, 60.529264}}}, 162 {56.4860195, 60.529264}}},
163 }; 163 };
164 164
165 const int testSetCount = (int) SK_ARRAY_COUNT(testSet); 165 const int testSetCount = (int) SK_ARRAY_COUNT(testSet);
166 166
167 static const SkDCubic newTestSet[] = { 167 static const SkDCubic newTestSet[] = {
168 { { { 130.0427549999999997, 11417.41309999999976 },{ 130.2331240000000037, 11418 .3192999999992 },{ 131.0370790000000056, 11419 },{ 132, 11419 } } },
169 { { { 132, 11419 },{ 130.8954319999999996, 11419 },{ 130, 11418.10449999999946 } ,{ 130, 11417 } } },
170
168 {{{1,3}, {-1.0564518,1.79032254}, {1.45265341,0.229448318}, {1.45381773,0.229133 77}}}, 171 {{{1,3}, {-1.0564518,1.79032254}, {1.45265341,0.229448318}, {1.45381773,0.229133 77}}},
169 {{{1.45381773,0.22913377}, {1.45425761,0.229014933}, {1.0967741,0.451612949}, {0 ,1}}}, 172 {{{1.45381773,0.22913377}, {1.45425761,0.229014933}, {1.0967741,0.451612949}, {0 ,1}}},
170 173
171 {{{1.64551306f, 3.57876182f}, {0.298127174f, 3.70454836f}, {-0.809808373f, 6.395 24937f}, {-3.66666651f, 13.333334f}}}, 174 {{{1.64551306f, 3.57876182f}, {0.298127174f, 3.70454836f}, {-0.809808373f, 6.395 24937f}, {-3.66666651f, 13.333334f}}},
172 {{{1, 2}, {1, 2}, {-3.66666651f, 13.333334f}, {5, 6}}}, 175 {{{1, 2}, {1, 2}, {-3.66666651f, 13.333334f}, {5, 6}}},
173 176
174 {{{0.0660428554,1.65340209}, {-0.251940489,1.43560803}, {-0.782382965,-0.1962990 91}, {3.33333325,-0.666666627}}}, 177 {{{0.0660428554,1.65340209}, {-0.251940489,1.43560803}, {-0.782382965,-0.1962990 91}, {3.33333325,-0.666666627}}},
175 {{{1,3}, {-1.22353387,1.09411383}, {0.319867611,0.12996155}, {0.886705518,0.1075 43148}}}, 178 {{{1,3}, {-1.22353387,1.09411383}, {0.319867611,0.12996155}, {0.886705518,0.1075 43148}}},
176 179
177 {{{-0.13654758,2.10514426}, {-0.585797966,1.89349782}, {-0.807703257,-0.19230639 9}, {6,-1}}}, 180 {{{-0.13654758,2.10514426}, {-0.585797966,1.89349782}, {-0.807703257,-0.19230639 9}, {6,-1}}},
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 for (int index = firstFail; index < coinSetCount; index += 2) { 694 for (int index = firstFail; index < coinSetCount; index += 2) {
692 coinOneOff(reporter, index); 695 coinOneOff(reporter, index);
693 } 696 }
694 } 697 }
695 698
696 DEF_TEST(PathOpsCubicCoinOneOff, reporter) { 699 DEF_TEST(PathOpsCubicCoinOneOff, reporter) {
697 coinOneOff(reporter, 0); 700 coinOneOff(reporter, 0);
698 } 701 }
699 702
700 DEF_TEST(PathOpsCubicIntersectionOneOff, reporter) { 703 DEF_TEST(PathOpsCubicIntersectionOneOff, reporter) {
701 newOneOff(reporter, 66, 70); 704 newOneOff(reporter, 0, 1);
702 } 705 }
703 706
704 DEF_TEST(PathOpsCubicIntersectionTestsOneOff, reporter) { 707 DEF_TEST(PathOpsCubicIntersectionTestsOneOff, reporter) {
705 testsOneOff(reporter, 10); 708 testsOneOff(reporter, 10);
706 } 709 }
707 710
708 DEF_TEST(PathOpsCubicSelfOneOff, reporter) { 711 DEF_TEST(PathOpsCubicSelfOneOff, reporter) {
709 selfOneOff(reporter, 0); 712 selfOneOff(reporter, 0);
710 } 713 }
711 714
712 DEF_TEST(PathOpsCubicIntersection, reporter) { 715 DEF_TEST(PathOpsCubicIntersection, reporter) {
713 oneOffTests(reporter); 716 oneOffTests(reporter);
714 cubicIntersectionSelfTest(reporter); 717 cubicIntersectionSelfTest(reporter);
715 cubicIntersectionCoinTest(reporter); 718 cubicIntersectionCoinTest(reporter);
716 standardTestCases(reporter); 719 standardTestCases(reporter);
717 if (false) CubicIntersection_IntersectionFinder(); 720 if (false) CubicIntersection_IntersectionFinder();
718 if (false) CubicIntersection_RandTest(reporter); 721 if (false) CubicIntersection_RandTest(reporter);
719 } 722 }
OLDNEW
« no previous file with comments | « tests/PathOpsConicLineIntersectionTest.cpp ('k') | tests/PathOpsOpTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698