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 "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkColorFilter.h" | 10 #include "SkColorFilter.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 8.0f, 8.0f, noop_cropped.get(), &big_rect)); | 135 8.0f, 8.0f, noop_cropped.get(), &big_rect)); |
136 | 136 |
137 draw(canvas, checkerboard, rect, SkDilateImageFilter::Create( | 137 draw(canvas, checkerboard, rect, SkDilateImageFilter::Create( |
138 2, 2, noop_cropped.get(), &big_rect)); | 138 2, 2, noop_cropped.get(), &big_rect)); |
139 | 139 |
140 draw(canvas, checkerboard, rect, SkErodeImageFilter::Create( | 140 draw(canvas, checkerboard, rect, SkErodeImageFilter::Create( |
141 2, 2, noop_cropped.get(), &big_rect)); | 141 2, 2, noop_cropped.get(), &big_rect)); |
142 | 142 |
143 draw(canvas, checkerboard, rect, SkDropShadowImageFilter::Create( | 143 draw(canvas, checkerboard, rect, SkDropShadowImageFilter::Create( |
144 SkIntToScalar(10), SkIntToScalar(10), SkIntToScalar(3), SkIntToS
calar(3), | 144 SkIntToScalar(10), SkIntToScalar(10), SkIntToScalar(3), SkIntToS
calar(3), |
145 SK_ColorBLUE, noop_cropped.get(), &big_rect)); | 145 SK_ColorBLUE, SkDropShadowImageFilter::kDrawShadowAndForeground_
ShadowMode, |
| 146 noop_cropped.get(), &big_rect, 0)); |
146 | 147 |
147 draw(canvas, checkerboard, rect, SkDisplacementMapEffect::Create( | 148 draw(canvas, checkerboard, rect, SkDisplacementMapEffect::Create( |
148 SkDisplacementMapEffect::kR_ChannelSelectorType, | 149 SkDisplacementMapEffect::kR_ChannelSelectorType, |
149 SkDisplacementMapEffect::kR_ChannelSelectorType, | 150 SkDisplacementMapEffect::kR_ChannelSelectorType, |
150 SkIntToScalar(12), | 151 SkIntToScalar(12), |
151 gradient_circle_source.get(), | 152 gradient_circle_source.get(), |
152 noop_cropped.get(), | 153 noop_cropped.get(), |
153 &big_rect)); | 154 &big_rect)); |
154 | 155 |
155 draw(canvas, checkerboard, rect, SkOffsetImageFilter::Create( | 156 draw(canvas, checkerboard, rect, SkOffsetImageFilter::Create( |
156 SkIntToScalar(-8), SkIntToScalar(16), noop_cropped.get(), &big_r
ect)); | 157 SkIntToScalar(-8), SkIntToScalar(16), noop_cropped.get(), &big_r
ect)); |
157 | 158 |
158 canvas->restore(); | 159 canvas->restore(); |
159 canvas->translate(0, SkIntToScalar(80)); | 160 canvas->translate(0, SkIntToScalar(80)); |
160 } | 161 } |
161 } | 162 } |
162 | 163 |
163 private: | 164 private: |
164 typedef GM INHERITED; | 165 typedef GM INHERITED; |
165 }; | 166 }; |
166 | 167 |
167 /////////////////////////////////////////////////////////////////////////////// | 168 /////////////////////////////////////////////////////////////////////////////// |
168 | 169 |
169 static skiagm::GM* MyFactory(void*) { return new ImageFiltersCropExpandGM; } | 170 static skiagm::GM* MyFactory(void*) { return new ImageFiltersCropExpandGM; } |
170 static skiagm::GMRegistry reg(MyFactory); | 171 static skiagm::GMRegistry reg(MyFactory); |
OLD | NEW |