OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
10 #include "SkBlurMaskFilter.h" | 10 #include "SkBlurMaskFilter.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 canvas->drawText("Looper", 6, SkIntToScalar(230), SkIntToScalar(100), | 49 canvas->drawText("Looper", 6, SkIntToScalar(230), SkIntToScalar(100), |
50 paint); | 50 paint); |
51 } | 51 } |
52 | 52 |
53 private: | 53 private: |
54 sk_sp<SkDrawLooper> fLooper; | 54 sk_sp<SkDrawLooper> fLooper; |
55 | 55 |
56 void init() { | 56 void init() { |
57 if (fLooper) return; | 57 if (fLooper) return; |
58 | 58 |
59 static const struct { | 59 constexpr struct { |
60 SkColor fColor; | 60 SkColor fColor; |
61 SkPaint::Style fStyle; | 61 SkPaint::Style fStyle; |
62 SkScalar fWidth; | 62 SkScalar fWidth; |
63 SkScalar fOffset; | 63 SkScalar fOffset; |
64 SkScalar fBlur; | 64 SkScalar fBlur; |
65 } gParams[] = { | 65 } gParams[] = { |
66 { SK_ColorWHITE, SkPaint::kStroke_Style, SkIntToScalar(1)*3/4, 0, 0
}, | 66 { SK_ColorWHITE, SkPaint::kStroke_Style, SkIntToScalar(1)*3/4, 0, 0
}, |
67 { SK_ColorRED, SkPaint::kStroke_Style, SkIntToScalar(4), 0, 0 }, | 67 { SK_ColorRED, SkPaint::kStroke_Style, SkIntToScalar(4), 0, 0 }, |
68 { SK_ColorBLUE, SkPaint::kFill_Style, 0, 0, 0 }, | 68 { SK_ColorBLUE, SkPaint::kFill_Style, 0, 0, 0 }, |
69 { 0x88000000, SkPaint::kFill_Style, 0, SkIntToScalar(10), SkIntToSca
lar(3) } | 69 { 0x88000000, SkPaint::kFill_Style, 0, SkIntToScalar(10), SkIntToSca
lar(3) } |
(...skipping 18 matching lines...) Expand all Loading... |
88 } | 88 } |
89 fLooper = looperBuilder.detach(); | 89 fLooper = looperBuilder.detach(); |
90 } | 90 } |
91 | 91 |
92 typedef GM INHERITED; | 92 typedef GM INHERITED; |
93 }; | 93 }; |
94 | 94 |
95 ////////////////////////////////////////////////////////////////////////////// | 95 ////////////////////////////////////////////////////////////////////////////// |
96 | 96 |
97 DEF_GM( return new DrawLooperGM; ) | 97 DEF_GM( return new DrawLooperGM; ) |
OLD | NEW |