OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google 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 "SampleCode.h" | 8 #include "SampleCode.h" |
9 #include "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
10 #include "SkBlurMaskFilter.h" | 10 #include "SkBlurMaskFilter.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 paint->setMaskFilter(SkBlurMaskFilter::Create( | 26 paint->setMaskFilter(SkBlurMaskFilter::Create( |
27 SkBlurMaskFilter::kNormal_BlurStyle, | 27 SkBlurMaskFilter::kNormal_BlurStyle, |
28 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(2
))))->unref(); | 28 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(2
))))->unref(); |
29 } | 29 } |
30 | 30 |
31 static void paint_proc2(SkPaint* paint) { | 31 static void paint_proc2(SkPaint* paint) { |
32 SkScalar dir[3] = { 1, 1, 1}; | 32 SkScalar dir[3] = { 1, 1, 1}; |
33 paint->setMaskFilter( | 33 paint->setMaskFilter( |
34 SkBlurMaskFilter::CreateEmboss(SkBlurMask::ConvertRadiusToSigma(SkIn
tToScalar(1)), | 34 SkBlurMaskFilter::CreateEmboss(SkBlurMask::ConvertRadiusToSigma(SkIn
tToScalar(1)), |
35 dir, | 35 dir, |
36 SkFloatToScalar(0.1f), | 36 0.1f, |
37 SkFloatToScalar(0.05f)))->unref(); | 37 0.05f))->unref(); |
38 } | 38 } |
39 | 39 |
40 static void paint_proc3(SkPaint* paint) { | 40 static void paint_proc3(SkPaint* paint) { |
41 SkColor colors[] = { SK_ColorRED, COLOR, SK_ColorBLUE }; | 41 SkColor colors[] = { SK_ColorRED, COLOR, SK_ColorBLUE }; |
42 SkPoint pts[] = { { 3, 0 }, { 7, 5 } }; | 42 SkPoint pts[] = { { 3, 0 }, { 7, 5 } }; |
43 paint->setShader(SkGradientShader::CreateLinear(pts, colors, NULL, SK_ARRAY_
COUNT(colors), | 43 paint->setShader(SkGradientShader::CreateLinear(pts, colors, NULL, SK_ARRAY_
COUNT(colors), |
44 SkShader::kMirror_TileMode))->unref(); | 44 SkShader::kMirror_TileMode))->unref(); |
45 } | 45 } |
46 | 46 |
47 static void paint_proc5(SkPaint* paint) { | 47 static void paint_proc5(SkPaint* paint) { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 } | 114 } |
115 | 115 |
116 private: | 116 private: |
117 typedef SampleView INHERITED; | 117 typedef SampleView INHERITED; |
118 }; | 118 }; |
119 | 119 |
120 /////////////////////////////////////////////////////////////////////////////// | 120 /////////////////////////////////////////////////////////////////////////////// |
121 | 121 |
122 static SkView* MyFactory() { return new EffectsView; } | 122 static SkView* MyFactory() { return new EffectsView; } |
123 static SkViewRegister reg(MyFactory); | 123 static SkViewRegister reg(MyFactory); |
OLD | NEW |