| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BD-style license that can be | 4 * Use of this source code is governed by a BD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "gm.h" | 8 #include "gm.h" |
| 9 #include "SkParsePath.h" | 9 #include "SkParsePath.h" |
| 10 #include "SkPath.h" | 10 #include "SkPath.h" |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 p.setStrokeWidth(100); | 216 p.setStrokeWidth(100); |
| 217 p.setAntiAlias(true); | 217 p.setAntiAlias(true); |
| 218 p.setColor(0xFF008200); | 218 p.setColor(0xFF008200); |
| 219 p.setStrokeCap(SkPaint::kSquare_Cap); | 219 p.setStrokeCap(SkPaint::kSquare_Cap); |
| 220 SkPath path; | 220 SkPath path; |
| 221 SkParsePath::FromSVGString(d, &path); | 221 SkParsePath::FromSVGString(d, &path); |
| 222 SkPathMeasure meas(path, false); | 222 SkPathMeasure meas(path, false); |
| 223 SkScalar length = meas.getLength(); | 223 SkScalar length = meas.getLength(); |
| 224 SkScalar intervals[] = {0, length }; | 224 SkScalar intervals[] = {0, length }; |
| 225 int intervalCount = (int) SK_ARRAY_COUNT(intervals); | 225 int intervalCount = (int) SK_ARRAY_COUNT(intervals); |
| 226 p.setPathEffect(SkDashPathEffect::Make(intervals, intervalCount, 0)); | 226 p.setPathEffect(SkDashPathEffect::Create(intervals, intervalCount, 0))->unref(
); |
| 227 canvas->drawPath(path, p); | 227 canvas->drawPath(path, p); |
| 228 } | 228 } |
| OLD | NEW |