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

Side by Side Diff: tests/PathOpsCubicLineIntersectionTest.cpp

Issue 1037573004: cumulative pathops patch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix pathopsinverse gm Created 5 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
« no previous file with comments | « tests/PathOpsCubicIntersectionTestData.cpp ('k') | tests/PathOpsCubicQuadIntersectionTest.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 "PathOpsTestCommon.h" 7 #include "PathOpsTestCommon.h"
8 #include "SkIntersections.h" 8 #include "SkIntersections.h"
9 #include "SkPathOpsCubic.h" 9 #include "SkPathOpsCubic.h"
10 #include "SkPathOpsLine.h" 10 #include "SkPathOpsLine.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 REPORTER_ASSERT(reporter, 0); 42 REPORTER_ASSERT(reporter, 0);
43 } 43 }
44 if (order1 == 4 && order2 == 2) { 44 if (order1 == 4 && order2 == 2) {
45 SkIntersections i; 45 SkIntersections i;
46 int roots = i.intersect(cubic, line); 46 int roots = i.intersect(cubic, line);
47 REPORTER_ASSERT(reporter, roots == 0); 47 REPORTER_ASSERT(reporter, roots == 0);
48 } 48 }
49 } 49 }
50 50
51 static lineCubic lineCubicTests[] = { 51 static lineCubic lineCubicTests[] = {
52 {{{{0.468027353,4}, {1.06734705,1.33333337}, {1.36700678,0}, {3,0}}},
53 {{{2,1}, {0,1}}}},
54
52 {{{{-634.60540771484375, -481.262939453125}, {266.2696533203125, -752.708679 19921875}, 55 {{{{-634.60540771484375, -481.262939453125}, {266.2696533203125, -752.708679 19921875},
53 {-751.8370361328125, -317.37921142578125}, {-969.7427978515625, 824. 7255859375}}}, 56 {-751.8370361328125, -317.37921142578125}, {-969.7427978515625, 824. 7255859375}}},
54 {{{-287.9506133720805678, -557.1376476615772617}, 57 {{{-287.9506133720805678, -557.1376476615772617},
55 {-285.9506133720805678, -557.1376476615772617}}}}, 58 {-285.9506133720805678, -557.1376476615772617}}}},
56 59
57 {{{{36.7184372,0.888650894}, {36.7184372,0.888650894}, {35.1233864,0.5540154 58}, 60 {{{{36.7184372,0.888650894}, {36.7184372,0.888650894}, {35.1233864,0.5540154 58},
58 {34.5114098,-0.115255356}}}, {{{35.4531212,0}, {31.9375,0}}}}, 61 {34.5114098,-0.115255356}}}, {{{35.4531212,0}, {31.9375,0}}}},
59 62
60 {{{{421, 378}, {421, 380.209137f}, {418.761414f, 382}, {416, 382}}}, 63 {{{{421, 378}, {421, 380.209137f}, {418.761414f, 382}, {416, 382}}},
61 {{{320, 378}, {421, 378.000031f}}}}, 64 {{{320, 378}, {421, 378.000031f}}}},
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 186
184 DEF_TEST(PathOpsCubicLineIntersectionOneOff, reporter) { 187 DEF_TEST(PathOpsCubicLineIntersectionOneOff, reporter) {
185 int iIndex = 0; 188 int iIndex = 0;
186 testOne(reporter, iIndex); 189 testOne(reporter, iIndex);
187 const SkDCubic& cubic = lineCubicTests[iIndex].cubic; 190 const SkDCubic& cubic = lineCubicTests[iIndex].cubic;
188 const SkDLine& line = lineCubicTests[iIndex].line; 191 const SkDLine& line = lineCubicTests[iIndex].line;
189 SkIntersections i; 192 SkIntersections i;
190 i.intersect(cubic, line); 193 i.intersect(cubic, line);
191 SkASSERT(i.used() == 1); 194 SkASSERT(i.used() == 1);
192 } 195 }
OLDNEW
« no previous file with comments | « tests/PathOpsCubicIntersectionTestData.cpp ('k') | tests/PathOpsCubicQuadIntersectionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698