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 testSimplifyDegeneratesMain(PathOpsThreadState* data) { | 10 static void testSimplifyDegeneratesMain(PathOpsThreadState* data) { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 testSimplify(path, false, out, state, pathStr); | 54 testSimplify(path, false, out, state, pathStr); |
55 path.setFillType(SkPath::kEvenOdd_FillType); | 55 path.setFillType(SkPath::kEvenOdd_FillType); |
56 outputProgress(state.fPathStr, pathStr, SkPath::kEvenOdd_FillTyp
e); | 56 outputProgress(state.fPathStr, pathStr, SkPath::kEvenOdd_FillTyp
e); |
57 testSimplify(path, true, out, state, pathStr); | 57 testSimplify(path, true, out, state, pathStr); |
58 } | 58 } |
59 } | 59 } |
60 } | 60 } |
61 } | 61 } |
62 | 62 |
63 static void PathOpsSimplifyDegeneratesThreadedTest(skiatest::Reporter* reporter)
{ | 63 static void PathOpsSimplifyDegeneratesThreadedTest(skiatest::Reporter* reporter)
{ |
64 int threadCount = initializeTests("testDegenerates"); | 64 int threadCount = initializeTests(reporter, "testDegenerates"); |
65 PathOpsThreadedTestRunner testRunner(reporter, threadCount); | 65 PathOpsThreadedTestRunner testRunner(reporter, threadCount); |
66 for (int a = 0; a < 16; ++a) { | 66 for (int a = 0; a < 16; ++a) { |
67 int ax = a & 0x03; | 67 int ax = a & 0x03; |
68 int ay = a >> 2; | 68 int ay = a >> 2; |
69 for (int b = a ; b < 16; ++b) { | 69 for (int b = a ; b < 16; ++b) { |
70 int bx = b & 0x03; | 70 int bx = b & 0x03; |
71 int by = b >> 2; | 71 int by = b >> 2; |
72 for (int c = a ; c < 16; ++c) { | 72 for (int c = a ; c < 16; ++c) { |
73 int cx = c & 0x03; | 73 int cx = c & 0x03; |
74 int cy = c >> 2; | 74 int cy = c >> 2; |
75 bool abcIsATriangle = (bx - ax) * (cy - ay) != (by - ay) * (cx -
ax); | 75 bool abcIsATriangle = (bx - ax) * (cy - ay) != (by - ay) * (cx -
ax); |
76 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunn
able, | 76 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunn
able, |
77 (&testSimplifyDegeneratesMain, a, b, c, abcIsATriangle, | 77 (&testSimplifyDegeneratesMain, a, b, c, abcIsATriangle, |
78 &testRunner)); | 78 &testRunner)); |
79 } | 79 } |
80 if (!reporter->allowExtendedTest()) goto finish; | 80 if (!reporter->allowExtendedTest()) goto finish; |
81 } | 81 } |
82 } | 82 } |
83 finish: | 83 finish: |
84 testRunner.render(); | 84 testRunner.render(); |
85 } | 85 } |
86 | 86 |
87 #include "TestClassDef.h" | 87 #include "TestClassDef.h" |
88 DEFINE_TESTCLASS_SHORT(PathOpsSimplifyDegeneratesThreadedTest) | 88 DEFINE_TESTCLASS_SHORT(PathOpsSimplifyDegeneratesThreadedTest) |
OLD | NEW |