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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 canvas->clear(SK_ColorBLACK); | 88 canvas->clear(SK_ColorBLACK); |
89 | 89 |
90 sk_sp<SkImageFilter> gradient(SkImageSource::Make(fGradientCircle)); | 90 sk_sp<SkImageFilter> gradient(SkImageSource::Make(fGradientCircle)); |
91 sk_sp<SkImageFilter> checkerboard(SkImageSource::Make(fCheckerboard)); | 91 sk_sp<SkImageFilter> checkerboard(SkImageSource::Make(fCheckerboard)); |
92 SkMatrix resizeMatrix; | 92 SkMatrix resizeMatrix; |
93 resizeMatrix.setScale(RESIZE_FACTOR_X, RESIZE_FACTOR_Y); | 93 resizeMatrix.setScale(RESIZE_FACTOR_X, RESIZE_FACTOR_Y); |
94 SkPoint3 pointLocation = SkPoint3::Make(32, 32, SkIntToScalar(10)); | 94 SkPoint3 pointLocation = SkPoint3::Make(32, 32, SkIntToScalar(10)); |
95 | 95 |
96 SkImageFilter* filters[] = { | 96 SkImageFilter* filters[] = { |
97 SkBlurImageFilter::Make(SkIntToScalar(12), SkIntToScalar(12), nullpt
r).release(), | 97 SkBlurImageFilter::Make(SkIntToScalar(12), SkIntToScalar(12), nullpt
r).release(), |
98 SkDropShadowImageFilter::Create(SkIntToScalar(10), SkIntToScalar(10)
, | 98 SkDropShadowImageFilter::Make(SkIntToScalar(10), SkIntToScalar(10), |
99 SkIntToScalar(3), SkIntToScalar(3), SK_ColorGREEN, | 99 SkIntToScalar(3), SkIntToScalar(3), SK_ColorGREEN, |
100 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode), | 100 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode, |
| 101 nullptr).release(), |
101 SkDisplacementMapEffect::Create(SkDisplacementMapEffect::kR_ChannelS
electorType, | 102 SkDisplacementMapEffect::Create(SkDisplacementMapEffect::kR_ChannelS
electorType, |
102 SkDisplacementMapEffect::kR_ChannelS
electorType, | 103 SkDisplacementMapEffect::kR_ChannelS
electorType, |
103 SkIntToScalar(12), | 104 SkIntToScalar(12), |
104 gradient.get(), | 105 gradient.get(), |
105 checkerboard.get()), | 106 checkerboard.get()), |
106 SkDilateImageFilter::Make(2, 2, checkerboard).release(), | 107 SkDilateImageFilter::Make(2, 2, checkerboard).release(), |
107 SkErodeImageFilter::Make(2, 2, checkerboard).release(), | 108 SkErodeImageFilter::Make(2, 2, checkerboard).release(), |
108 SkOffsetImageFilter::Make(SkIntToScalar(-16), SkIntToScalar(32), nul
lptr).release(), | 109 SkOffsetImageFilter::Make(SkIntToScalar(-16), SkIntToScalar(32), nul
lptr).release(), |
109 SkImageFilter::MakeMatrixFilter(resizeMatrix, kNone_SkFilterQuality,
nullptr).release(), | 110 SkImageFilter::MakeMatrixFilter(resizeMatrix, kNone_SkFilterQuality,
nullptr).release(), |
110 SkLightingImageFilter::CreatePointLitDiffuse(pointLocation, SK_Color
WHITE, SK_Scalar1, | 111 SkLightingImageFilter::CreatePointLitDiffuse(pointLocation, SK_Color
WHITE, SK_Scalar1, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 private: | 150 private: |
150 sk_sp<SkImage> fCheckerboard, fGradientCircle; | 151 sk_sp<SkImage> fCheckerboard, fGradientCircle; |
151 | 152 |
152 typedef GM INHERITED; | 153 typedef GM INHERITED; |
153 }; | 154 }; |
154 | 155 |
155 ////////////////////////////////////////////////////////////////////////////// | 156 ////////////////////////////////////////////////////////////////////////////// |
156 | 157 |
157 DEF_GM(return new ImageFiltersClippedGM;) | 158 DEF_GM(return new ImageFiltersClippedGM;) |
158 } | 159 } |
OLD | NEW |