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 27 matching lines...) Expand all Loading... |
38 SkBitmap* result, SkIPoint* offset) const overr
ide { | 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 sk_sp<SkFlattenable> FailImageFilter::CreateProc(SkReadBuffer& buffer) { |
49 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 0); | 49 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 0); |
50 return FailImageFilter::Create(); | 50 return sk_sp<SkFlattenable>(FailImageFilter::Create()); |
51 } | 51 } |
52 | 52 |
53 #ifndef SK_IGNORE_TO_STRING | 53 #ifndef SK_IGNORE_TO_STRING |
54 void FailImageFilter::toString(SkString* str) const { | 54 void FailImageFilter::toString(SkString* str) const { |
55 str->appendf("FailImageFilter: ("); | 55 str->appendf("FailImageFilter: ("); |
56 str->append(")"); | 56 str->append(")"); |
57 } | 57 } |
58 #endif | 58 #endif |
59 | 59 |
60 class IdentityImageFilter : public SkImageFilter { | 60 class IdentityImageFilter : public SkImageFilter { |
(...skipping 21 matching lines...) Expand all Loading... |
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; |
91 | 91 |
92 SkFlattenable* IdentityImageFilter::CreateProc(SkReadBuffer& buffer) { | 92 sk_sp<SkFlattenable> IdentityImageFilter::CreateProc(SkReadBuffer& buffer) { |
93 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); | 93 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); |
94 return IdentityImageFilter::Create(common.getInput(0).get()); | 94 return sk_sp<SkFlattenable>(IdentityImageFilter::Create(common.getInput(0).g
et())); |
95 } | 95 } |
96 | 96 |
97 #ifndef SK_IGNORE_TO_STRING | 97 #ifndef SK_IGNORE_TO_STRING |
98 void IdentityImageFilter::toString(SkString* str) const { | 98 void IdentityImageFilter::toString(SkString* str) const { |
99 str->appendf("IdentityImageFilter: ("); | 99 str->appendf("IdentityImageFilter: ("); |
100 str->append(")"); | 100 str->append(")"); |
101 } | 101 } |
102 #endif | 102 #endif |
103 | 103 |
104 /////////////////////////////////////////////////////////////////////////////// | 104 /////////////////////////////////////////////////////////////////////////////// |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 | 315 |
316 class ImageFiltersText_CF : public ImageFiltersTextBaseGM { | 316 class ImageFiltersText_CF : public ImageFiltersTextBaseGM { |
317 public: | 317 public: |
318 ImageFiltersText_CF() : ImageFiltersTextBaseGM("color") {} | 318 ImageFiltersText_CF() : ImageFiltersTextBaseGM("color") {} |
319 | 319 |
320 void installFilter(SkPaint* paint) override { | 320 void installFilter(SkPaint* paint) override { |
321 paint->setColorFilter(SkColorFilter::MakeModeFilter(SK_ColorBLUE, SkXfer
mode::kSrcIn_Mode)); | 321 paint->setColorFilter(SkColorFilter::MakeModeFilter(SK_ColorBLUE, SkXfer
mode::kSrcIn_Mode)); |
322 } | 322 } |
323 }; | 323 }; |
324 DEF_GM( return new ImageFiltersText_CF; ) | 324 DEF_GM( return new ImageFiltersText_CF; ) |
OLD | NEW |