| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 fPaints.push_back(p); | 60 fPaints.push_back(p); |
| 61 } | 61 } |
| 62 | 62 |
| 63 { | 63 { |
| 64 // AA with radial shader | 64 // AA with radial shader |
| 65 SkPaint p; | 65 SkPaint p; |
| 66 p.setAntiAlias(true); | 66 p.setAntiAlias(true); |
| 67 SkPoint center = SkPoint::Make(SkIntToScalar(40), SkIntToScalar(40)); | 67 SkPoint center = SkPoint::Make(SkIntToScalar(40), SkIntToScalar(40)); |
| 68 SkColor colors[] = { SK_ColorBLUE, SK_ColorRED, SK_ColorGREEN }; | 68 SkColor colors[] = { SK_ColorBLUE, SK_ColorRED, SK_ColorGREEN }; |
| 69 SkScalar pos[] = { 0, SK_ScalarHalf, SK_Scalar1 }; | 69 SkScalar pos[] = { 0, SK_ScalarHalf, SK_Scalar1 }; |
| 70 SkShader* s = SkGradientShader::CreateRadial(center, | 70 p.setShader(SkGradientShader::MakeRadial(center, 20, colors, pos, SK_ARR
AY_COUNT(colors), |
| 71 SkIntToScalar(20), | 71 SkShader::kClamp_TileMode)); |
| 72 colors, | |
| 73 pos, | |
| 74 SK_ARRAY_COUNT(colors), | |
| 75 SkShader::kClamp_TileMode); | |
| 76 p.setShader(s)->unref(); | |
| 77 fPaints.push_back(p); | 72 fPaints.push_back(p); |
| 78 } | 73 } |
| 79 | 74 |
| 80 { | 75 { |
| 81 // AA with blur | 76 // AA with blur |
| 82 SkPaint p; | 77 SkPaint p; |
| 83 p.setAntiAlias(true); | 78 p.setAntiAlias(true); |
| 84 SkDrawLooper* shadowLooper = | 79 SkDrawLooper* shadowLooper = |
| 85 SkBlurDrawLooper::Create(SK_ColorBLUE, | 80 SkBlurDrawLooper::Create(SK_ColorBLUE, |
| 86 SkBlurMask::ConvertRadiusToSigma(SkIntToSca
lar(10)), | 81 SkBlurMask::ConvertRadiusToSigma(SkIntToSca
lar(10)), |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 SkTArray<SkPaint> fPaints; | 205 SkTArray<SkPaint> fPaints; |
| 211 SkTArray<SkMatrix> fMatrices; | 206 SkTArray<SkMatrix> fMatrices; |
| 212 }; | 207 }; |
| 213 | 208 |
| 214 ////////////////////////////////////////////////////////////////////////////// | 209 ////////////////////////////////////////////////////////////////////////////// |
| 215 | 210 |
| 216 static GM* MyFactory(void*) { return new CircleGM; } | 211 static GM* MyFactory(void*) { return new CircleGM; } |
| 217 static GMRegistry reg(MyFactory); | 212 static GMRegistry reg(MyFactory); |
| 218 | 213 |
| 219 } | 214 } |
| OLD | NEW |