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 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 "gm.h" | 8 #include "gm.h" |
9 #include "SkPath.h" | 9 #include "SkPath.h" |
10 #include "SkDashPathEffect.h" | 10 #include "SkDashPathEffect.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 canvas->translate(0, 400); | 39 canvas->translate(0, 400); |
40 canvas->drawPath(path1, paint); | 40 canvas->drawPath(path1, paint); |
41 canvas->restore(); | 41 canvas->restore(); |
42 | 42 |
43 paint.setStrokeWidth(0.26f); | 43 paint.setStrokeWidth(0.26f); |
44 paint.setPathEffect(SkDashPathEffect::Create(smIntervals, smIntervalCount, 0
))->unref(); | 44 paint.setPathEffect(SkDashPathEffect::Create(smIntervals, smIntervalCount, 0
))->unref(); |
45 canvas->scale(100, 100); | 45 canvas->scale(100, 100); |
46 canvas->translate(4, 4); | 46 canvas->translate(4, 4); |
47 canvas->drawPath(path2, paint); | 47 canvas->drawPath(path2, paint); |
48 } | 48 } |
49 | |
50 DEF_SIMPLE_GM(bug591993, canvas, 40, 140) { | |
51 SkPaint p; | |
52 p.setColor(SK_ColorRED); | |
53 p.setAntiAlias(true); | |
54 p.setStyle(SkPaint::kStroke_Style); | |
55 p.setStrokeCap(SkPaint::kRound_Cap); | |
56 p.setStrokeWidth(10); | |
57 SkScalar intervals[] = { 100, 100 }; | |
58 SkPathEffect* dash = SkDashPathEffect::Create(intervals, SK_ARRAY_COUNT(inte
rvals), 100); | |
59 p.setPathEffect(dash)->unref(); | |
60 canvas->drawLine(20, 20, 120, 20, p); | |
61 } | |
OLD | NEW |