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 SkShader* s = SkGradientShader::CreateRadial(center, | 83 p.setShader(SkGradientShader::MakeRadial(center, 20, colors, pos, |
84 SkIntToScalar(20), | 84 SK_ARRAY_COUNT(colors), |
85 colors, | 85 SkShader::kClamp_TileMode))
; |
86 pos, | |
87 SK_ARRAY_COUNT(colors), | |
88 SkShader::kClamp_TileMo
de); | |
89 p.setShader(s)->unref(); | |
90 fPaints.push_back(p); | 86 fPaints.push_back(p); |
91 } | 87 } |
92 | 88 |
93 { | 89 { |
94 // AA with blur | 90 // AA with blur |
95 SkPaint p; | 91 SkPaint p; |
96 p.setColor(SK_ColorWHITE); | 92 p.setColor(SK_ColorWHITE); |
97 p.setAntiAlias(true); | 93 p.setAntiAlias(true); |
98 SkDrawLooper* shadowLooper = | 94 SkDrawLooper* shadowLooper = |
99 SkBlurDrawLooper::Create(SK_ColorWHITE, | 95 SkBlurDrawLooper::Create(SK_ColorWHITE, |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 | 283 |
288 typedef GM INHERITED; | 284 typedef GM INHERITED; |
289 }; | 285 }; |
290 | 286 |
291 ////////////////////////////////////////////////////////////////////////////// | 287 ////////////////////////////////////////////////////////////////////////////// |
292 | 288 |
293 static GM* MyFactory(void*) { return new RectsGM; } | 289 static GM* MyFactory(void*) { return new RectsGM; } |
294 static GMRegistry reg(MyFactory); | 290 static GMRegistry reg(MyFactory); |
295 | 291 |
296 } | 292 } |
OLD | NEW |