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 22 matching lines...) Expand all Loading... |
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 0.1f, | 36 0.1f, |
37 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, nullptr, SK_ARR
AY_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) { |
48 paint_proc3(paint); | 48 paint_proc3(paint); |
49 paint_proc2(paint); | 49 paint_proc2(paint); |
50 } | 50 } |
51 | 51 |
52 typedef void (*PaintProc)(SkPaint*); | 52 typedef void (*PaintProc)(SkPaint*); |
53 const PaintProc gPaintProcs[] = { | 53 const PaintProc gPaintProcs[] = { |
(...skipping 60 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 |