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

Side by Side Diff: tests/PathOpsCubicLineIntersectionTest.cpp

Issue 1107353004: align top and bounds computations (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up code Created 5 years, 7 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/PathOpsBoundsTest.cpp ('k') | tests/PathOpsDCubicTest.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, 6}, {1.0851458311080933, 4.3722810745239258}, {1.5815209150314331, 3. 038947582244873}, {1.9683018922805786, 1.9999997615814209}}},
53 {{{3,2}, {1,2}}}},
54
52 {{{{0.468027353,4}, {1.06734705,1.33333337}, {1.36700678,0}, {3,0}}}, 55 {{{{0.468027353,4}, {1.06734705,1.33333337}, {1.36700678,0}, {3,0}}},
53 {{{2,1}, {0,1}}}}, 56 {{{2,1}, {0,1}}}},
54 57
55 {{{{-634.60540771484375, -481.262939453125}, {266.2696533203125, -752.708679 19921875}, 58 {{{{-634.60540771484375, -481.262939453125}, {266.2696533203125, -752.708679 19921875},
56 {-751.8370361328125, -317.37921142578125}, {-969.7427978515625, 824. 7255859375}}}, 59 {-751.8370361328125, -317.37921142578125}, {-969.7427978515625, 824. 7255859375}}},
57 {{{-287.9506133720805678, -557.1376476615772617}, 60 {{{-287.9506133720805678, -557.1376476615772617},
58 {-285.9506133720805678, -557.1376476615772617}}}}, 61 {-285.9506133720805678, -557.1376476615772617}}}},
59 62
60 {{{{36.7184372,0.888650894}, {36.7184372,0.888650894}, {35.1233864,0.5540154 58}, 63 {{{{36.7184372,0.888650894}, {36.7184372,0.888650894}, {35.1233864,0.5540154 58},
61 {34.5114098,-0.115255356}}}, {{{35.4531212,0}, {31.9375,0}}}}, 64 {34.5114098,-0.115255356}}}, {{{35.4531212,0}, {31.9375,0}}}},
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 189
187 DEF_TEST(PathOpsCubicLineIntersectionOneOff, reporter) { 190 DEF_TEST(PathOpsCubicLineIntersectionOneOff, reporter) {
188 int iIndex = 0; 191 int iIndex = 0;
189 testOne(reporter, iIndex); 192 testOne(reporter, iIndex);
190 const SkDCubic& cubic = lineCubicTests[iIndex].cubic; 193 const SkDCubic& cubic = lineCubicTests[iIndex].cubic;
191 const SkDLine& line = lineCubicTests[iIndex].line; 194 const SkDLine& line = lineCubicTests[iIndex].line;
192 SkIntersections i; 195 SkIntersections i;
193 i.intersect(cubic, line); 196 i.intersect(cubic, line);
194 SkASSERT(i.used() == 1); 197 SkASSERT(i.used() == 1);
195 } 198 }
OLDNEW
« no previous file with comments | « tests/PathOpsBoundsTest.cpp ('k') | tests/PathOpsDCubicTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698