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 "gm.h" | 8 #include "gm.h" |
9 #include "SkColor.h" | 9 #include "SkColor.h" |
10 #include "SkBitmapSource.h" | 10 #include "SkBitmapSource.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 SkAutoTUnref<SkImageFilter> gradient(SkBitmapSource::Create(fGradientCir
cle)); | 94 SkAutoTUnref<SkImageFilter> gradient(SkBitmapSource::Create(fGradientCir
cle)); |
95 SkAutoTUnref<SkImageFilter> checkerboard(SkBitmapSource::Create(fChecker
board)); | 95 SkAutoTUnref<SkImageFilter> checkerboard(SkBitmapSource::Create(fChecker
board)); |
96 SkAutoTUnref<SkShader> noise(SkPerlinNoiseShader::CreateFractalNoise( | 96 SkAutoTUnref<SkShader> noise(SkPerlinNoiseShader::CreateFractalNoise( |
97 SkDoubleToScalar(0.1), SkDoubleToScalar(0.05), 1, 0)); | 97 SkDoubleToScalar(0.1), SkDoubleToScalar(0.05), 1, 0)); |
98 SkMatrix resizeMatrix; | 98 SkMatrix resizeMatrix; |
99 resizeMatrix.setScale(RESIZE_FACTOR_X, RESIZE_FACTOR_Y); | 99 resizeMatrix.setScale(RESIZE_FACTOR_X, RESIZE_FACTOR_Y); |
100 | 100 |
101 SkImageFilter* filters[] = { | 101 SkImageFilter* filters[] = { |
102 SkBlurImageFilter::Create(SkIntToScalar(12), SkIntToScalar(12)), | 102 SkBlurImageFilter::Create(SkIntToScalar(12), SkIntToScalar(12)), |
103 SkDropShadowImageFilter::Create(SkIntToScalar(10), SkIntToScalar(10)
, | 103 SkDropShadowImageFilter::Create(SkIntToScalar(10), SkIntToScalar(10)
, |
104 SkIntToScalar(3), SkIntToScalar(3), | 104 SkIntToScalar(3), SkIntToScalar(3), SK_ColorGREEN, |
105 SK_ColorGREEN), | 105 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode), |
106 SkDisplacementMapEffect::Create(SkDisplacementMapEffect::kR_ChannelS
electorType, | 106 SkDisplacementMapEffect::Create(SkDisplacementMapEffect::kR_ChannelS
electorType, |
107 SkDisplacementMapEffect::kR_ChannelS
electorType, | 107 SkDisplacementMapEffect::kR_ChannelS
electorType, |
108 SkIntToScalar(12), | 108 SkIntToScalar(12), |
109 gradient.get(), | 109 gradient.get(), |
110 checkerboard.get()), | 110 checkerboard.get()), |
111 SkDilateImageFilter::Create(2, 2, checkerboard.get()), | 111 SkDilateImageFilter::Create(2, 2, checkerboard.get()), |
112 SkErodeImageFilter::Create(2, 2, checkerboard.get()), | 112 SkErodeImageFilter::Create(2, 2, checkerboard.get()), |
113 SkOffsetImageFilter::Create(SkIntToScalar(-16), SkIntToScalar(32)), | 113 SkOffsetImageFilter::Create(SkIntToScalar(-16), SkIntToScalar(32)), |
114 SkMatrixImageFilter::Create(resizeMatrix, SkPaint::kNone_FilterLevel
), | 114 SkMatrixImageFilter::Create(resizeMatrix, SkPaint::kNone_FilterLevel
), |
115 SkRectShaderImageFilter::Create(noise), | 115 SkRectShaderImageFilter::Create(noise), |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 SkBitmap fGradientCircle; | 156 SkBitmap fGradientCircle; |
157 typedef GM INHERITED; | 157 typedef GM INHERITED; |
158 }; | 158 }; |
159 | 159 |
160 ////////////////////////////////////////////////////////////////////////////// | 160 ////////////////////////////////////////////////////////////////////////////// |
161 | 161 |
162 static GM* MyFactory(void*) { return new ImageFiltersClippedGM; } | 162 static GM* MyFactory(void*) { return new ImageFiltersClippedGM; } |
163 static GMRegistry reg(MyFactory); | 163 static GMRegistry reg(MyFactory); |
164 | 164 |
165 } | 165 } |
OLD | NEW |