| 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 | 9 |
| 10 static void testSimplifyQuadsMain(PathOpsThreadState* data) | 10 static void testSimplifyQuadsMain(PathOpsThreadState* data) |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 path.quadTo(SkIntToScalar(bx), SkIntToScalar(by), | 42 path.quadTo(SkIntToScalar(bx), SkIntToScalar(by), |
| 43 SkIntToScalar(cx), SkIntToScalar(cy)); | 43 SkIntToScalar(cx), SkIntToScalar(cy)); |
| 44 path.lineTo(SkIntToScalar(dx), SkIntToScalar(dy)); | 44 path.lineTo(SkIntToScalar(dx), SkIntToScalar(dy)); |
| 45 path.close(); | 45 path.close(); |
| 46 path.moveTo(SkIntToScalar(ex), SkIntToScalar(ey)); | 46 path.moveTo(SkIntToScalar(ex), SkIntToScalar(ey)); |
| 47 path.lineTo(SkIntToScalar(fx), SkIntToScalar(fy)); | 47 path.lineTo(SkIntToScalar(fx), SkIntToScalar(fy)); |
| 48 path.quadTo(SkIntToScalar(gx), SkIntToScalar(gy), | 48 path.quadTo(SkIntToScalar(gx), SkIntToScalar(gy), |
| 49 SkIntToScalar(hx), SkIntToScalar(hy)); | 49 SkIntToScalar(hx), SkIntToScalar(hy)); |
| 50 path.close(); | 50 path.close(); |
| 51 if (progress) { | 51 if (progress) { |
| 52 // gdb: set print elements 400 | 52 static int quadTest = 65; |
| 53 char* str = pathStr; | 53 char* str = pathStr; |
| 54 str += sprintf(str, "static void testQuads%d(skiatest::R
eporter* reporter," |
| 55 "const char* filename) {\n", quadTest); |
| 56 str += sprintf(str, " SkPath path;\n"); |
| 54 str += sprintf(str, " path.moveTo(%d, %d);\n", ax, ay
); | 57 str += sprintf(str, " path.moveTo(%d, %d);\n", ax, ay
); |
| 55 str += sprintf(str, " path.quadTo(%d, %d, %d, %d);\n"
, bx, by, cx, cy); | 58 str += sprintf(str, " path.quadTo(%d, %d, %d, %d);\n"
, bx, by, cx, cy); |
| 56 str += sprintf(str, " path.lineTo(%d, %d);\n", dx, dy
); | 59 str += sprintf(str, " path.lineTo(%d, %d);\n", dx, dy
); |
| 57 str += sprintf(str, " path.close();\n"); | 60 str += sprintf(str, " path.close();\n"); |
| 58 str += sprintf(str, " path.moveTo(%d, %d);\n", ex, ey
); | 61 str += sprintf(str, " path.moveTo(%d, %d);\n", ex, ey
); |
| 59 str += sprintf(str, " path.lineTo(%d, %d);\n", fx, fy
); | 62 str += sprintf(str, " path.lineTo(%d, %d);\n", fx, fy
); |
| 60 str += sprintf(str, " path.quadTo(%d, %d, %d, %d);\n"
, gx, gy, hx, hy); | 63 str += sprintf(str, " path.quadTo(%d, %d, %d, %d);\n"
, gx, gy, hx, hy); |
| 61 str += sprintf(str, " path.close();\n"); | 64 str += sprintf(str, " path.close();\n"); |
| 65 str += sprintf(str, " testSimplify(reporter, path, fi
lename);\n"); |
| 66 str += sprintf(str, "}\n"); |
| 62 outputProgress(state.fPathStr, pathStr, SkPath::kWinding
_FillType); | 67 outputProgress(state.fPathStr, pathStr, SkPath::kWinding
_FillType); |
| 63 } | 68 } |
| 64 testSimplify(path, false, out, state, pathStr); | 69 testSimplify(path, false, out, state, pathStr); |
| 65 path.setFillType(SkPath::kEvenOdd_FillType); | 70 path.setFillType(SkPath::kEvenOdd_FillType); |
| 66 if (progress) { | 71 if (progress) { |
| 67 outputProgress(state.fPathStr, pathStr, SkPath::kEvenOdd
_FillType); | 72 outputProgress(state.fPathStr, pathStr, SkPath::kEvenOdd
_FillType); |
| 68 } | 73 } |
| 69 testSimplify(path, true, out, state, pathStr); | 74 testSimplify(path, true, out, state, pathStr); |
| 70 } | 75 } |
| 71 } | 76 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 83 for (int d = c; d < 16; ++d) { | 88 for (int d = c; d < 16; ++d) { |
| 84 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreaded
Runnable, | 89 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreaded
Runnable, |
| 85 (&testSimplifyQuadsMain, a, b, c, d, &testRunner)); | 90 (&testSimplifyQuadsMain, a, b, c, d, &testRunner)); |
| 86 } | 91 } |
| 87 if (!reporter->allowExtendedTest()) goto finish; | 92 if (!reporter->allowExtendedTest()) goto finish; |
| 88 } | 93 } |
| 89 } | 94 } |
| 90 } | 95 } |
| 91 finish: | 96 finish: |
| 92 testRunner.render(); | 97 testRunner.render(); |
| 93 ShowTestArray(); | 98 ShowTestArray("testQuads"); |
| 94 } | 99 } |
| OLD | NEW |