| 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 testOpCubicsMain(PathOpsThreadState* data) { | 10 static void testOpCubicsMain(PathOpsThreadState* data) { |
| 11 #if DEBUG_SHOW_TEST_NAME | 11 #if DEBUG_SHOW_TEST_NAME |
| 12 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH); | 12 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH); |
| 13 #endif | 13 #endif |
| 14 SkASSERT(data); | 14 SkASSERT(data); |
| 15 PathOpsThreadState& state = *data; | 15 PathOpsThreadState& state = *data; |
| 16 char pathStr[1024]; // gdb: set print elements 400 | 16 char pathStr[1024]; // gdb: set print elements 400 |
| 17 bool progress = state.fReporter->verbose(); // FIXME: break out into its own
parameter? | 17 bool progress = state.fReporter->verbose(); // FIXME: break out into its own
parameter? |
| 18 if (progress) { | 18 if (progress) { |
| 19 sk_bzero(pathStr, sizeof(pathStr)); | 19 sk_bzero(pathStr, sizeof(pathStr)); |
| 20 } | 20 } |
| 21 for (int a = 0 ; a < 6; ++a) { | 21 for (int a = 0 ; a < 6; ++a) { |
| 22 for (int b = a + 1 ; b < 7; ++b) { | 22 for (int b = a + 1 ; b < 7; ++b) { |
| 23 for (int c = 0 ; c < 6; ++c) { | 23 for (int c = 0 ; c < 6; ++c) { |
| 24 for (int d = c + 1 ; d < 7; ++d) { | 24 for (int d = c + 1 ; d < 7; ++d) { |
| 25 for (int e = SkPath::kWinding_FillType ; e <= SkPath::kEvenO
dd_FillType; ++e) { | 25 for (int e = SkPath::kWinding_FillType ; e <= SkPath::kEvenO
dd_FillType; ++e) { |
| 26 for (int f = SkPath::kWinding_FillType ; f <= SkPath::kEvenOdd_FillType; ++f
) { | 26 for (int f = SkPath::kWinding_FillType ; f <= SkPath::kEvenOdd_FillType; ++f
) { |
| 27 SkPath pathA, pathB; | 27 SkPath pathA, pathB; |
| 28 if (progress) { | 28 if (progress) { |
| 29 char* str = pathStr; | 29 char* str = pathStr; |
| 30 const int loopNo = 129; | 30 const int loopNo = 133; |
| 31 str += sprintf(str, "static void cubicOp%d(skiatest::Reporter* repor
ter," | 31 str += sprintf(str, "static void cubicOp%d(skiatest::Reporter* repor
ter," |
| 32 " const char* filename) {\n", loopNo); | 32 " const char* filename) {\n", loopNo); |
| 33 str += sprintf(str, " SkPath path, pathB;\n"); | 33 str += sprintf(str, " SkPath path, pathB;\n"); |
| 34 str += sprintf(str, " path.setFillType(SkPath::k%s_FillType);\n", | 34 str += sprintf(str, " path.setFillType(SkPath::k%s_FillType);\n", |
| 35 e == SkPath::kWinding_FillType ? "Winding" : e == SkPath::kE
venOdd_FillType | 35 e == SkPath::kWinding_FillType ? "Winding" : e == SkPath::kE
venOdd_FillType |
| 36 ? "EvenOdd" : "?UNDEFINED"); | 36 ? "EvenOdd" : "?UNDEFINED"); |
| 37 str += sprintf(str, " path.moveTo(%d,%d);\n", state.fA, state.fB)
; | 37 str += sprintf(str, " path.moveTo(%d,%d);\n", state.fA, state.fB)
; |
| 38 str += sprintf(str, " path.cubicTo(%d,%d, %d,%d, %d,%d);\n", stat
e.fC, state.fD, | 38 str += sprintf(str, " path.cubicTo(%d,%d, %d,%d, %d,%d);\n", stat
e.fC, state.fD, |
| 39 b, a, d, c); | 39 b, a, d, c); |
| 40 str += sprintf(str, " path.close();\n"); | 40 str += sprintf(str, " path.close();\n"); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 for (int d = c + 1; d < 7; ++d) { | 82 for (int d = c + 1; d < 7; ++d) { |
| 83 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreaded
Runnable, | 83 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreaded
Runnable, |
| 84 (&testOpCubicsMain, a, b, c, d, &testRunner)); | 84 (&testOpCubicsMain, a, b, c, d, &testRunner)); |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 if (!reporter->allowExtendedTest()) goto finish; | 87 if (!reporter->allowExtendedTest()) goto finish; |
| 88 } | 88 } |
| 89 } | 89 } |
| 90 finish: | 90 finish: |
| 91 testRunner.render(); | 91 testRunner.render(); |
| 92 ShowTestArray(); | 92 ShowTestArray("cubicOp"); |
| 93 } | 93 } |
| OLD | NEW |