OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkRandom.h" | 10 #include "SkRandom.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 } | 28 } |
29 } | 29 } |
30 SkRect classicBounds = path.getBounds(); | 30 SkRect classicBounds = path.getBounds(); |
31 SkRect tightBounds; | 31 SkRect tightBounds; |
32 REPORTER_ASSERT(data->fReporter, TightBounds(path, &tightBounds)); | 32 REPORTER_ASSERT(data->fReporter, TightBounds(path, &tightBounds)); |
33 REPORTER_ASSERT(data->fReporter, classicBounds == tightBounds); | 33 REPORTER_ASSERT(data->fReporter, classicBounds == tightBounds); |
34 } | 34 } |
35 } | 35 } |
36 | 36 |
37 DEF_TEST(PathOpsTightBoundsLines, reporter) { | 37 DEF_TEST(PathOpsTightBoundsLines, reporter) { |
38 initializeTests(reporter, "tightBoundsLines"); | 38 int threadCount = initializeTests(reporter, "tightBoundsLines"); |
39 PathOpsThreadedTestRunner testRunner(reporter); | 39 PathOpsThreadedTestRunner testRunner(reporter, threadCount); |
40 int outerCount = reporter->allowExtendedTest() ? 100 : 1; | 40 int outerCount = reporter->allowExtendedTest() ? 100 : 1; |
41 for (int index = 0; index < outerCount; ++index) { | 41 for (int index = 0; index < outerCount; ++index) { |
42 for (int idx2 = 0; idx2 < 10; ++idx2) { | 42 for (int idx2 = 0; idx2 < 10; ++idx2) { |
43 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable
, | 43 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable
, |
44 (&testTightBoundsLines, 0, 0, 0, 0, &testRunner)); | 44 (&testTightBoundsLines, 0, 0, 0, 0, &testRunner)); |
45 } | 45 } |
46 } | 46 } |
47 testRunner.render(); | 47 testRunner.render(); |
48 } | 48 } |
49 | 49 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 } | 103 } |
104 if (!bitsWritten.isEmpty()) { | 104 if (!bitsWritten.isEmpty()) { |
105 SkIRect tightOut; | 105 SkIRect tightOut; |
106 tightBounds.roundOut(&tightOut); | 106 tightBounds.roundOut(&tightOut); |
107 REPORTER_ASSERT(data->fReporter, tightOut.contains(bitsWritten)); | 107 REPORTER_ASSERT(data->fReporter, tightOut.contains(bitsWritten)); |
108 } | 108 } |
109 } | 109 } |
110 } | 110 } |
111 | 111 |
112 DEF_TEST(PathOpsTightBoundsQuads, reporter) { | 112 DEF_TEST(PathOpsTightBoundsQuads, reporter) { |
113 initializeTests(reporter, "tightBoundsQuads"); | 113 int threadCount = initializeTests(reporter, "tightBoundsQuads"); |
114 PathOpsThreadedTestRunner testRunner(reporter); | 114 PathOpsThreadedTestRunner testRunner(reporter, threadCount); |
115 int outerCount = reporter->allowExtendedTest() ? 100 : 1; | 115 int outerCount = reporter->allowExtendedTest() ? 100 : 1; |
116 for (int index = 0; index < outerCount; ++index) { | 116 for (int index = 0; index < outerCount; ++index) { |
117 for (int idx2 = 0; idx2 < 10; ++idx2) { | 117 for (int idx2 = 0; idx2 < 10; ++idx2) { |
118 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable
, | 118 *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable
, |
119 (&testTightBoundsQuads, 0, 0, 0, 0, &testRunner)); | 119 (&testTightBoundsQuads, 0, 0, 0, 0, &testRunner)); |
120 } | 120 } |
121 } | 121 } |
122 testRunner.render(); | 122 testRunner.render(); |
123 } | 123 } |
OLD | NEW |