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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 void onDraw(SkCanvas* canvas) override { | 87 void onDraw(SkCanvas* canvas) override { |
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::Create(SkIntToScalar(12), SkIntToScalar(12)), | 97 SkBlurImageFilter::Make(SkIntToScalar(12), SkIntToScalar(12), nullpt
r).release(), |
98 SkDropShadowImageFilter::Create(SkIntToScalar(10), SkIntToScalar(10)
, | 98 SkDropShadowImageFilter::Create(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 SkDisplacementMapEffect::Create(SkDisplacementMapEffect::kR_ChannelS
electorType, | 101 SkDisplacementMapEffect::Create(SkDisplacementMapEffect::kR_ChannelS
electorType, |
102 SkDisplacementMapEffect::kR_ChannelS
electorType, | 102 SkDisplacementMapEffect::kR_ChannelS
electorType, |
103 SkIntToScalar(12), | 103 SkIntToScalar(12), |
104 gradient.get(), | 104 gradient.get(), |
105 checkerboard.get()), | 105 checkerboard.get()), |
106 SkDilateImageFilter::Create(2, 2, checkerboard.get()), | 106 SkDilateImageFilter::Create(2, 2, checkerboard.get()), |
107 SkErodeImageFilter::Create(2, 2, checkerboard.get()), | 107 SkErodeImageFilter::Create(2, 2, checkerboard.get()), |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 private: | 151 private: |
152 sk_sp<SkImage> fCheckerboard, fGradientCircle; | 152 sk_sp<SkImage> fCheckerboard, fGradientCircle; |
153 | 153 |
154 typedef GM INHERITED; | 154 typedef GM INHERITED; |
155 }; | 155 }; |
156 | 156 |
157 ////////////////////////////////////////////////////////////////////////////// | 157 ////////////////////////////////////////////////////////////////////////////// |
158 | 158 |
159 DEF_GM(return new ImageFiltersClippedGM;) | 159 DEF_GM(return new ImageFiltersClippedGM;) |
160 } | 160 } |
OLD | NEW |