| 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" |
| 11 #include "SkCanvas.h" | 11 #include "SkCanvas.h" |
| 12 #include "SkColorMatrixFilter.h" | 12 #include "SkColorMatrixFilter.h" |
| 13 #include "SkDiscretePathEffect.h" | 13 #include "SkDiscretePathEffect.h" |
| 14 #include "SkGradientShader.h" | 14 #include "SkGradientShader.h" |
| 15 #include "SkPaint.h" | 15 #include "SkPaint.h" |
| 16 #include "SkView.h" | 16 #include "SkView.h" |
| 17 | 17 |
| 18 | 18 |
| 19 //#define COLOR 0xFFFF8844 | 19 //#define COLOR 0xFFFF8844 |
| 20 #define COLOR 0xFF888888 | 20 #define COLOR 0xFF888888 |
| 21 | 21 |
| 22 static void paint_proc0(SkPaint*) { | 22 static void paint_proc0(SkPaint*) { |
| 23 } | 23 } |
| 24 | 24 |
| 25 static void paint_proc1(SkPaint* paint) { | 25 static void paint_proc1(SkPaint* paint) { |
| 26 paint->setMaskFilter(SkBlurMaskFilter::Create( | 26 paint->setMaskFilter(SkBlurMaskFilter::Create( |
| 27 SkBlurMaskFilter::kNormal_BlurStyle, | 27 kNormal_SkBlurStyle, |
| 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 0.1f, | 36 0.1f, |
| 37 0.05f))->unref(); | 37 0.05f))->unref(); |
| (...skipping 76 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 |