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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 sk_sp<SkImageFilter> filters[] = { | 96 sk_sp<SkImageFilter> filters[] = { |
97 SkBlurImageFilter::Make(SkIntToScalar(12), SkIntToScalar(12), nullpt
r), | 97 SkBlurImageFilter::Make(SkIntToScalar(12), SkIntToScalar(12), nullpt
r), |
98 SkDropShadowImageFilter::Make( | 98 SkDropShadowImageFilter::Make( |
99 SkIntToScalar(10), SkIntToScalar(10), | 99 SkIntToScalar(10), SkIntToScalar(10), |
100 SkIntToScalar(3), SkIntToScalar(3), SK_Color
GREEN, | 100 SkIntToScalar(3), SkIntToScalar(3), SK_Color
GREEN, |
101 SkDropShadowImageFilter::kDrawShadowAndForeg
round_ShadowMode, | 101 SkDropShadowImageFilter::kDrawShadowAndForeg
round_ShadowMode, |
102 nullptr), | 102 nullptr), |
103 sk_sp<SkImageFilter>(SkDisplacementMapEffect::Create( | 103 SkDisplacementMapEffect::Make(SkDisplacementMapEffect::kR_ChannelSel
ectorType, |
104 SkDisplacementMapEffect::kR_ChannelS
electorType, | 104 SkDisplacementMapEffect::kR_ChannelSel
ectorType, |
105 SkDisplacementMapEffect::kR_ChannelS
electorType, | 105 SkIntToScalar(12), |
106 SkIntToScalar(12), | 106 std::move(gradient), |
107 gradient.get(), | 107 checkerboard), |
108 checkerboard.get())), | |
109 SkDilateImageFilter::Make(2, 2, checkerboard), | 108 SkDilateImageFilter::Make(2, 2, checkerboard), |
110 SkErodeImageFilter::Make(2, 2, checkerboard), | 109 SkErodeImageFilter::Make(2, 2, checkerboard), |
111 SkOffsetImageFilter::Make(SkIntToScalar(-16), SkIntToScalar(32), nul
lptr), | 110 SkOffsetImageFilter::Make(SkIntToScalar(-16), SkIntToScalar(32), nul
lptr), |
112 SkImageFilter::MakeMatrixFilter(resizeMatrix, kNone_SkFilterQuality,
nullptr), | 111 SkImageFilter::MakeMatrixFilter(resizeMatrix, kNone_SkFilterQuality,
nullptr), |
113 SkLightingImageFilter::MakePointLitDiffuse(pointLocation, SK_ColorWH
ITE, SK_Scalar1, | 112 SkLightingImageFilter::MakePointLitDiffuse(pointLocation, SK_ColorWH
ITE, SK_Scalar1, |
114 SkIntToScalar(2), checker
board), | 113 SkIntToScalar(2), checker
board), |
115 | 114 |
116 }; | 115 }; |
117 | 116 |
118 SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64)); | 117 SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64)); |
(...skipping 29 matching lines...) Expand all Loading... |
148 private: | 147 private: |
149 sk_sp<SkImage> fCheckerboard, fGradientCircle; | 148 sk_sp<SkImage> fCheckerboard, fGradientCircle; |
150 | 149 |
151 typedef GM INHERITED; | 150 typedef GM INHERITED; |
152 }; | 151 }; |
153 | 152 |
154 ////////////////////////////////////////////////////////////////////////////// | 153 ////////////////////////////////////////////////////////////////////////////// |
155 | 154 |
156 DEF_GM(return new ImageFiltersClippedGM;) | 155 DEF_GM(return new ImageFiltersClippedGM;) |
157 } | 156 } |
OLD | NEW |