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 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 kAllOnes_CoverageMode, | 84 kAllOnes_CoverageMode, |
85 kRandom_CoverageMode, | 85 kRandom_CoverageMode, |
86 kLast_CoverageMode = kRandom_CoverageMode | 86 kLast_CoverageMode = kRandom_CoverageMode |
87 }; | 87 }; |
88 | 88 |
89 CoverageMode colorMode = CoverageMode(random->nextULessThan(kLast_CoverageMo
de + 1)); | 89 CoverageMode colorMode = CoverageMode(random->nextULessThan(kLast_CoverageMo
de + 1)); |
90 uint8_t coverage; | 90 uint8_t coverage; |
91 switch (colorMode) { | 91 switch (colorMode) { |
92 case kZero_CoverageMode: | 92 case kZero_CoverageMode: |
93 coverage = 0; | 93 coverage = 0; |
| 94 break; |
94 case kAllOnes_CoverageMode: | 95 case kAllOnes_CoverageMode: |
95 coverage = 0xff; | 96 coverage = 0xff; |
96 break; | 97 break; |
97 case kRandom_CoverageMode: | 98 case kRandom_CoverageMode: |
98 coverage = random->nextULessThan(256); | 99 coverage = random->nextULessThan(256); |
99 break; | 100 break; |
100 } | 101 } |
101 return coverage; | 102 return coverage; |
102 } | 103 } |
103 | 104 |
104 #endif | 105 #endif |
105 #endif | 106 #endif |
OLD | NEW |