Chromium Code Reviews| 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 #include "GrTestUtils.h" | 8 #include "GrTestUtils.h" |
| 9 #include "SkMatrix.h" | 9 #include "SkMatrix.h" |
| 10 #include "SkPath.h" | 10 #include "SkPath.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 164 gPath[6].lineTo(5.0f, 5.0f); | 164 gPath[6].lineTo(5.0f, 5.0f); |
| 165 gPath[6].lineTo(10.0f, 0.0f); | 165 gPath[6].lineTo(10.0f, 0.0f); |
| 166 gPath[6].lineTo(10.0f, 10.0f); | 166 gPath[6].lineTo(10.0f, 10.0f); |
| 167 gPath[6].lineTo(0.0f, 10.0f); | 167 gPath[6].lineTo(0.0f, 10.0f); |
| 168 gPath[6].close(); | 168 gPath[6].close(); |
| 169 } | 169 } |
| 170 | 170 |
| 171 return gPath[random->nextULessThan(static_cast<uint32_t>(SK_ARRAY_COUNT(gPat h)))]; | 171 return gPath[random->nextULessThan(static_cast<uint32_t>(SK_ARRAY_COUNT(gPat h)))]; |
| 172 } | 172 } |
| 173 | 173 |
| 174 SkStrokeRec TestStrokeRec(SkRandom* random) { | |
| 175 SkStrokeRec::InitStyle style = | |
|
robertphillips
2015/05/07 19:30:24
Should we add a 'kInitStyleCount ' ?
joshualitt
2015/05/07 21:22:39
Well, there is a macro which Mike Klein made to ma
| |
| 176 SkStrokeRec::InitStyle(random->nextULessThan(SkStrokeRec::kFill_Init Style + 1)); | |
| 177 SkStrokeRec rec(style); | |
| 178 bool strokeAndFill = random->nextBool(); | |
|
robertphillips
2015/05/07 19:30:24
A width one too? Maybe 10?
joshualitt
2015/05/07 21:22:39
you want me to make an enum of possible widths wit
robertphillips
2015/05/08 12:02:07
I was just angling for a wider one (i.e., a stroke
| |
| 179 SkScalar strokeWidth = random->nextBool() ? 0.f : 1.f; | |
| 180 rec.setStrokeStyle(strokeWidth, strokeAndFill); | |
| 181 | |
| 182 SkPaint::Cap cap = SkPaint::Cap(random->nextULessThan(SkPaint::kCapCount)); | |
| 183 SkPaint::Join join = SkPaint::Join(random->nextULessThan(SkPaint::kJoinCount )); | |
| 184 SkScalar miterLimit = random->nextRangeScalar(1.f, 5.f); | |
| 185 rec.setStrokeParams(cap, join, miterLimit); | |
| 186 return rec; | |
| 187 } | |
| 188 | |
| 174 }; | 189 }; |
| 175 | 190 |
| 176 #endif | 191 #endif |
| OLD | NEW |