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

Side by Side Diff: samplecode/SampleFilterFuzz.cpp

Issue 1860573002: Update SkMorphology ImageFilters to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 filter = sk_sp<SkImageFilter>(SkDropShadowImageFilter::Create(make_scala r(), 701 filter = sk_sp<SkImageFilter>(SkDropShadowImageFilter::Create(make_scala r(),
702 make_scala r(), 702 make_scala r(),
703 make_scala r(true), 703 make_scala r(true),
704 make_scala r(true), 704 make_scala r(true),
705 make_color (), 705 make_color (),
706 make_shado w_mode(), 706 make_shado w_mode(),
707 subFilter. get(), 707 subFilter. get(),
708 nullptr)); 708 nullptr));
709 break; 709 break;
710 } 710 }
711 case MORPHOLOGY: { 711 case MORPHOLOGY:
712 sk_sp<SkImageFilter> subFilter(make_image_filter());
713
714 if (R(2) == 1) { 712 if (R(2) == 1) {
715 filter = sk_sp<SkImageFilter>(SkDilateImageFilter::Create(R(static_c ast<float>(kBitmapSize)), 713 filter = SkDilateImageFilter::Make(R(static_cast<float>(kBitmapSize) ),
716 R(static_cast<float>(kBitmapSize )), 714 R(static_cast<float>(kBitmapSize) ),
717 subFilter.get())); 715 make_image_filter());
718 } else { 716 } else {
719 filter = sk_sp<SkImageFilter>(SkErodeImageFilter::Create(R(static_ca st<float>(kBitmapSize)), 717 filter = SkErodeImageFilter::Make(R(static_cast<float>(kBitmapSize)) ,
720 R(static_cast<float>(kBitmapSize )), 718 R(static_cast<float>(kBitmapSize)) ,
721 subFilter.get())); 719 make_image_filter());
722 } 720 }
723 break; 721 break;
724 }
725 case BITMAP: { 722 case BITMAP: {
726 sk_sp<SkImage> image(SkImage::MakeFromBitmap(make_bitmap())); 723 sk_sp<SkImage> image(SkImage::MakeFromBitmap(make_bitmap()));
727 if (R(2) == 1) { 724 if (R(2) == 1) {
728 filter = SkImageSource::Make(std::move(image), 725 filter = SkImageSource::Make(std::move(image),
729 make_rect(), 726 make_rect(),
730 make_rect(), 727 make_rect(),
731 kHigh_SkFilterQuality); 728 kHigh_SkFilterQuality);
732 } else { 729 } else {
733 filter = SkImageSource::Make(std::move(image)); 730 filter = SkImageSource::Make(std::move(image));
734 } 731 }
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 } 862 }
866 863
867 private: 864 private:
868 typedef SkView INHERITED; 865 typedef SkView INHERITED;
869 }; 866 };
870 867
871 ////////////////////////////////////////////////////////////////////////////// 868 //////////////////////////////////////////////////////////////////////////////
872 869
873 static SkView* MyFactory() { return new ImageFilterFuzzView; } 870 static SkView* MyFactory() { return new ImageFilterFuzzView; }
874 static SkViewRegister reg(MyFactory); 871 static SkViewRegister reg(MyFactory);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698