| OLD | NEW |
| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 {(double) cx, (double) cy}}}; | 84 {(double) cx, (double) cy}}}; |
| 85 SkReduceOrder reducer; | 85 SkReduceOrder reducer; |
| 86 int order = reducer.reduce(quad); | 86 int order = reducer.reduce(quad); |
| 87 if (order < 3) { | 87 if (order < 3) { |
| 88 return; | 88 return; |
| 89 } | 89 } |
| 90 for (int tIndex = 0; tIndex <= 4; ++tIndex) { | 90 for (int tIndex = 0; tIndex <= 4; ++tIndex) { |
| 91 SkDPoint xy = quad.ptAtT(tIndex / 4.0); | 91 SkDPoint xy = quad.ptAtT(tIndex / 4.0); |
| 92 for (int h = -2; h <= 2; ++h) { | 92 for (int h = -2; h <= 2; ++h) { |
| 93 for (int v = -2; v <= 2; ++v) { | 93 for (int v = -2; v <= 2; ++v) { |
| 94 if (h == v && abs(h) != 1) { | 94 if (h == v && SkTAbs(h) != 1) { |
| 95 continue; | 95 continue; |
| 96 } | 96 } |
| 97 double x = xy.fX; | 97 double x = xy.fX; |
| 98 double y = xy.fY; | 98 double y = xy.fY; |
| 99 SkDLine line = {{{x - h, y - v}, {x, y}}}; | 99 SkDLine line = {{{x - h, y - v}, {x, y}}}; |
| 100 testLineIntersect(state.fReporter, quad, line, x, y); | 100 testLineIntersect(state.fReporter, quad, line, x, y); |
| 101 state.fReporter->bumpTestCount(); | 101 state.fReporter->bumpTestCount(); |
| 102 SkDLine line2 = {{{x, y}, {x + h, y + v}}}; | 102 SkDLine line2 = {{{x, y}, {x + h, y + v}}}; |
| 103 testLineIntersect(state.fReporter, quad, line2, x, y); | 103 testLineIntersect(state.fReporter, quad, line2, x, y); |
| 104 state.fReporter->bumpTestCount(); | 104 state.fReporter->bumpTestCount(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 118 for (int c = 0 ; c < 16; ++c) { | 118 for (int c = 0 ; c < 16; ++c) { |
| 119 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreaded
Runnable, | 119 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreaded
Runnable, |
| 120 (&testQuadLineIntersectMain, a, b, c, 0, &testRunner
)); | 120 (&testQuadLineIntersectMain, a, b, c, 0, &testRunner
)); |
| 121 } | 121 } |
| 122 if (!reporter->allowExtendedTest()) goto finish; | 122 if (!reporter->allowExtendedTest()) goto finish; |
| 123 } | 123 } |
| 124 } | 124 } |
| 125 finish: | 125 finish: |
| 126 testRunner.render(); | 126 testRunner.render(); |
| 127 } | 127 } |
| OLD | NEW |