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 "SkBlurDrawLooper.h" | 9 #include "SkBlurDrawLooper.h" |
10 #include "SkBlurMask.h" | 10 #include "SkBlurMask.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 } | 73 } |
74 | 74 |
75 { | 75 { |
76 // AA with radial shader | 76 // AA with radial shader |
77 SkPaint p; | 77 SkPaint p; |
78 p.setColor(SK_ColorWHITE); | 78 p.setColor(SK_ColorWHITE); |
79 p.setAntiAlias(true); | 79 p.setAntiAlias(true); |
80 SkPoint center = SkPoint::Make(SkIntToScalar(-5), SkIntToScalar(30))
; | 80 SkPoint center = SkPoint::Make(SkIntToScalar(-5), SkIntToScalar(30))
; |
81 SkColor colors[] = { SK_ColorBLUE, SK_ColorRED, SK_ColorGREEN }; | 81 SkColor colors[] = { SK_ColorBLUE, SK_ColorRED, SK_ColorGREEN }; |
82 SkScalar pos[] = { 0, SK_ScalarHalf, SK_Scalar1 }; | 82 SkScalar pos[] = { 0, SK_ScalarHalf, SK_Scalar1 }; |
83 p.setShader(SkGradientShader::MakeRadial(center, 20, colors, pos, | 83 SkShader* s = SkGradientShader::CreateRadial(center, |
84 SK_ARRAY_COUNT(colors), | 84 SkIntToScalar(20), |
85 SkShader::kClamp_TileMode))
; | 85 colors, |
| 86 pos, |
| 87 SK_ARRAY_COUNT(colors), |
| 88 SkShader::kClamp_TileMo
de); |
| 89 p.setShader(s)->unref(); |
86 fPaints.push_back(p); | 90 fPaints.push_back(p); |
87 } | 91 } |
88 | 92 |
89 { | 93 { |
90 // AA with blur | 94 // AA with blur |
91 SkPaint p; | 95 SkPaint p; |
92 p.setColor(SK_ColorWHITE); | 96 p.setColor(SK_ColorWHITE); |
93 p.setAntiAlias(true); | 97 p.setAntiAlias(true); |
94 SkDrawLooper* shadowLooper = | 98 SkDrawLooper* shadowLooper = |
95 SkBlurDrawLooper::Create(SK_ColorWHITE, | 99 SkBlurDrawLooper::Create(SK_ColorWHITE, |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 | 287 |
284 typedef GM INHERITED; | 288 typedef GM INHERITED; |
285 }; | 289 }; |
286 | 290 |
287 ////////////////////////////////////////////////////////////////////////////// | 291 ////////////////////////////////////////////////////////////////////////////// |
288 | 292 |
289 static GM* MyFactory(void*) { return new RectsGM; } | 293 static GM* MyFactory(void*) { return new RectsGM; } |
290 static GMRegistry reg(MyFactory); | 294 static GMRegistry reg(MyFactory); |
291 | 295 |
292 } | 296 } |
OLD | NEW |