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 16 matching lines...) Expand all Loading... |
27 } | 27 } |
28 }; | 28 }; |
29 static FailImageFilter* Create() { return new FailImageFilter; } | 29 static FailImageFilter* Create() { return new FailImageFilter; } |
30 | 30 |
31 SK_TO_STRING_OVERRIDE() | 31 SK_TO_STRING_OVERRIDE() |
32 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(FailImageFilter) | 32 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(FailImageFilter) |
33 | 33 |
34 protected: | 34 protected: |
35 FailImageFilter() : INHERITED(0, nullptr) {} | 35 FailImageFilter() : INHERITED(0, nullptr) {} |
36 | 36 |
37 bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, | 37 bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, |
38 SkBitmap* result, SkIPoint* offset) const override { | 38 SkBitmap* result, SkIPoint* offset) const overr
ide { |
39 return false; | 39 return false; |
40 } | 40 } |
41 | 41 |
42 private: | 42 private: |
43 typedef SkImageFilter INHERITED; | 43 typedef SkImageFilter INHERITED; |
44 }; | 44 }; |
45 | 45 |
46 static FailImageFilter::Registrar gReg0; | 46 static FailImageFilter::Registrar gReg0; |
47 | 47 |
48 SkFlattenable* FailImageFilter::CreateProc(SkReadBuffer& buffer) { | 48 SkFlattenable* FailImageFilter::CreateProc(SkReadBuffer& buffer) { |
(...skipping 20 matching lines...) Expand all Loading... |
69 }; | 69 }; |
70 static IdentityImageFilter* Create(SkImageFilter* input = nullptr) { | 70 static IdentityImageFilter* Create(SkImageFilter* input = nullptr) { |
71 return new IdentityImageFilter(input); | 71 return new IdentityImageFilter(input); |
72 } | 72 } |
73 | 73 |
74 SK_TO_STRING_OVERRIDE() | 74 SK_TO_STRING_OVERRIDE() |
75 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(IdentityImageFilter) | 75 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(IdentityImageFilter) |
76 protected: | 76 protected: |
77 IdentityImageFilter(SkImageFilter* input) : INHERITED(1, &input) {} | 77 IdentityImageFilter(SkImageFilter* input) : INHERITED(1, &input) {} |
78 | 78 |
79 bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, | 79 bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, |
80 SkBitmap* result, SkIPoint* offset) const override { | 80 SkBitmap* result, SkIPoint* offset) const overr
ide { |
81 *result = src; | 81 *result = src; |
82 offset->set(0, 0); | 82 offset->set(0, 0); |
83 return true; | 83 return true; |
84 } | 84 } |
85 | 85 |
86 private: | 86 private: |
87 typedef SkImageFilter INHERITED; | 87 typedef SkImageFilter INHERITED; |
88 }; | 88 }; |
89 | 89 |
90 static IdentityImageFilter::Registrar gReg1; | 90 static IdentityImageFilter::Registrar gReg1; |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 class ImageFiltersText_CF : public ImageFiltersTextBaseGM { | 318 class ImageFiltersText_CF : public ImageFiltersTextBaseGM { |
319 public: | 319 public: |
320 ImageFiltersText_CF() : ImageFiltersTextBaseGM("color") {} | 320 ImageFiltersText_CF() : ImageFiltersTextBaseGM("color") {} |
321 | 321 |
322 void installFilter(SkPaint* paint) override { | 322 void installFilter(SkPaint* paint) override { |
323 paint->setColorFilter(SkColorFilter::CreateModeFilter(SK_ColorBLUE, SkXf
ermode::kSrcIn_Mode))->unref(); | 323 paint->setColorFilter(SkColorFilter::CreateModeFilter(SK_ColorBLUE, SkXf
ermode::kSrcIn_Mode))->unref(); |
324 } | 324 } |
325 }; | 325 }; |
326 DEF_GM( return new ImageFiltersText_CF; ) | 326 DEF_GM( return new ImageFiltersText_CF; ) |
327 | 327 |
OLD | NEW |