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

Unified Diff: tests/PathOpsCubicIntersectionTest.cpp

Issue 19543005: turn off debugging printfs (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: tests/PathOpsCubicIntersectionTest.cpp
diff --git a/tests/PathOpsCubicIntersectionTest.cpp b/tests/PathOpsCubicIntersectionTest.cpp
index c4915e99c9a378c32b121356c8f43bbac08f29aa..487a009a1b04b055e69645dda9022c01bc882415 100644
--- a/tests/PathOpsCubicIntersectionTest.cpp
+++ b/tests/PathOpsCubicIntersectionTest.cpp
@@ -52,9 +52,9 @@ static void standardTestCases(skiatest::Reporter* reporter) {
}
for (int pt = 0; pt < tIntersections.used(); ++pt) {
double tt1 = tIntersections[0][pt];
- SkDPoint xy1 = cubic1.xyAtT(tt1);
+ SkDPoint xy1 = cubic1.ptAtT(tt1);
double tt2 = tIntersections[1][pt];
- SkDPoint xy2 = cubic2.xyAtT(tt2);
+ SkDPoint xy2 = cubic2.ptAtT(tt2);
if (!xy1.approximatelyEqual(xy2)) {
SkDebugf("%s [%d,%d] x!= t1=%g (%g,%g) t2=%g (%g,%g)\n",
__FUNCTION__, (int)index, pt, tt1, xy1.fX, xy1.fY, tt2, xy2.fX, xy2.fY);
@@ -305,9 +305,9 @@ static void oneOff(skiatest::Reporter* reporter, const SkDCubic& cubic1, const S
SkDPoint xy1, xy2;
for (int pt3 = 0; pt3 < intersections.used(); ++pt3) {
tt1 = intersections[0][pt3];
- xy1 = cubic1.xyAtT(tt1);
+ xy1 = cubic1.ptAtT(tt1);
tt2 = intersections[1][pt3];
- xy2 = cubic2.xyAtT(tt2);
+ xy2 = cubic2.ptAtT(tt2);
const SkDPoint& iPt = intersections.pt(pt3);
#if ONE_OFF_DEBUG
SkDebugf("%s t1=%1.9g (%1.9g, %1.9g) (%1.9g, %1.9g) (%1.9g, %1.9g) t2=%1.9g\n",
@@ -391,9 +391,9 @@ static void CubicIntersection_RandTest(skiatest::Reporter* reporter) {
}
for (int pt = 0; pt < intersections2.used(); ++pt) {
double tt1 = intersections2[0][pt];
- SkDPoint xy1 = cubic1.xyAtT(tt1);
+ SkDPoint xy1 = cubic1.ptAtT(tt1);
double tt2 = intersections2[1][pt];
- SkDPoint xy2 = cubic2.xyAtT(tt2);
+ SkDPoint xy2 = cubic2.ptAtT(tt2);
REPORTER_ASSERT(reporter, xy1.approximatelyEqual(xy2));
}
}
@@ -406,12 +406,12 @@ static void intersectionFinder(int index0, int index1, double t1Seed, double t2S
SkDPoint t1[3], t2[3];
bool toggle = true;
do {
- t1[0] = cubic1.xyAtT(t1Seed - t1Step);
- t1[1] = cubic1.xyAtT(t1Seed);
- t1[2] = cubic1.xyAtT(t1Seed + t1Step);
- t2[0] = cubic2.xyAtT(t2Seed - t2Step);
- t2[1] = cubic2.xyAtT(t2Seed);
- t2[2] = cubic2.xyAtT(t2Seed + t2Step);
+ t1[0] = cubic1.ptAtT(t1Seed - t1Step);
+ t1[1] = cubic1.ptAtT(t1Seed);
+ t1[2] = cubic1.ptAtT(t1Seed + t1Step);
+ t2[0] = cubic2.ptAtT(t2Seed - t2Step);
+ t2[1] = cubic2.ptAtT(t2Seed);
+ t2[2] = cubic2.ptAtT(t2Seed + t2Step);
double dist[3][3];
dist[1][1] = t1[1].distance(t2[1]);
int best_i = 1, best_j = 1;
@@ -452,38 +452,38 @@ static void intersectionFinder(int index0, int index1, double t1Seed, double t2S
double t22 = t2Seed + t2Step * 2;
SkDPoint test;
while (!approximately_zero(t1Step)) {
- test = cubic1.xyAtT(t10);
+ test = cubic1.ptAtT(t10);
t10 += t1[1].approximatelyEqual(test) ? -t1Step : t1Step;
t1Step /= 2;
}
t1Step = 0.1;
while (!approximately_zero(t1Step)) {
- test = cubic1.xyAtT(t12);
+ test = cubic1.ptAtT(t12);
t12 -= t1[1].approximatelyEqual(test) ? -t1Step : t1Step;
t1Step /= 2;
}
while (!approximately_zero(t2Step)) {
- test = cubic2.xyAtT(t20);
+ test = cubic2.ptAtT(t20);
t20 += t2[1].approximatelyEqual(test) ? -t2Step : t2Step;
t2Step /= 2;
}
t2Step = 0.1;
while (!approximately_zero(t2Step)) {
- test = cubic2.xyAtT(t22);
+ test = cubic2.ptAtT(t22);
t22 -= t2[1].approximatelyEqual(test) ? -t2Step : t2Step;
t2Step /= 2;
}
#if ONE_OFF_DEBUG
SkDebugf("%s t1=(%1.9g<%1.9g<%1.9g) t2=(%1.9g<%1.9g<%1.9g)\n", __FUNCTION__,
t10, t1Seed, t12, t20, t2Seed, t22);
- SkDPoint p10 = cubic1.xyAtT(t10);
- SkDPoint p1Seed = cubic1.xyAtT(t1Seed);
- SkDPoint p12 = cubic1.xyAtT(t12);
+ SkDPoint p10 = cubic1.ptAtT(t10);
+ SkDPoint p1Seed = cubic1.ptAtT(t1Seed);
+ SkDPoint p12 = cubic1.ptAtT(t12);
SkDebugf("%s p1=(%1.9g,%1.9g)<(%1.9g,%1.9g)<(%1.9g,%1.9g)\n", __FUNCTION__,
p10.fX, p10.fY, p1Seed.fX, p1Seed.fY, p12.fX, p12.fY);
- SkDPoint p20 = cubic2.xyAtT(t20);
- SkDPoint p2Seed = cubic2.xyAtT(t2Seed);
- SkDPoint p22 = cubic2.xyAtT(t22);
+ SkDPoint p20 = cubic2.ptAtT(t20);
+ SkDPoint p2Seed = cubic2.ptAtT(t2Seed);
+ SkDPoint p22 = cubic2.ptAtT(t22);
SkDebugf("%s p2=(%1.9g,%1.9g)<(%1.9g,%1.9g)<(%1.9g,%1.9g)\n", __FUNCTION__,
p20.fX, p20.fY, p2Seed.fX, p2Seed.fY, p22.fX, p22.fY);
#endif
@@ -518,7 +518,7 @@ static void cubicIntersectionSelfTest(skiatest::Reporter* reporter) {
int ts = cubic.findMaxCurvature(max);
for (idx2 = 0; idx2 < ts; ++idx2) {
SkDebugf("%s max[%d]=%1.9g (%1.9g, %1.9g)\n", __FUNCTION__, idx2,
- max[idx2], cubic.xyAtT(max[idx2]).fX, cubic.xyAtT(max[idx2]).fY);
+ max[idx2], cubic.ptAtT(max[idx2]).fX, cubic.ptAtT(max[idx2]).fY);
}
SkTArray<double, true> ts1;
SkTArray<SkDQuad, true> quads1;
@@ -539,8 +539,8 @@ static void cubicIntersectionSelfTest(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, result == 1);
REPORTER_ASSERT(reporter, i.used() == 1);
REPORTER_ASSERT(reporter, !approximately_equal(i[0][0], i[1][0]));
- SkDPoint pt1 = cubic.xyAtT(i[0][0]);
- SkDPoint pt2 = cubic.xyAtT(i[1][0]);
+ SkDPoint pt1 = cubic.ptAtT(i[0][0]);
+ SkDPoint pt2 = cubic.ptAtT(i[1][0]);
REPORTER_ASSERT(reporter, pt1.approximatelyEqual(pt2));
}
}

Powered by Google App Engine
This is Rietveld 408576698