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 testSimplifyTrianglesMain(PathOpsThreadState* data) { | 10 static void testSimplifyTrianglesMain(PathOpsThreadState* data) { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 outputProgress(state.fPathStr, pathStr, SkPath::kEvenOdd_Fil
lType); | 66 outputProgress(state.fPathStr, pathStr, SkPath::kEvenOdd_Fil
lType); |
67 } | 67 } |
68 ShowTestName(&state, d, e, f, 1); | 68 ShowTestName(&state, d, e, f, 1); |
69 testSimplify(path, true, out, state, pathStr); | 69 testSimplify(path, true, out, state, pathStr); |
70 } | 70 } |
71 } | 71 } |
72 } | 72 } |
73 } | 73 } |
74 | 74 |
75 DEF_TEST(PathOpsSimplifyTrianglesThreaded, reporter) { | 75 DEF_TEST(PathOpsSimplifyTrianglesThreaded, reporter) { |
76 initializeTests(reporter, "testTriangles"); | 76 int threadCount = initializeTests(reporter, "testTriangles"); |
77 PathOpsThreadedTestRunner testRunner(reporter); | 77 PathOpsThreadedTestRunner testRunner(reporter, threadCount); |
78 for (int a = 0; a < 15; ++a) { | 78 for (int a = 0; a < 15; ++a) { |
79 int ax = a & 0x03; | 79 int ax = a & 0x03; |
80 int ay = a >> 2; | 80 int ay = a >> 2; |
81 for (int b = a + 1; b < 16; ++b) { | 81 for (int b = a + 1; b < 16; ++b) { |
82 int bx = b & 0x03; | 82 int bx = b & 0x03; |
83 int by = b >> 2; | 83 int by = b >> 2; |
84 for (int c = a + 1; c < 16; ++c) { | 84 for (int c = a + 1; c < 16; ++c) { |
85 if (b == c) { | 85 if (b == c) { |
86 continue; | 86 continue; |
87 } | 87 } |
88 int cx = c & 0x03; | 88 int cx = c & 0x03; |
89 int cy = c >> 2; | 89 int cy = c >> 2; |
90 if ((bx - ax) * (cy - ay) == (by - ay) * (cx - ax)) { | 90 if ((bx - ax) * (cy - ay) == (by - ay) * (cx - ax)) { |
91 continue; | 91 continue; |
92 } | 92 } |
93 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunn
able, | 93 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunn
able, |
94 (&testSimplifyTrianglesMain, a, b, c, 0, &testRunner)); | 94 (&testSimplifyTrianglesMain, a, b, c, 0, &testRunner)); |
95 } | 95 } |
96 if (!reporter->allowExtendedTest()) goto finish; | 96 if (!reporter->allowExtendedTest()) goto finish; |
97 } | 97 } |
98 } | 98 } |
99 finish: | 99 finish: |
100 testRunner.render(); | 100 testRunner.render(); |
101 } | 101 } |
OLD | NEW |