| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrDashingEffect.h" | 8 #include "GrDashingEffect.h" |
| 9 | 9 |
| 10 #include "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
| (...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1233 pts[1].fY = random->nextF() * 10.f; | 1233 pts[1].fY = random->nextF() * 10.f; |
| 1234 } else { | 1234 } else { |
| 1235 // horizontal | 1235 // horizontal |
| 1236 pts[0].fX = random->nextF() * 10.f; | 1236 pts[0].fX = random->nextF() * 10.f; |
| 1237 pts[0].fY = 1.f; | 1237 pts[0].fY = 1.f; |
| 1238 pts[1].fX = random->nextF() * 10.f; | 1238 pts[1].fX = random->nextF() * 10.f; |
| 1239 pts[1].fY = 1.f; | 1239 pts[1].fY = 1.f; |
| 1240 } | 1240 } |
| 1241 | 1241 |
| 1242 // pick random cap | 1242 // pick random cap |
| 1243 SkPaint::Cap cap = SkPaint::Cap(random->nextULessThan(SkPaint::Cap::kCapCoun
t)); | 1243 SkPaint::Cap cap = SkPaint::Cap(random->nextULessThan(SkPaint::kCapCount)); |
| 1244 | 1244 |
| 1245 SkScalar intervals[2]; | 1245 SkScalar intervals[2]; |
| 1246 | 1246 |
| 1247 // We can only dash with the following intervals | 1247 // We can only dash with the following intervals |
| 1248 enum Intervals { | 1248 enum Intervals { |
| 1249 kOpenOpen_Intervals , | 1249 kOpenOpen_Intervals , |
| 1250 kOpenClose_Intervals, | 1250 kOpenClose_Intervals, |
| 1251 kCloseOpen_Intervals, | 1251 kCloseOpen_Intervals, |
| 1252 }; | 1252 }; |
| 1253 | 1253 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1280 p.setStrokeWidth(SkIntToScalar(1)); | 1280 p.setStrokeWidth(SkIntToScalar(1)); |
| 1281 p.setStrokeCap(cap); | 1281 p.setStrokeCap(cap); |
| 1282 p.setPathEffect(GrTest::TestDashPathEffect::Make(intervals, 2, phase)); | 1282 p.setPathEffect(GrTest::TestDashPathEffect::Make(intervals, 2, phase)); |
| 1283 | 1283 |
| 1284 GrStyle style(p); | 1284 GrStyle style(p); |
| 1285 | 1285 |
| 1286 return GrDashingEffect::CreateDashLineBatch(color, viewMatrix, pts, aaMode,
style); | 1286 return GrDashingEffect::CreateDashLineBatch(color, viewMatrix, pts, aaMode,
style); |
| 1287 } | 1287 } |
| 1288 | 1288 |
| 1289 #endif | 1289 #endif |
| OLD | NEW |