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

Side by Side Diff: tests/PathOpsLineParametetersTest.cpp

Issue 19183003: path ops near exact (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: remove unused static function Created 7 years, 5 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/PathOpsExtendedTest.cpp ('k') | tests/PathOpsOpCubicThreadedTest.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 "SkLineParameters.h" 7 #include "SkLineParameters.h"
8 #include "Test.h" 8 #include "Test.h"
9 9
10 // tests to verify that distance calculations are coded correctly 10 // tests to verify that distance calculations are coded correctly
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 distSq, answersSq, normalSquared); 61 distSq, answersSq, normalSquared);
62 } 62 }
63 lineParameters.normalize(); 63 lineParameters.normalize();
64 double normalizedDistance[2]; 64 double normalizedDistance[2];
65 normalizedDistance[0] = lineParameters.controlPtDistance(cubic, 1); 65 normalizedDistance[0] = lineParameters.controlPtDistance(cubic, 1);
66 normalizedDistance[1] = lineParameters.controlPtDistance(cubic, 2); 66 normalizedDistance[1] = lineParameters.controlPtDistance(cubic, 2);
67 for (inner = 0; inner < 2; ++inner) { 67 for (inner = 0; inner < 2; ++inner) {
68 if (AlmostEqualUlps(fabs(normalizedDistance[inner]), answers[index][ inner])) { 68 if (AlmostEqualUlps(fabs(normalizedDistance[inner]), answers[index][ inner])) {
69 continue; 69 continue;
70 } 70 }
71 SkDebugf("%s [%d,%d] normalizedDistance:%1.10g != answer:%g\n", 71 SkDebugf("%s [%d,%d] normalizedDistance:%1.9g != answer:%g\n",
72 __FUNCTION__, static_cast<int>(index), (int)inner, 72 __FUNCTION__, static_cast<int>(index), (int)inner,
73 normalizedDistance[inner], answers[index][inner]); 73 normalizedDistance[inner], answers[index][inner]);
74 REPORTER_ASSERT(reporter, 0); 74 REPORTER_ASSERT(reporter, 0);
75 } 75 }
76 } 76 }
77 } 77 }
78 78
79 #include "TestClassDef.h" 79 #include "TestClassDef.h"
80 DEFINE_TESTCLASS_SHORT(PathOpsLineParametersTest) 80 DEFINE_TESTCLASS_SHORT(PathOpsLineParametersTest)
OLDNEW
« no previous file with comments | « tests/PathOpsExtendedTest.cpp ('k') | tests/PathOpsOpCubicThreadedTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698