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

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: update to ToT 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
« no previous file with comments | « include/effects/SkImageSource.h ('k') | src/effects/SkImageSource.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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);
OLDNEW
« no previous file with comments | « include/effects/SkImageSource.h ('k') | src/effects/SkImageSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698