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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/effects/SkMorphologyImageFilter.h ('k') | samplecode/SampleLayers.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleFilterFuzz.cpp
diff --git a/samplecode/SampleFilterFuzz.cpp b/samplecode/SampleFilterFuzz.cpp
index 1b7d30be1de12ff32d473ce4a6e250cbf469433a..5d433b5748b22c339b6a5a2d61b3da3d61d1c0f3 100644
--- a/samplecode/SampleFilterFuzz.cpp
+++ b/samplecode/SampleFilterFuzz.cpp
@@ -705,20 +705,17 @@ static sk_sp<SkImageFilter> make_image_filter(bool canBeNull) {
nullptr));
break;
}
- case MORPHOLOGY: {
- sk_sp<SkImageFilter> subFilter(make_image_filter());
-
+ case MORPHOLOGY:
if (R(2) == 1) {
- filter = sk_sp<SkImageFilter>(SkDilateImageFilter::Create(R(static_cast<float>(kBitmapSize)),
- R(static_cast<float>(kBitmapSize)),
- subFilter.get()));
+ filter = SkDilateImageFilter::Make(R(static_cast<float>(kBitmapSize)),
+ R(static_cast<float>(kBitmapSize)),
+ make_image_filter());
} else {
- filter = sk_sp<SkImageFilter>(SkErodeImageFilter::Create(R(static_cast<float>(kBitmapSize)),
- R(static_cast<float>(kBitmapSize)),
- subFilter.get()));
+ filter = SkErodeImageFilter::Make(R(static_cast<float>(kBitmapSize)),
+ R(static_cast<float>(kBitmapSize)),
+ make_image_filter());
}
break;
- }
case BITMAP: {
sk_sp<SkImage> image(SkImage::MakeFromBitmap(make_bitmap()));
if (R(2) == 1) {
« 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