OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkPath.h" | 10 #include "SkPath.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 namespace { | 40 namespace { |
41 struct Style { | 41 struct Style { |
42 Style(SkPaint::Style paintStyle, sk_sp<SkPathEffect> pe = sk_sp<SkPathEffect
>()) | 42 Style(SkPaint::Style paintStyle, sk_sp<SkPathEffect> pe = sk_sp<SkPathEffect
>()) |
43 : fPaintStyle(paintStyle) | 43 : fPaintStyle(paintStyle) |
44 , fPathEffect(std::move(pe)) {} | 44 , fPathEffect(std::move(pe)) {} |
45 SkPaint::Style fPaintStyle; | 45 SkPaint::Style fPaintStyle; |
46 sk_sp<SkPathEffect> fPathEffect; | 46 sk_sp<SkPathEffect> fPathEffect; |
47 }; | 47 }; |
48 | 48 |
49 sk_sp<SkPathEffect> make_dash() { | 49 sk_sp<SkPathEffect> make_dash() { |
50 static constexpr SkScalar kIntervals[] = { 4.f, 3.f }; | 50 constexpr SkScalar kIntervals[] = { 4.f, 3.f }; |
51 return SkDashPathEffect::Make(kIntervals, SK_ARRAY_COUNT(kIntervals), 0); | 51 return SkDashPathEffect::Make(kIntervals, SK_ARRAY_COUNT(kIntervals), 0); |
52 } | 52 } |
53 | 53 |
54 Style styles[] { | 54 Style styles[] { |
55 {SkPaint::kStroke_Style}, | 55 {SkPaint::kStroke_Style}, |
56 {SkPaint::kStrokeAndFill_Style}, | 56 {SkPaint::kStrokeAndFill_Style}, |
57 {SkPaint::kFill_Style}, | 57 {SkPaint::kFill_Style}, |
58 {SkPaint::kStroke_Style, make_dash()}, | 58 {SkPaint::kStroke_Style, make_dash()}, |
59 }; | 59 }; |
60 | 60 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 131 |
132 canvas->restore(); | 132 canvas->restore(); |
133 canvas->translate(dx, 0); | 133 canvas->translate(dx, 0); |
134 } | 134 } |
135 } | 135 } |
136 canvas->restore(); | 136 canvas->restore(); |
137 canvas->translate(0, dy); | 137 canvas->translate(0, dy); |
138 } | 138 } |
139 } | 139 } |
140 } | 140 } |
OLD | NEW |