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

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: 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
Index: samplecode/SampleFilterFuzz.cpp
diff --git a/samplecode/SampleFilterFuzz.cpp b/samplecode/SampleFilterFuzz.cpp
index 6413aa103f8725f44de73f8aa62d80ed3b4fc908..bb83a90f3040cb7c2daca897216cbffa28f9c42c 100644
--- a/samplecode/SampleFilterFuzz.cpp
+++ b/samplecode/SampleFilterFuzz.cpp
@@ -708,20 +708,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) {

Powered by Google App Engine
This is Rietveld 408576698