OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 #include "SampleCode.h" | 7 #include "SampleCode.h" |
8 #include "Sk1DPathEffect.h" | 8 #include "Sk1DPathEffect.h" |
9 #include "Sk2DPathEffect.h" | 9 #include "Sk2DPathEffect.h" |
10 #include "SkAlphaThresholdFilter.h" | 10 #include "SkAlphaThresholdFilter.h" |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 if (R(2) == 1) { | 702 if (R(2) == 1) { |
703 filter = SkImageSource::Make(std::move(image), | 703 filter = SkImageSource::Make(std::move(image), |
704 make_rect(), | 704 make_rect(), |
705 make_rect(), | 705 make_rect(), |
706 kHigh_SkFilterQuality); | 706 kHigh_SkFilterQuality); |
707 } else { | 707 } else { |
708 filter = SkImageSource::Make(std::move(image)); | 708 filter = SkImageSource::Make(std::move(image)); |
709 } | 709 } |
710 break; | 710 break; |
711 } | 711 } |
712 case DISPLACE: | 712 case DISPLACE: { |
713 filter = SkDisplacementMapEffect::Make(make_channel_selector_type(), | 713 sk_sp<SkImageFilter> subFilter1(make_image_filter(false)); |
714 make_channel_selector_type(), | 714 sk_sp<SkImageFilter> subFilter2(make_image_filter()); |
715 make_scalar(), | 715 |
716 make_image_filter(false), | 716 filter = sk_sp<SkImageFilter>(SkDisplacementMapEffect::Create(make_chann
el_selector_type(), |
717 make_image_filter()); | 717 make_chann
el_selector_type(), |
| 718 make_scala
r(), |
| 719 subFilter1
.get(), |
| 720 subFilter2
.get())); |
718 break; | 721 break; |
| 722 } |
719 case TILE: { | 723 case TILE: { |
720 sk_sp<SkImageFilter> subFilter(make_image_filter(false)); | 724 sk_sp<SkImageFilter> subFilter(make_image_filter(false)); |
721 | 725 |
722 filter = sk_sp<SkImageFilter>(SkTileImageFilter::Create(make_rect(), | 726 filter = sk_sp<SkImageFilter>(SkTileImageFilter::Create(make_rect(), |
723 make_rect(), | 727 make_rect(), |
724 subFilter.get())
); | 728 subFilter.get())
); |
725 break; | 729 break; |
726 } | 730 } |
727 case PICTURE: { | 731 case PICTURE: { |
728 SkRTreeFactory factory; | 732 SkRTreeFactory factory; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 } | 840 } |
837 | 841 |
838 private: | 842 private: |
839 typedef SkView INHERITED; | 843 typedef SkView INHERITED; |
840 }; | 844 }; |
841 | 845 |
842 ////////////////////////////////////////////////////////////////////////////// | 846 ////////////////////////////////////////////////////////////////////////////// |
843 | 847 |
844 static SkView* MyFactory() { return new ImageFilterFuzzView; } | 848 static SkView* MyFactory() { return new ImageFilterFuzzView; } |
845 static SkViewRegister reg(MyFactory); | 849 static SkViewRegister reg(MyFactory); |
OLD | NEW |