OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "sk_tool_utils.h" | 8 #include "sk_tool_utils.h" |
9 #include "SkBitmapSource.h" | 9 #include "SkBitmapSource.h" |
10 #include "SkBlurImageFilter.h" | 10 #include "SkBlurImageFilter.h" |
11 #include "SkColor.h" | 11 #include "SkColor.h" |
12 #include "SkDisplacementMapEffect.h" | 12 #include "SkDisplacementMapEffect.h" |
13 #include "SkDropShadowImageFilter.h" | 13 #include "SkDropShadowImageFilter.h" |
14 #include "SkGradientShader.h" | 14 #include "SkGradientShader.h" |
15 #include "SkLightingImageFilter.h" | 15 #include "SkLightingImageFilter.h" |
16 #include "SkMatrixImageFilter.h" | |
17 #include "SkMorphologyImageFilter.h" | 16 #include "SkMorphologyImageFilter.h" |
18 #include "SkOffsetImageFilter.h" | 17 #include "SkOffsetImageFilter.h" |
19 #include "SkPerlinNoiseShader.h" | 18 #include "SkPerlinNoiseShader.h" |
20 #include "SkRectShaderImageFilter.h" | 19 #include "SkRectShaderImageFilter.h" |
21 #include "SkScalar.h" | 20 #include "SkScalar.h" |
22 #include "gm.h" | 21 #include "gm.h" |
23 | 22 |
24 #define RESIZE_FACTOR SkIntToScalar(4) | 23 #define RESIZE_FACTOR SkIntToScalar(4) |
25 | 24 |
26 namespace skiagm { | 25 namespace skiagm { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 SkIntToScalar(3), SkIntToScalar(3), SK_ColorYELLOW, | 92 SkIntToScalar(3), SkIntToScalar(3), SK_ColorYELLOW, |
94 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode), | 93 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode), |
95 SkDisplacementMapEffect::Create(SkDisplacementMapEffect::kR_ChannelS
electorType, | 94 SkDisplacementMapEffect::Create(SkDisplacementMapEffect::kR_ChannelS
electorType, |
96 SkDisplacementMapEffect::kR_ChannelS
electorType, | 95 SkDisplacementMapEffect::kR_ChannelS
electorType, |
97 SkIntToScalar(12), | 96 SkIntToScalar(12), |
98 gradient.get(), | 97 gradient.get(), |
99 checkerboard.get()), | 98 checkerboard.get()), |
100 SkDilateImageFilter::Create(1, 1, checkerboard.get()), | 99 SkDilateImageFilter::Create(1, 1, checkerboard.get()), |
101 SkErodeImageFilter::Create(1, 1, checkerboard.get()), | 100 SkErodeImageFilter::Create(1, 1, checkerboard.get()), |
102 SkOffsetImageFilter::Create(SkIntToScalar(32), 0), | 101 SkOffsetImageFilter::Create(SkIntToScalar(32), 0), |
103 SkMatrixImageFilter::Create(resizeMatrix, kNone_SkFilterQuality), | 102 SkImageFilter::CreateMatrixFilter(resizeMatrix, kNone_SkFilterQualit
y), |
104 SkRectShaderImageFilter::Create(noise), | 103 SkRectShaderImageFilter::Create(noise), |
105 SkLightingImageFilter::CreatePointLitDiffuse(pointLocation, white, s
urfaceScale, kd), | 104 SkLightingImageFilter::CreatePointLitDiffuse(pointLocation, white, s
urfaceScale, kd), |
106 SkLightingImageFilter::CreateSpotLitDiffuse(spotLocation, spotTarget
, spotExponent, | 105 SkLightingImageFilter::CreateSpotLitDiffuse(spotLocation, spotTarget
, spotExponent, |
107 cutoffAngle, white, surf
aceScale, kd), | 106 cutoffAngle, white, surf
aceScale, kd), |
108 }; | 107 }; |
109 | 108 |
110 SkVector scales[] = { | 109 SkVector scales[] = { |
111 SkVector::Make(SkScalarInvert(2), SkScalarInvert(2)), | 110 SkVector::Make(SkScalarInvert(2), SkScalarInvert(2)), |
112 SkVector::Make(SkIntToScalar(1), SkIntToScalar(1)), | 111 SkVector::Make(SkIntToScalar(1), SkIntToScalar(1)), |
113 SkVector::Make(SkIntToScalar(1), SkIntToScalar(2)), | 112 SkVector::Make(SkIntToScalar(1), SkIntToScalar(2)), |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 SkBitmap fGradientCircle; | 154 SkBitmap fGradientCircle; |
156 typedef GM INHERITED; | 155 typedef GM INHERITED; |
157 }; | 156 }; |
158 | 157 |
159 ////////////////////////////////////////////////////////////////////////////// | 158 ////////////////////////////////////////////////////////////////////////////// |
160 | 159 |
161 static GM* MyFactory(void*) { return new ImageFiltersScaledGM; } | 160 static GM* MyFactory(void*) { return new ImageFiltersScaledGM; } |
162 static GMRegistry reg(MyFactory); | 161 static GMRegistry reg(MyFactory); |
163 | 162 |
164 } | 163 } |
OLD | NEW |