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

Side by Side Diff: tests/PathOpsQuadLineIntersectionThreadedTest.cpp

Issue 131103009: update pathops to circle sort (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: disable old test that still fails on linux 32 release Created 6 years, 8 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/PathOpsQuadLineIntersectionTest.cpp ('k') | tests/PathOpsQuadParameterizationTest.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 #include "PathOpsThreadedCommon.h" 8 #include "PathOpsThreadedCommon.h"
9 #include "SkIntersections.h" 9 #include "SkIntersections.h"
10 #include "SkPathOpsLine.h" 10 #include "SkPathOpsLine.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 SkDPoint quadXY = quad.ptAtT(quadT); 58 SkDPoint quadXY = quad.ptAtT(quadT);
59 double lineT = intersections[1][index]; 59 double lineT = intersections[1][index];
60 SkDPoint lineXY = line.ptAtT(lineT); 60 SkDPoint lineXY = line.ptAtT(lineT);
61 if (quadXY.approximatelyEqual(lineXY)) { 61 if (quadXY.approximatelyEqual(lineXY)) {
62 found = true; 62 found = true;
63 } 63 }
64 } 64 }
65 REPORTER_ASSERT(reporter, found); 65 REPORTER_ASSERT(reporter, found);
66 } 66 }
67 67
68
69 // find a point on a quad by choosing a t from 0 to 1 68 // find a point on a quad by choosing a t from 0 to 1
70 // create a vertical span above and below the point 69 // create a vertical span above and below the point
71 // verify that intersecting the vertical span and the quad returns t 70 // verify that intersecting the vertical span and the quad returns t
72 // verify that a vertical span starting at quad[0] intersects at t=0 71 // verify that a vertical span starting at quad[0] intersects at t=0
73 // verify that a vertical span starting at quad[2] intersects at t=1 72 // verify that a vertical span starting at quad[2] intersects at t=1
74 static void testQuadLineIntersectMain(PathOpsThreadState* data) 73 static void testQuadLineIntersectMain(PathOpsThreadState* data)
75 { 74 {
76 PathOpsThreadState& state = *data; 75 PathOpsThreadState& state = *data;
77 REPORTER_ASSERT(state.fReporter, data); 76 REPORTER_ASSERT(state.fReporter, data);
78 int ax = state.fA & 0x03; 77 int ax = state.fA & 0x03;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 for (int c = 0 ; c < 16; ++c) { 118 for (int c = 0 ; c < 16; ++c) {
120 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreaded Runnable, 119 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreaded Runnable,
121 (&testQuadLineIntersectMain, a, b, c, 0, &testRunner )); 120 (&testQuadLineIntersectMain, a, b, c, 0, &testRunner ));
122 } 121 }
123 if (!reporter->allowExtendedTest()) goto finish; 122 if (!reporter->allowExtendedTest()) goto finish;
124 } 123 }
125 } 124 }
126 finish: 125 finish:
127 testRunner.render(); 126 testRunner.render();
128 } 127 }
OLDNEW
« no previous file with comments | « tests/PathOpsQuadLineIntersectionTest.cpp ('k') | tests/PathOpsQuadParameterizationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698