| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 testOpLoopsMain(PathOpsThreadState* data) { | 10 static void testOpLoopsMain(PathOpsThreadState* data) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 outputProgress(state.fPathStr, pathStr, kIntersect_PathOp); | 55 outputProgress(state.fPathStr, pathStr, kIntersect_PathOp); |
| 56 } | 56 } |
| 57 testThreadedPathOp(state.fReporter, pathA, pathB, kIntersect_PathOp, "lo
ops"); | 57 testThreadedPathOp(state.fReporter, pathA, pathB, kIntersect_PathOp, "lo
ops"); |
| 58 } | 58 } |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 | 63 |
| 64 DEF_TEST(PathOpsOpLoopsThreaded, reporter) { | 64 DEF_TEST(PathOpsOpLoopsThreaded, reporter) { |
| 65 initializeTests(reporter, "cubicOp"); | 65 int threadCount = initializeTests(reporter, "cubicOp"); |
| 66 PathOpsThreadedTestRunner testRunner(reporter); | 66 PathOpsThreadedTestRunner testRunner(reporter, threadCount); |
| 67 for (int a = 0; a < 6; ++a) { // outermost | 67 for (int a = 0; a < 6; ++a) { // outermost |
| 68 for (int b = a + 1; b < 7; ++b) { | 68 for (int b = a + 1; b < 7; ++b) { |
| 69 for (int c = 0 ; c < 6; ++c) { | 69 for (int c = 0 ; c < 6; ++c) { |
| 70 for (int d = c + 1; d < 7; ++d) { | 70 for (int d = c + 1; d < 7; ++d) { |
| 71 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreaded
Runnable, | 71 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreaded
Runnable, |
| 72 (&testOpLoopsMain, a, b, c, d, &testRunner)); | 72 (&testOpLoopsMain, a, b, c, d, &testRunner)); |
| 73 } | 73 } |
| 74 } | 74 } |
| 75 if (!reporter->allowExtendedTest()) goto finish; | 75 if (!reporter->allowExtendedTest()) goto finish; |
| 76 } | 76 } |
| 77 } | 77 } |
| 78 finish: | 78 finish: |
| 79 testRunner.render(); | 79 testRunner.render(); |
| 80 ShowTestArray(); | 80 ShowTestArray(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 DEF_TEST(PathOpsOpLoops, reporter) { | 83 DEF_TEST(PathOpsOpLoops, reporter) { |
| 84 initializeTests(reporter, "cubicOp"); | 84 (void) initializeTests(reporter, "cubicOp"); |
| 85 PathOpsThreadState state; | 85 PathOpsThreadState state; |
| 86 state.fReporter = reporter; | 86 state.fReporter = reporter; |
| 87 SkBitmap bitmap; | 87 SkBitmap bitmap; |
| 88 state.fBitmap = &bitmap; | 88 state.fBitmap = &bitmap; |
| 89 char pathStr[PATH_STR_SIZE]; | 89 char pathStr[PATH_STR_SIZE]; |
| 90 state.fPathStr = pathStr; | 90 state.fPathStr = pathStr; |
| 91 for (state.fA = 0; state.fA < 6; ++state.fA) { // outermost | 91 for (state.fA = 0; state.fA < 6; ++state.fA) { // outermost |
| 92 for (state.fB = state.fA + 1; state.fB < 7; ++state.fB) { | 92 for (state.fB = state.fA + 1; state.fB < 7; ++state.fB) { |
| 93 for (state.fC = 0 ; state.fC < 6; ++state.fC) { | 93 for (state.fC = 0 ; state.fC < 6; ++state.fC) { |
| 94 for (state.fD = state.fC + 1; state.fD < 7; ++state.fD) { | 94 for (state.fD = state.fC + 1; state.fD < 7; ++state.fD) { |
| 95 testOpLoopsMain(&state); | 95 testOpLoopsMain(&state); |
| 96 } | 96 } |
| 97 } | 97 } |
| 98 if (!reporter->allowExtendedTest()) goto finish; | 98 if (!reporter->allowExtendedTest()) goto finish; |
| 99 } | 99 } |
| 100 } | 100 } |
| 101 finish: | 101 finish: |
| 102 ShowTestArray(); | 102 ShowTestArray(); |
| 103 } | 103 } |
| OLD | NEW |