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

Side by Side Diff: tests/PathOpsQuadLineIntersectionTest.cpp

Issue 23542056: path ops work in progress (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: verbose + mutex around file number access Created 7 years, 2 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/PathOpsQuadIntersectionTestData.cpp ('k') | tests/PathOpsSimplifyTest.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 "PathOpsTestCommon.h" 8 #include "PathOpsTestCommon.h"
9 #include "SkIntersections.h" 9 #include "SkIntersections.h"
10 #include "SkPathOpsLine.h" 10 #include "SkPathOpsLine.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 SkASSERT(ValidQuad(quad)); 78 SkASSERT(ValidQuad(quad));
79 const SkDLine& line = oneOffs[index].line; 79 const SkDLine& line = oneOffs[index].line;
80 SkASSERT(ValidLine(line)); 80 SkASSERT(ValidLine(line));
81 SkIntersections intersections; 81 SkIntersections intersections;
82 int result = doIntersect(intersections, quad, line, flipped); 82 int result = doIntersect(intersections, quad, line, flipped);
83 for (int inner = 0; inner < result; ++inner) { 83 for (int inner = 0; inner < result; ++inner) {
84 double quadT = intersections[0][inner]; 84 double quadT = intersections[0][inner];
85 SkDPoint quadXY = quad.ptAtT(quadT); 85 SkDPoint quadXY = quad.ptAtT(quadT);
86 double lineT = intersections[1][inner]; 86 double lineT = intersections[1][inner];
87 SkDPoint lineXY = line.ptAtT(lineT); 87 SkDPoint lineXY = line.ptAtT(lineT);
88 if (!quadXY.approximatelyEqual(lineXY)) {
89 quadXY.approximatelyEqual(lineXY);
90 SkDebugf("");
91 }
88 REPORTER_ASSERT(reporter, quadXY.approximatelyEqual(lineXY)); 92 REPORTER_ASSERT(reporter, quadXY.approximatelyEqual(lineXY));
89 } 93 }
90 } 94 }
91 } 95 }
92 96
93 static void PathOpsQuadLineIntersectionTestOne(skiatest::Reporter* reporter) { 97 static void PathOpsQuadLineIntersectionTestOne(skiatest::Reporter* reporter) {
94 testOneOffs(reporter); 98 testOneOffs(reporter);
95 } 99 }
96 100
97 static void PathOpsQuadLineIntersectionTest(skiatest::Reporter* reporter) { 101 static void PathOpsQuadLineIntersectionTest(skiatest::Reporter* reporter) {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 REPORTER_ASSERT(reporter, 0); 142 REPORTER_ASSERT(reporter, 0);
139 } 143 }
140 } 144 }
141 } 145 }
142 } 146 }
143 147
144 #include "TestClassDef.h" 148 #include "TestClassDef.h"
145 DEFINE_TESTCLASS_SHORT(PathOpsQuadLineIntersectionTest) 149 DEFINE_TESTCLASS_SHORT(PathOpsQuadLineIntersectionTest)
146 150
147 DEFINE_TESTCLASS_SHORT(PathOpsQuadLineIntersectionTestOne) 151 DEFINE_TESTCLASS_SHORT(PathOpsQuadLineIntersectionTestOne)
OLDNEW
« no previous file with comments | « tests/PathOpsQuadIntersectionTestData.cpp ('k') | tests/PathOpsSimplifyTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698