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 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 } else { | 719 } else { |
720 filter = sk_sp<SkImageFilter>(SkErodeImageFilter::Create(R(static_ca
st<float>(kBitmapSize)), | 720 filter = sk_sp<SkImageFilter>(SkErodeImageFilter::Create(R(static_ca
st<float>(kBitmapSize)), |
721 R(static_cast<float>(kBitmapSize
)), | 721 R(static_cast<float>(kBitmapSize
)), |
722 subFilter.get())); | 722 subFilter.get())); |
723 } | 723 } |
724 break; | 724 break; |
725 } | 725 } |
726 case BITMAP: { | 726 case BITMAP: { |
727 sk_sp<SkImage> image(SkImage::MakeFromBitmap(make_bitmap())); | 727 sk_sp<SkImage> image(SkImage::MakeFromBitmap(make_bitmap())); |
728 if (R(2) == 1) { | 728 if (R(2) == 1) { |
729 filter = sk_sp<SkImageFilter>(SkImageSource::Create(image.get(), | 729 filter = SkImageSource::Make(std::move(image), |
730 make_rect(), | 730 make_rect(), |
731 make_rect(), | 731 make_rect(), |
732 kHigh_SkFilterQu
ality)); | 732 kHigh_SkFilterQuality); |
733 } else { | 733 } else { |
734 filter = sk_sp<SkImageFilter>(SkImageSource::Create(image.get())); | 734 filter = SkImageSource::Make(std::move(image)); |
735 } | 735 } |
736 break; | 736 break; |
737 } | 737 } |
738 case DISPLACE: { | 738 case DISPLACE: { |
739 sk_sp<SkImageFilter> subFilter1(make_image_filter(false)); | 739 sk_sp<SkImageFilter> subFilter1(make_image_filter(false)); |
740 sk_sp<SkImageFilter> subFilter2(make_image_filter()); | 740 sk_sp<SkImageFilter> subFilter2(make_image_filter()); |
741 | 741 |
742 filter = sk_sp<SkImageFilter>(SkDisplacementMapEffect::Create(make_chann
el_selector_type(), | 742 filter = sk_sp<SkImageFilter>(SkDisplacementMapEffect::Create(make_chann
el_selector_type(), |
743 make_chann
el_selector_type(), | 743 make_chann
el_selector_type(), |
744 make_scala
r(), | 744 make_scala
r(), |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
866 } | 866 } |
867 | 867 |
868 private: | 868 private: |
869 typedef SkView INHERITED; | 869 typedef SkView INHERITED; |
870 }; | 870 }; |
871 | 871 |
872 ////////////////////////////////////////////////////////////////////////////// | 872 ////////////////////////////////////////////////////////////////////////////// |
873 | 873 |
874 static SkView* MyFactory() { return new ImageFilterFuzzView; } | 874 static SkView* MyFactory() { return new ImageFilterFuzzView; } |
875 static SkViewRegister reg(MyFactory); | 875 static SkViewRegister reg(MyFactory); |
OLD | NEW |