| 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" |
| 11 #include "SkColorPriv.h" | 11 #include "SkColorPriv.h" |
| 12 #include "SkShader.h" | 12 #include "SkShader.h" |
| 13 | 13 |
| 14 #include "SkBlurImageFilter.h" | 14 #include "SkBlurImageFilter.h" |
| 15 #include "SkColorFilterImageFilter.h" | 15 #include "SkColorFilterImageFilter.h" |
| 16 #include "SkDropShadowImageFilter.h" | 16 #include "SkDropShadowImageFilter.h" |
| 17 #include "SkSpecialImage.h" | 17 #include "SkSpecialImage.h" |
| 18 #include "SkTestImageFilters.h" | 18 #include "SkTestImageFilters.h" |
| 19 | 19 |
| 20 class FailImageFilter : public SkImageFilter { | 20 class FailImageFilter : public SkImageFilter { |
| 21 public: | 21 public: |
| 22 class Registrar { | 22 class Registrar { |
| 23 public: | 23 public: |
| 24 Registrar() { | 24 Registrar() { |
| 25 SkFlattenable::Register("FailImageFilter", | 25 SkFlattenable::Register("FailImageFilter", |
| 26 FailImageFilter::CreateProc); | 26 FailImageFilter::CreateProc, |
| 27 FailImageFilter::GetFlattenableType()); |
| 27 } | 28 } |
| 28 }; | 29 }; |
| 29 static sk_sp<SkImageFilter> Make() { | 30 static sk_sp<SkImageFilter> Make() { |
| 30 return sk_sp<SkImageFilter>(new FailImageFilter); | 31 return sk_sp<SkImageFilter>(new FailImageFilter); |
| 31 } | 32 } |
| 32 | 33 |
| 33 SK_TO_STRING_OVERRIDE() | 34 SK_TO_STRING_OVERRIDE() |
| 34 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(FailImageFilter) | 35 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(FailImageFilter) |
| 35 | 36 |
| 36 protected: | 37 protected: |
| (...skipping 21 matching lines...) Expand all Loading... |
| 58 str->append(")"); | 59 str->append(")"); |
| 59 } | 60 } |
| 60 #endif | 61 #endif |
| 61 | 62 |
| 62 class IdentityImageFilter : public SkImageFilter { | 63 class IdentityImageFilter : public SkImageFilter { |
| 63 public: | 64 public: |
| 64 class Registrar { | 65 class Registrar { |
| 65 public: | 66 public: |
| 66 Registrar() { | 67 Registrar() { |
| 67 SkFlattenable::Register("IdentityImageFilter", | 68 SkFlattenable::Register("IdentityImageFilter", |
| 68 IdentityImageFilter::CreateProc); | 69 IdentityImageFilter::CreateProc, |
| 70 IdentityImageFilter::GetFlattenableType()); |
| 69 } | 71 } |
| 70 }; | 72 }; |
| 71 static sk_sp<SkImageFilter> Make(sk_sp<SkImageFilter> input) { | 73 static sk_sp<SkImageFilter> Make(sk_sp<SkImageFilter> input) { |
| 72 return sk_sp<SkImageFilter>(new IdentityImageFilter(std::move(input))); | 74 return sk_sp<SkImageFilter>(new IdentityImageFilter(std::move(input))); |
| 73 } | 75 } |
| 74 | 76 |
| 75 SK_TO_STRING_OVERRIDE() | 77 SK_TO_STRING_OVERRIDE() |
| 76 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(IdentityImageFilter) | 78 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(IdentityImageFilter) |
| 77 | 79 |
| 78 protected: | 80 protected: |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 | 318 |
| 317 class ImageFiltersText_CF : public ImageFiltersTextBaseGM { | 319 class ImageFiltersText_CF : public ImageFiltersTextBaseGM { |
| 318 public: | 320 public: |
| 319 ImageFiltersText_CF() : ImageFiltersTextBaseGM("color") {} | 321 ImageFiltersText_CF() : ImageFiltersTextBaseGM("color") {} |
| 320 | 322 |
| 321 void installFilter(SkPaint* paint) override { | 323 void installFilter(SkPaint* paint) override { |
| 322 paint->setColorFilter(SkColorFilter::MakeModeFilter(SK_ColorBLUE, SkXfer
mode::kSrcIn_Mode)); | 324 paint->setColorFilter(SkColorFilter::MakeModeFilter(SK_ColorBLUE, SkXfer
mode::kSrcIn_Mode)); |
| 323 } | 325 } |
| 324 }; | 326 }; |
| 325 DEF_GM( return new ImageFiltersText_CF; ) | 327 DEF_GM( return new ImageFiltersText_CF; ) |
| OLD | NEW |