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 "SkTestImageFilters.h" | 17 #include "SkTestImageFilters.h" |
18 | 18 |
19 class FailImageFilter : public SkImageFilter { | 19 class FailImageFilter : public SkImageFilter { |
20 public: | 20 public: |
21 class Registrar { | 21 class Registrar { |
22 public: | 22 public: |
23 Registrar() { | 23 Registrar() { |
24 SkFlattenable::Register("FailImageFilter", | 24 SkFlattenable::Register("FailImageFilter", |
25 FailImageFilter::CreateProc, | 25 FailImageFilter::CreateProc); |
26 FailImageFilter::GetFlattenableType()); | |
27 } | 26 } |
28 }; | 27 }; |
29 static FailImageFilter* Create() { return new FailImageFilter; } | 28 static FailImageFilter* Create() { return new FailImageFilter; } |
30 | 29 |
31 SK_TO_STRING_OVERRIDE() | 30 SK_TO_STRING_OVERRIDE() |
32 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(FailImageFilter) | 31 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(FailImageFilter) |
33 | 32 |
34 protected: | 33 protected: |
35 FailImageFilter() : INHERITED(0, nullptr) {} | 34 FailImageFilter() : INHERITED(0, nullptr) {} |
36 | 35 |
(...skipping 19 matching lines...) Expand all Loading... |
56 str->append(")"); | 55 str->append(")"); |
57 } | 56 } |
58 #endif | 57 #endif |
59 | 58 |
60 class IdentityImageFilter : public SkImageFilter { | 59 class IdentityImageFilter : public SkImageFilter { |
61 public: | 60 public: |
62 class Registrar { | 61 class Registrar { |
63 public: | 62 public: |
64 Registrar() { | 63 Registrar() { |
65 SkFlattenable::Register("IdentityImageFilter", | 64 SkFlattenable::Register("IdentityImageFilter", |
66 IdentityImageFilter::CreateProc, | 65 IdentityImageFilter::CreateProc); |
67 IdentityImageFilter::GetFlattenableType()); | |
68 } | 66 } |
69 }; | 67 }; |
70 static IdentityImageFilter* Create(SkImageFilter* input = nullptr) { | 68 static IdentityImageFilter* Create(SkImageFilter* input = nullptr) { |
71 return new IdentityImageFilter(input); | 69 return new IdentityImageFilter(input); |
72 } | 70 } |
73 | 71 |
74 SK_TO_STRING_OVERRIDE() | 72 SK_TO_STRING_OVERRIDE() |
75 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(IdentityImageFilter) | 73 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(IdentityImageFilter) |
76 protected: | 74 protected: |
77 IdentityImageFilter(SkImageFilter* input) : INHERITED(1, &input) {} | 75 IdentityImageFilter(SkImageFilter* input) : INHERITED(1, &input) {} |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 class ImageFiltersText_CF : public ImageFiltersTextBaseGM { | 314 class ImageFiltersText_CF : public ImageFiltersTextBaseGM { |
317 public: | 315 public: |
318 ImageFiltersText_CF() : ImageFiltersTextBaseGM("color") {} | 316 ImageFiltersText_CF() : ImageFiltersTextBaseGM("color") {} |
319 | 317 |
320 void installFilter(SkPaint* paint) override { | 318 void installFilter(SkPaint* paint) override { |
321 paint->setColorFilter(SkColorFilter::MakeModeFilter(SK_ColorBLUE, SkXfer
mode::kSrcIn_Mode)); | 319 paint->setColorFilter(SkColorFilter::MakeModeFilter(SK_ColorBLUE, SkXfer
mode::kSrcIn_Mode)); |
322 } | 320 } |
323 }; | 321 }; |
324 DEF_GM( return new ImageFiltersText_CF; ) | 322 DEF_GM( return new ImageFiltersText_CF; ) |
325 | 323 |
OLD | NEW |