OLD | NEW |
1 | |
2 /* | 1 /* |
3 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
4 * | 3 * |
5 * 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 |
6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
7 */ | 6 */ |
| 7 |
| 8 #include "Test.h" |
| 9 #include "TestClassDef.h" |
8 #include "SkMath.h" | 10 #include "SkMath.h" |
9 #include "SkPoint.h" | 11 #include "SkPoint.h" |
10 #include "SkScalar.h" | 12 #include "SkScalar.h" |
11 #include "Test.h" | |
12 | 13 |
13 /* | 14 /* |
14 Duplicates lots of code from gpu/src/GrPathUtils.cpp | 15 Duplicates lots of code from gpu/src/GrPathUtils.cpp |
15 It'd be nice not to do so, but that code's set up currently to only have | 16 It'd be nice not to do so, but that code's set up currently to only have |
16 a single implementation. | 17 a single implementation. |
17 */ | 18 */ |
18 | 19 |
19 // Sk uses 6, Gr (implicitly) used 10, both apparently arbitrarily. | 20 // Sk uses 6, Gr (implicitly) used 10, both apparently arbitrarily. |
20 #define MAX_COEFF_SHIFT 6 | 21 #define MAX_COEFF_SHIFT 6 |
21 static const uint32_t MAX_POINTS_PER_CURVE = 1 << MAX_COEFF_SHIFT; | 22 static const uint32_t MAX_POINTS_PER_CURVE = 1 << MAX_COEFF_SHIFT; |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 154 |
154 | 155 |
155 static void TestQuadPointCount(skiatest::Reporter* reporter) { | 156 static void TestQuadPointCount(skiatest::Reporter* reporter) { |
156 one_d_pe(gXY, SK_ARRAY_COUNT(gXY), reporter); | 157 one_d_pe(gXY, SK_ARRAY_COUNT(gXY), reporter); |
157 one_d_pe(gSawtooth, SK_ARRAY_COUNT(gSawtooth), reporter); | 158 one_d_pe(gSawtooth, SK_ARRAY_COUNT(gSawtooth), reporter); |
158 one_d_pe(gOvalish, SK_ARRAY_COUNT(gOvalish), reporter); | 159 one_d_pe(gOvalish, SK_ARRAY_COUNT(gOvalish), reporter); |
159 one_d_pe(gSharpSawtooth, SK_ARRAY_COUNT(gSharpSawtooth), reporter); | 160 one_d_pe(gSharpSawtooth, SK_ARRAY_COUNT(gSharpSawtooth), reporter); |
160 one_d_pe(gRibbon, SK_ARRAY_COUNT(gRibbon), reporter); | 161 one_d_pe(gRibbon, SK_ARRAY_COUNT(gRibbon), reporter); |
161 } | 162 } |
162 | 163 |
163 static void TestPathCoverage(skiatest::Reporter* reporter) { | 164 DEF_TEST(PathCoverage, reporter) { |
164 TestQuadPointCount(reporter); | 165 TestQuadPointCount(reporter); |
165 | 166 |
166 } | 167 } |
167 | |
168 #include "TestClassDef.h" | |
169 DEFINE_TESTCLASS("PathCoverage", PathCoverageTestClass, TestPathCoverage) | |
OLD | NEW |