OLD | NEW |
---|---|
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Intel Inc. | 3 * Copyright 2012 Intel Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "gm.h" | 8 #include "gm.h" |
9 #include "SkBlurDrawLooper.h" | 9 #include "SkBlurDrawLooper.h" |
10 #include "SkBlurMask.h" | 10 #include "SkBlurMask.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
69 SkScalar pos[] = { 0, SK_ScalarHalf, SK_Scalar1 }; | 69 SkScalar pos[] = { 0, SK_ScalarHalf, SK_Scalar1 }; |
70 p.setShader(SkGradientShader::MakeRadial(center, 20, colors, pos, SK_ARR AY_COUNT(colors), | 70 p.setShader(SkGradientShader::MakeRadial(center, 20, colors, pos, SK_ARR AY_COUNT(colors), |
71 SkShader::kClamp_TileMode)); | 71 SkShader::kClamp_TileMode)); |
72 fPaints.push_back(p); | 72 fPaints.push_back(p); |
73 } | 73 } |
74 | 74 |
75 { | 75 { |
76 // AA with blur | 76 // AA with blur |
77 SkPaint p; | 77 SkPaint p; |
78 p.setAntiAlias(true); | 78 p.setAntiAlias(true); |
79 SkDrawLooper* shadowLooper = | 79 auto shadowLooper = |
80 SkBlurDrawLooper::Create(SK_ColorBLUE, | 80 SkBlurDrawLooper::Make(SK_ColorBLUE, |
81 SkBlurMask::ConvertRadiusToSigma(SkIntToSca lar(10)), | 81 SkBlurMask::ConvertRadiusToSigma(SkIntToSca lar(10)), |
82 SkIntToScalar(5), SkIntToScalar(10), | 82 SkIntToScalar(5), SkIntToScalar(10), |
83 SkBlurDrawLooper::kIgnoreTransform_BlurFlag | | 83 SkBlurDrawLooper::kIgnoreTransform_BlurFlag | |
84 SkBlurDrawLooper::kOverrideColor_BlurFlag | | 84 SkBlurDrawLooper::kOverrideColor_BlurFlag | |
85 SkBlurDrawLooper::kHighQuality_BlurFlag); | 85 SkBlurDrawLooper::kHighQuality_BlurFlag); |
86 SkAutoUnref aurL0(shadowLooper); | |
87 p.setLooper(shadowLooper); | 86 p.setLooper(shadowLooper); |
f(malita)
2016/03/21 13:53:43
nit: looks like we can std::move here.
reed1
2016/03/21 17:15:23
Done.
| |
88 fPaints.push_back(p); | 87 fPaints.push_back(p); |
89 } | 88 } |
90 | 89 |
91 { | 90 { |
92 // AA with stroke style | 91 // AA with stroke style |
93 SkPaint p; | 92 SkPaint p; |
94 p.setAntiAlias(true); | 93 p.setAntiAlias(true); |
95 p.setStyle(SkPaint::kStroke_Style); | 94 p.setStyle(SkPaint::kStroke_Style); |
96 p.setStrokeWidth(SkIntToScalar(3)); | 95 p.setStrokeWidth(SkIntToScalar(3)); |
97 fPaints.push_back(p); | 96 fPaints.push_back(p); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
205 SkTArray<SkPaint> fPaints; | 204 SkTArray<SkPaint> fPaints; |
206 SkTArray<SkMatrix> fMatrices; | 205 SkTArray<SkMatrix> fMatrices; |
207 }; | 206 }; |
208 | 207 |
209 ////////////////////////////////////////////////////////////////////////////// | 208 ////////////////////////////////////////////////////////////////////////////// |
210 | 209 |
211 static GM* MyFactory(void*) { return new CircleGM; } | 210 static GM* MyFactory(void*) { return new CircleGM; } |
212 static GMRegistry reg(MyFactory); | 211 static GMRegistry reg(MyFactory); |
213 | 212 |
214 } | 213 } |
OLD | NEW |