OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 draw_bitmap, | 195 draw_bitmap, |
196 }; | 196 }; |
197 | 197 |
198 auto cf = SkColorFilter::MakeModeFilter(SK_ColorRED, SkXfermode::kSrcIn_
Mode); | 198 auto cf = SkColorFilter::MakeModeFilter(SK_ColorRED, SkXfermode::kSrcIn_
Mode); |
199 sk_sp<SkImageFilter> filters[] = { | 199 sk_sp<SkImageFilter> filters[] = { |
200 nullptr, | 200 nullptr, |
201 IdentityImageFilter::Make(nullptr), | 201 IdentityImageFilter::Make(nullptr), |
202 FailImageFilter::Make(), | 202 FailImageFilter::Make(), |
203 SkColorFilterImageFilter::Make(std::move(cf), nullptr), | 203 SkColorFilterImageFilter::Make(std::move(cf), nullptr), |
204 SkBlurImageFilter::Make(12.0f, 0.0f, nullptr), | 204 SkBlurImageFilter::Make(12.0f, 0.0f, nullptr), |
205 sk_sp<SkImageFilter>(SkDropShadowImageFilter::Create( | 205 SkDropShadowImageFilter::Make( |
206 10.0f, 5.0f, 3.0f, 3.0f, SK_ColorBLUE, | 206 10.0f, 5.0f, 3.0f, 3.0f, SK_ColorBLUE, |
207 SkDropShadowImageFilter::kDrawShadowAndForeg
round_ShadowMode)), | 207 SkDropShadowImageFilter::kDrawShadowAndForeg
round_ShadowMode, |
| 208 nullptr), |
208 }; | 209 }; |
209 | 210 |
210 SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64)); | 211 SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64)); |
211 SkScalar MARGIN = SkIntToScalar(16); | 212 SkScalar MARGIN = SkIntToScalar(16); |
212 SkScalar DX = r.width() + MARGIN; | 213 SkScalar DX = r.width() + MARGIN; |
213 SkScalar DY = r.height() + MARGIN; | 214 SkScalar DY = r.height() + MARGIN; |
214 | 215 |
215 canvas->translate(MARGIN, MARGIN); | 216 canvas->translate(MARGIN, MARGIN); |
216 for (size_t i = 0; i < SK_ARRAY_COUNT(drawProc); ++i) { | 217 for (size_t i = 0; i < SK_ARRAY_COUNT(drawProc); ++i) { |
217 canvas->save(); | 218 canvas->save(); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 | 316 |
316 class ImageFiltersText_CF : public ImageFiltersTextBaseGM { | 317 class ImageFiltersText_CF : public ImageFiltersTextBaseGM { |
317 public: | 318 public: |
318 ImageFiltersText_CF() : ImageFiltersTextBaseGM("color") {} | 319 ImageFiltersText_CF() : ImageFiltersTextBaseGM("color") {} |
319 | 320 |
320 void installFilter(SkPaint* paint) override { | 321 void installFilter(SkPaint* paint) override { |
321 paint->setColorFilter(SkColorFilter::MakeModeFilter(SK_ColorBLUE, SkXfer
mode::kSrcIn_Mode)); | 322 paint->setColorFilter(SkColorFilter::MakeModeFilter(SK_ColorBLUE, SkXfer
mode::kSrcIn_Mode)); |
322 } | 323 } |
323 }; | 324 }; |
324 DEF_GM( return new ImageFiltersText_CF; ) | 325 DEF_GM( return new ImageFiltersText_CF; ) |
OLD | NEW |