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

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: 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/SkMorphologyImageFilter.h ('k') | samplecode/SampleLayers.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 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 filter = sk_sp<SkImageFilter>(SkDropShadowImageFilter::Create(make_scala r(), 698 filter = sk_sp<SkImageFilter>(SkDropShadowImageFilter::Create(make_scala r(),
699 make_scala r(), 699 make_scala r(),
700 make_scala r(true), 700 make_scala r(true),
701 make_scala r(true), 701 make_scala r(true),
702 make_color (), 702 make_color (),
703 make_shado w_mode(), 703 make_shado w_mode(),
704 subFilter. get(), 704 subFilter. get(),
705 nullptr)); 705 nullptr));
706 break; 706 break;
707 } 707 }
708 case MORPHOLOGY: { 708 case MORPHOLOGY:
709 sk_sp<SkImageFilter> subFilter(make_image_filter());
710
711 if (R(2) == 1) { 709 if (R(2) == 1) {
712 filter = sk_sp<SkImageFilter>(SkDilateImageFilter::Create(R(static_c ast<float>(kBitmapSize)), 710 filter = SkDilateImageFilter::Make(R(static_cast<float>(kBitmapSize) ),
713 R(static_cast<float>(kBitmapSize )), 711 R(static_cast<float>(kBitmapSize) ),
714 subFilter.get())); 712 make_image_filter());
715 } else { 713 } else {
716 filter = sk_sp<SkImageFilter>(SkErodeImageFilter::Create(R(static_ca st<float>(kBitmapSize)), 714 filter = SkErodeImageFilter::Make(R(static_cast<float>(kBitmapSize)) ,
717 R(static_cast<float>(kBitmapSize )), 715 R(static_cast<float>(kBitmapSize)) ,
718 subFilter.get())); 716 make_image_filter());
719 } 717 }
720 break; 718 break;
721 }
722 case BITMAP: { 719 case BITMAP: {
723 sk_sp<SkImage> image(SkImage::MakeFromBitmap(make_bitmap())); 720 sk_sp<SkImage> image(SkImage::MakeFromBitmap(make_bitmap()));
724 if (R(2) == 1) { 721 if (R(2) == 1) {
725 filter = SkImageSource::Make(std::move(image), 722 filter = SkImageSource::Make(std::move(image),
726 make_rect(), 723 make_rect(),
727 make_rect(), 724 make_rect(),
728 kHigh_SkFilterQuality); 725 kHigh_SkFilterQuality);
729 } else { 726 } else {
730 filter = SkImageSource::Make(std::move(image)); 727 filter = SkImageSource::Make(std::move(image));
731 } 728 }
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 } 859 }
863 860
864 private: 861 private:
865 typedef SkView INHERITED; 862 typedef SkView INHERITED;
866 }; 863 };
867 864
868 ////////////////////////////////////////////////////////////////////////////// 865 //////////////////////////////////////////////////////////////////////////////
869 866
870 static SkView* MyFactory() { return new ImageFilterFuzzView; } 867 static SkView* MyFactory() { return new ImageFilterFuzzView; }
871 static SkViewRegister reg(MyFactory); 868 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « include/effects/SkMorphologyImageFilter.h ('k') | samplecode/SampleLayers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698