| 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 "SkTArray.h" | 9 #include "SkTArray.h" |
| 10 #include "SkRandom.h" | 10 #include "SkRandom.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // AA | 43 // AA |
| 44 SkPaint p; | 44 SkPaint p; |
| 45 p.setAntiAlias(true); | 45 p.setAntiAlias(true); |
| 46 fPaints.push_back(p); | 46 fPaints.push_back(p); |
| 47 } | 47 } |
| 48 | 48 |
| 49 { | 49 { |
| 50 // AA with mask filter | 50 // AA with mask filter |
| 51 SkPaint p; | 51 SkPaint p; |
| 52 p.setAntiAlias(true); | 52 p.setAntiAlias(true); |
| 53 SkMaskFilter* mf = SkBlurMaskFilter::Create(SkIntToScalar(5), | 53 SkMaskFilter* mf = SkBlurMaskFilter::Create( |
| 54 SkBlurMaskFilter::kNormal_BlurStyle, | 54 SkBlurMaskFilter::kNormal_BlurStyle, |
| 55 SkFloatToScalar(3.38675f), |
| 55 SkBlurMaskFilter::kHighQuality_BlurFlag); | 56 SkBlurMaskFilter::kHighQuality_BlurFlag); |
| 56 p.setMaskFilter(mf)->unref(); | 57 p.setMaskFilter(mf)->unref(); |
| 57 fPaints.push_back(p); | 58 fPaints.push_back(p); |
| 58 } | 59 } |
| 59 | 60 |
| 60 { | 61 { |
| 61 // AA with radial shader | 62 // AA with radial shader |
| 62 SkPaint p; | 63 SkPaint p; |
| 63 p.setAntiAlias(true); | 64 p.setAntiAlias(true); |
| 64 SkPoint center = SkPoint::Make(SkIntToScalar(40), SkIntToScalar(40)); | 65 SkPoint center = SkPoint::Make(SkIntToScalar(40), SkIntToScalar(40)); |
| 65 SkColor colors[] = { SK_ColorBLUE, SK_ColorRED, SK_ColorGREEN }; | 66 SkColor colors[] = { SK_ColorBLUE, SK_ColorRED, SK_ColorGREEN }; |
| 66 SkScalar pos[] = { 0, SK_ScalarHalf, SK_Scalar1 }; | 67 SkScalar pos[] = { 0, SK_ScalarHalf, SK_Scalar1 }; |
| 67 SkShader* s = SkGradientShader::CreateRadial(center, | 68 SkShader* s = SkGradientShader::CreateRadial(center, |
| 68 SkIntToScalar(20), | 69 SkIntToScalar(20), |
| 69 colors, | 70 colors, |
| 70 pos, | 71 pos, |
| 71 SK_ARRAY_COUNT(colors), | 72 SK_ARRAY_COUNT(colors), |
| 72 SkShader::kClamp_TileMode); | 73 SkShader::kClamp_TileMode); |
| 73 p.setShader(s)->unref(); | 74 p.setShader(s)->unref(); |
| 74 fPaints.push_back(p); | 75 fPaints.push_back(p); |
| 75 } | 76 } |
| 76 | 77 |
| 77 { | 78 { |
| 78 // AA with blur | 79 // AA with blur |
| 79 SkPaint p; | 80 SkPaint p; |
| 80 p.setAntiAlias(true); | 81 p.setAntiAlias(true); |
| 81 SkBlurDrawLooper* shadowLooper = | 82 SkBlurDrawLooper* shadowLooper = |
| 82 new SkBlurDrawLooper (SkIntToScalar(10), SkIntToScalar(5), | 83 new SkBlurDrawLooper (SK_ColorBLUE, SkFloatToScalar(6.2735f), |
| 83 SkIntToScalar(10), 0xFF0000FF, | 84 SkIntToScalar(5), SkIntToScalar(10), |
| 84 SkBlurDrawLooper::kIgnoreTransform_BlurFlag | | 85 SkBlurDrawLooper::kIgnoreTransform_BlurFlag | |
| 85 SkBlurDrawLooper::kOverrideColor_BlurFlag | | 86 SkBlurDrawLooper::kOverrideColor_BlurFlag | |
| 86 SkBlurDrawLooper::kHighQuality_BlurFlag); | 87 SkBlurDrawLooper::kHighQuality_BlurFlag); |
| 87 SkAutoUnref aurL0(shadowLooper); | 88 SkAutoUnref aurL0(shadowLooper); |
| 88 p.setLooper(shadowLooper); | 89 p.setLooper(shadowLooper); |
| 89 fPaints.push_back(p); | 90 fPaints.push_back(p); |
| 90 } | 91 } |
| 91 | 92 |
| 92 { | 93 { |
| 93 // AA with stroke style | 94 // AA with stroke style |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 SkTArray<SkPaint> fPaints; | 197 SkTArray<SkPaint> fPaints; |
| 197 SkTArray<SkMatrix> fMatrices; | 198 SkTArray<SkMatrix> fMatrices; |
| 198 }; | 199 }; |
| 199 | 200 |
| 200 ////////////////////////////////////////////////////////////////////////////// | 201 ////////////////////////////////////////////////////////////////////////////// |
| 201 | 202 |
| 202 static GM* MyFactory(void*) { return new CircleGM; } | 203 static GM* MyFactory(void*) { return new CircleGM; } |
| 203 static GMRegistry reg(MyFactory); | 204 static GMRegistry reg(MyFactory); |
| 204 | 205 |
| 205 } | 206 } |
| OLD | NEW |