OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 | 7 |
8 #ifndef GrTestUtils_DEFINED | 8 #ifndef GrTestUtils_DEFINED |
9 #define GrTestUtils_DEFINED | 9 #define GrTestUtils_DEFINED |
10 | 10 |
11 #include "SkTypes.h" | 11 #include "SkTypes.h" |
12 | 12 |
13 #ifdef GR_TEST_UTILS | 13 #ifdef GR_TEST_UTILS |
14 | 14 |
15 #include "GrColor.h" | 15 #include "GrColor.h" |
16 #include "SkRandom.h" | 16 #include "SkRandom.h" |
17 #include "SkStrokeRec.h" | 17 #include "SkStrokeRec.h" |
18 | 18 |
| 19 class GrStrokeInfo; |
19 class SkMatrix; | 20 class SkMatrix; |
20 class SkPath; | 21 class SkPath; |
21 class SkRRect; | 22 class SkRRect; |
22 struct SkRect; | 23 struct SkRect; |
23 | 24 |
24 namespace GrTest { | 25 namespace GrTest { |
25 /** | 26 /** |
26 * A helper for use in Test functions. | 27 * A helper for use in Test functions. |
27 */ | 28 */ |
28 const SkMatrix& TestMatrix(SkRandom*); | 29 const SkMatrix& TestMatrix(SkRandom*); |
29 const SkMatrix& TestMatrixPreservesRightAngles(SkRandom*); | 30 const SkMatrix& TestMatrixPreservesRightAngles(SkRandom*); |
30 const SkMatrix& TestMatrixRectStaysRect(SkRandom*); | 31 const SkMatrix& TestMatrixRectStaysRect(SkRandom*); |
31 const SkMatrix& TestMatrixInvertible(SkRandom*); | 32 const SkMatrix& TestMatrixInvertible(SkRandom*); |
32 const SkRect& TestRect(SkRandom*); | 33 const SkRect& TestRect(SkRandom*); |
33 const SkRect& TestSquare(SkRandom*); | 34 const SkRect& TestSquare(SkRandom*); |
34 const SkRRect& TestRRectSimple(SkRandom*); | 35 const SkRRect& TestRRectSimple(SkRandom*); |
35 const SkPath& TestPath(SkRandom*); | 36 const SkPath& TestPath(SkRandom*); |
36 const SkPath& TestPathConvex(SkRandom*); | 37 const SkPath& TestPathConvex(SkRandom*); |
37 SkStrokeRec TestStrokeRec(SkRandom*); | 38 SkStrokeRec TestStrokeRec(SkRandom*); |
| 39 GrStrokeInfo TestStrokeInfo(SkRandom*); |
38 | 40 |
39 } | 41 } |
40 | 42 |
41 static inline GrColor GrRandomColor(SkRandom* random) { | 43 static inline GrColor GrRandomColor(SkRandom* random) { |
42 // There are only a few cases of random colors which interest us | 44 // There are only a few cases of random colors which interest us |
43 enum ColorMode { | 45 enum ColorMode { |
44 kAllOnes_ColorMode, | 46 kAllOnes_ColorMode, |
45 kAllZeros_ColorMode, | 47 kAllZeros_ColorMode, |
46 kAlphaOne_ColorMode, | 48 kAlphaOne_ColorMode, |
47 kRandom_ColorMode, | 49 kRandom_ColorMode, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 break; | 96 break; |
95 case kRandom_CoverageMode: | 97 case kRandom_CoverageMode: |
96 coverage = random->nextULessThan(256); | 98 coverage = random->nextULessThan(256); |
97 break; | 99 break; |
98 } | 100 } |
99 return coverage; | 101 return coverage; |
100 } | 102 } |
101 | 103 |
102 #endif | 104 #endif |
103 #endif | 105 #endif |
OLD | NEW |