| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  61                 if (progress) { |  61                 if (progress) { | 
|  62                     outputProgress(state.fPathStr, pathStr, SkPath::kEvenOdd_Fil
    lType); |  62                     outputProgress(state.fPathStr, pathStr, SkPath::kEvenOdd_Fil
    lType); | 
|  63                 } |  63                 } | 
|  64                 testSimplify(path, true, out, state, pathStr); |  64                 testSimplify(path, true, out, state, pathStr); | 
|  65             } |  65             } | 
|  66         } |  66         } | 
|  67     } |  67     } | 
|  68 } |  68 } | 
|  69  |  69  | 
|  70 DEF_TEST(PathOpsSimplifyDegeneratesThreaded, reporter) { |  70 DEF_TEST(PathOpsSimplifyDegeneratesThreaded, reporter) { | 
|  71     initializeTests(reporter, "testDegenerates"); |  71     int threadCount = initializeTests(reporter, "testDegenerates"); | 
|  72     PathOpsThreadedTestRunner testRunner(reporter); |  72     PathOpsThreadedTestRunner testRunner(reporter, threadCount); | 
|  73     for (int a = 0; a < 16; ++a) { |  73     for (int a = 0; a < 16; ++a) { | 
|  74         int ax = a & 0x03; |  74         int ax = a & 0x03; | 
|  75         int ay = a >> 2; |  75         int ay = a >> 2; | 
|  76         for (int b = a ; b < 16; ++b) { |  76         for (int b = a ; b < 16; ++b) { | 
|  77             int bx = b & 0x03; |  77             int bx = b & 0x03; | 
|  78             int by = b >> 2; |  78             int by = b >> 2; | 
|  79             for (int c = a ; c < 16; ++c) { |  79             for (int c = a ; c < 16; ++c) { | 
|  80                 int cx = c & 0x03; |  80                 int cx = c & 0x03; | 
|  81                 int cy = c >> 2; |  81                 int cy = c >> 2; | 
|  82                 bool abcIsATriangle = (bx - ax) * (cy - ay) != (by - ay) * (cx -
     ax); |  82                 bool abcIsATriangle = (bx - ax) * (cy - ay) != (by - ay) * (cx -
     ax); | 
|  83                 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunn
    able, |  83                 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunn
    able, | 
|  84                         (&testSimplifyDegeneratesMain, a, b, c, abcIsATriangle, |  84                         (&testSimplifyDegeneratesMain, a, b, c, abcIsATriangle, | 
|  85                         &testRunner)); |  85                         &testRunner)); | 
|  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 } |  92 } | 
| OLD | NEW |