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 "PathOpsCubicIntersectionTestData.h" | 7 #include "PathOpsCubicIntersectionTestData.h" |
8 #include "PathOpsQuadIntersectionTestData.h" | 8 #include "PathOpsQuadIntersectionTestData.h" |
9 #include "PathOpsTestCommon.h" | 9 #include "PathOpsTestCommon.h" |
10 #include "SkGeometry.h" | 10 #include "SkGeometry.h" |
11 #include "SkIntersections.h" | 11 #include "SkIntersections.h" |
12 #include "SkPathOpsRect.h" | 12 #include "SkPathOpsRect.h" |
13 #include "SkReduceOrder.h" | 13 #include "SkReduceOrder.h" |
14 #include "Test.h" | 14 #include "Test.h" |
15 #include "TestClassDef.h" | |
16 | 15 |
17 static void test(skiatest::Reporter* reporter, const SkDCubic* cubics, const cha
r* name, | 16 static void test(skiatest::Reporter* reporter, const SkDCubic* cubics, const cha
r* name, |
18 int firstTest, size_t testCount) { | 17 int firstTest, size_t testCount) { |
19 for (size_t index = firstTest; index < testCount; ++index) { | 18 for (size_t index = firstTest; index < testCount; ++index) { |
20 const SkDCubic& cubic = cubics[index]; | 19 const SkDCubic& cubic = cubics[index]; |
21 SkASSERT(ValidCubic(cubic)); | 20 SkASSERT(ValidCubic(cubic)); |
22 double precision = cubic.calcPrecision(); | 21 double precision = cubic.calcPrecision(); |
23 SkTArray<SkDQuad, true> quads; | 22 SkTArray<SkDQuad, true> quads; |
24 CubicToQuads(cubic, precision, quads); | 23 CubicToQuads(cubic, precision, quads); |
25 if (quads.count() != 1 && quads.count() != 2) { | 24 if (quads.count() != 1 && quads.count() != 2) { |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 189 |
191 DEF_TEST(CubicsToQuadratics_OneOff_Loop, reporter) { | 190 DEF_TEST(CubicsToQuadratics_OneOff_Loop, reporter) { |
192 for (size_t x = 0; x < localsCount; ++x) { | 191 for (size_t x = 0; x < localsCount; ++x) { |
193 oneOff(reporter, x); | 192 oneOff(reporter, x); |
194 } | 193 } |
195 } | 194 } |
196 | 195 |
197 DEF_TEST(CubicsToQuadratics_OneOff_Single, reporter) { | 196 DEF_TEST(CubicsToQuadratics_OneOff_Single, reporter) { |
198 oneOff(reporter, 0); | 197 oneOff(reporter, 0); |
199 } | 198 } |
OLD | NEW |