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 "SkBlurImageFilter.h" | 9 #include "SkBlurImageFilter.h" |
10 #include "SkColor.h" | 10 #include "SkColor.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 SkScalar spotExponent = SK_Scalar1; | 67 SkScalar spotExponent = SK_Scalar1; |
68 SkScalar cutoffAngle = SkIntToScalar(15); | 68 SkScalar cutoffAngle = SkIntToScalar(15); |
69 SkScalar kd = SkIntToScalar(2); | 69 SkScalar kd = SkIntToScalar(2); |
70 SkScalar surfaceScale = SkIntToScalar(1); | 70 SkScalar surfaceScale = SkIntToScalar(1); |
71 SkColor white(0xFFFFFFFF); | 71 SkColor white(0xFFFFFFFF); |
72 SkMatrix resizeMatrix; | 72 SkMatrix resizeMatrix; |
73 resizeMatrix.setScale(RESIZE_FACTOR, RESIZE_FACTOR); | 73 resizeMatrix.setScale(RESIZE_FACTOR, RESIZE_FACTOR); |
74 | 74 |
75 SkImageFilter* filters[] = { | 75 SkImageFilter* filters[] = { |
76 SkBlurImageFilter::Make(SkIntToScalar(4), SkIntToScalar(4), nullptr)
.release(), | 76 SkBlurImageFilter::Make(SkIntToScalar(4), SkIntToScalar(4), nullptr)
.release(), |
77 SkDropShadowImageFilter::Create(SkIntToScalar(5), SkIntToScalar(10), | 77 SkDropShadowImageFilter::Make(SkIntToScalar(5), SkIntToScalar(10), |
78 SkIntToScalar(3), SkIntToScalar(3), SK_ColorYELLOW, | 78 SkIntToScalar(3), SkIntToScalar(3), SK_ColorYELLOW, |
79 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode), | 79 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode, nu
llptr).release(), |
80 SkDisplacementMapEffect::Create(SkDisplacementMapEffect::kR_ChannelS
electorType, | 80 SkDisplacementMapEffect::Create(SkDisplacementMapEffect::kR_ChannelS
electorType, |
81 SkDisplacementMapEffect::kR_ChannelS
electorType, | 81 SkDisplacementMapEffect::kR_ChannelS
electorType, |
82 SkIntToScalar(12), | 82 SkIntToScalar(12), |
83 gradient.get(), | 83 gradient.get(), |
84 checkerboard.get()), | 84 checkerboard.get()), |
85 SkDilateImageFilter::Make(1, 1, checkerboard).release(), | 85 SkDilateImageFilter::Make(1, 1, checkerboard).release(), |
86 SkErodeImageFilter::Make(1, 1, checkerboard).release(), | 86 SkErodeImageFilter::Make(1, 1, checkerboard).release(), |
87 SkOffsetImageFilter::Make(SkIntToScalar(32), 0, nullptr).release(), | 87 SkOffsetImageFilter::Make(SkIntToScalar(32), 0, nullptr).release(), |
88 SkImageFilter::MakeMatrixFilter(resizeMatrix, kNone_SkFilterQuality,
nullptr).release(), | 88 SkImageFilter::MakeMatrixFilter(resizeMatrix, kNone_SkFilterQuality,
nullptr).release(), |
89 SkPaintImageFilter::Make(noisePaint).release(), | 89 SkPaintImageFilter::Make(noisePaint).release(), |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 sk_sp<SkImage> fCheckerboard, fGradientCircle; | 156 sk_sp<SkImage> fCheckerboard, fGradientCircle; |
157 | 157 |
158 typedef GM INHERITED; | 158 typedef GM INHERITED; |
159 }; | 159 }; |
160 | 160 |
161 ////////////////////////////////////////////////////////////////////////////// | 161 ////////////////////////////////////////////////////////////////////////////// |
162 | 162 |
163 DEF_GM(return new ImageFiltersScaledGM;) | 163 DEF_GM(return new ImageFiltersScaledGM;) |
164 } | 164 } |
OLD | NEW |