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 "GrStrokeInfo.h" | 8 #include "GrStrokeInfo.h" |
9 #include "GrTestUtils.h" | 9 #include "GrTestUtils.h" |
10 #include "SkMatrix.h" | 10 #include "SkMatrix.h" |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 | 239 |
240 GrStrokeInfo TestStrokeInfo(SkRandom* random) { | 240 GrStrokeInfo TestStrokeInfo(SkRandom* random) { |
241 SkStrokeRec::InitStyle style = | 241 SkStrokeRec::InitStyle style = |
242 SkStrokeRec::InitStyle(random->nextULessThan(SkStrokeRec::kFill_Init
Style + 1)); | 242 SkStrokeRec::InitStyle(random->nextULessThan(SkStrokeRec::kFill_Init
Style + 1)); |
243 GrStrokeInfo strokeInfo(style); | 243 GrStrokeInfo strokeInfo(style); |
244 randomize_stroke_rec(&strokeInfo, random); | 244 randomize_stroke_rec(&strokeInfo, random); |
245 SkPathEffect::DashInfo dashInfo; | 245 SkPathEffect::DashInfo dashInfo; |
246 dashInfo.fCount = random->nextRangeU(1, 50) * 2; | 246 dashInfo.fCount = random->nextRangeU(1, 50) * 2; |
247 SkAutoTMalloc<SkScalar> intervals(dashInfo.fCount); | 247 SkAutoTMalloc<SkScalar> intervals(dashInfo.fCount); |
248 dashInfo.fIntervals = intervals.get(); | 248 dashInfo.fIntervals = intervals.get(); |
| 249 SkDebugf("intervals %p, dashInfo.fIntervals %p, dashInfo.fCount %d\n", |
| 250 intervals.get(), dashInfo.fIntervals, dashInfo.fCount); |
249 SkScalar sum = 0; | 251 SkScalar sum = 0; |
250 for (int i = 0; i < dashInfo.fCount; i++) { | 252 for (int i = 0; i < dashInfo.fCount; i++) { |
251 #if defined(SK_BUILD_FOR_IOS) | |
252 SkDebugf("&dashInfo.fIntervals[%d] = %p\n", i, &dashInfo.fIntervals[i]); | 253 SkDebugf("&dashInfo.fIntervals[%d] = %p\n", i, &dashInfo.fIntervals[i]); |
253 #endif | |
254 dashInfo.fIntervals[i] = random->nextRangeScalar(SkDoubleToScalar(0.01), | 254 dashInfo.fIntervals[i] = random->nextRangeScalar(SkDoubleToScalar(0.01), |
255 SkDoubleToScalar(10.0))
; | 255 SkDoubleToScalar(10.0))
; |
256 sum += dashInfo.fIntervals[i]; | 256 sum += dashInfo.fIntervals[i]; |
257 } | 257 } |
258 dashInfo.fPhase = random->nextRangeScalar(0, sum); | 258 dashInfo.fPhase = random->nextRangeScalar(0, sum); |
259 strokeInfo.setDashInfo(dashInfo); | 259 strokeInfo.setDashInfo(dashInfo); |
260 return strokeInfo; | 260 return strokeInfo; |
261 } | 261 } |
262 | 262 |
263 }; | 263 }; |
264 | 264 |
265 #endif | 265 #endif |
OLD | NEW |