Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: samplecode/SampleFilterFuzz.cpp

Issue 1842243002: Update SkImageSource to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 } else { 722 } else {
723 filter = sk_sp<SkImageFilter>(SkErodeImageFilter::Create(R(static_ca st<float>(kBitmapSize)), 723 filter = sk_sp<SkImageFilter>(SkErodeImageFilter::Create(R(static_ca st<float>(kBitmapSize)),
724 R(static_cast<float>(kBitmapSize )), 724 R(static_cast<float>(kBitmapSize )),
725 subFilter.get())); 725 subFilter.get()));
726 } 726 }
727 break; 727 break;
728 } 728 }
729 case BITMAP: { 729 case BITMAP: {
730 sk_sp<SkImage> image(SkImage::MakeFromBitmap(make_bitmap())); 730 sk_sp<SkImage> image(SkImage::MakeFromBitmap(make_bitmap()));
731 if (R(2) == 1) { 731 if (R(2) == 1) {
732 filter = sk_sp<SkImageFilter>(SkImageSource::Create(image.get(), 732 filter = SkImageSource::Make(std::move(image),
733 make_rect(), 733 make_rect(),
734 make_rect(), 734 make_rect(),
735 kHigh_SkFilterQu ality)); 735 kHigh_SkFilterQuality);
736 } else { 736 } else {
737 filter = sk_sp<SkImageFilter>(SkImageSource::Create(image.get())); 737 filter = SkImageSource::Make(std::move(image));
738 } 738 }
739 break; 739 break;
740 } 740 }
741 case DISPLACE: { 741 case DISPLACE: {
742 sk_sp<SkImageFilter> subFilter1(make_image_filter(false)); 742 sk_sp<SkImageFilter> subFilter1(make_image_filter(false));
743 sk_sp<SkImageFilter> subFilter2(make_image_filter()); 743 sk_sp<SkImageFilter> subFilter2(make_image_filter());
744 744
745 filter = sk_sp<SkImageFilter>(SkDisplacementMapEffect::Create(make_chann el_selector_type(), 745 filter = sk_sp<SkImageFilter>(SkDisplacementMapEffect::Create(make_chann el_selector_type(),
746 make_chann el_selector_type(), 746 make_chann el_selector_type(),
747 make_scala r(), 747 make_scala r(),
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 } 869 }
870 870
871 private: 871 private:
872 typedef SkView INHERITED; 872 typedef SkView INHERITED;
873 }; 873 };
874 874
875 ////////////////////////////////////////////////////////////////////////////// 875 //////////////////////////////////////////////////////////////////////////////
876 876
877 static SkView* MyFactory() { return new ImageFilterFuzzView; } 877 static SkView* MyFactory() { return new ImageFilterFuzzView; }
878 static SkViewRegister reg(MyFactory); 878 static SkViewRegister reg(MyFactory);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698