aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2016-11-01 11:22:05 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-01 16:05:41 +0000
commit5e25717ab6313b011ec54eac0109c414aa8ffc17 (patch)
treeaa8f4f1fc4c68a3b77e671c61393206dd61f5b5f /samplecode
parentc633abbb342e3af0e56382e8cb7e7d9fed71e237 (diff)
hide setImageFilter(ptr)
BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4184 Change-Id: Iad792cfdf54087ad4c424fd268559c162a9a5f5c Reviewed-on: https://skia-review.googlesource.com/4184 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'samplecode')
-rw-r--r--samplecode/SampleFilterFuzz.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/samplecode/SampleFilterFuzz.cpp b/samplecode/SampleFilterFuzz.cpp
index 139166fe2d..5f65c9fabc 100644
--- a/samplecode/SampleFilterFuzz.cpp
+++ b/samplecode/SampleFilterFuzz.cpp
@@ -736,7 +736,7 @@ static sk_sp<SkImageFilter> make_image_filter(bool canBeNull) {
return (filter || canBeNull) ? filter : make_image_filter(canBeNull);
}
-static SkImageFilter* make_serialized_image_filter() {
+static sk_sp<SkImageFilter> make_serialized_image_filter() {
sk_sp<SkImageFilter> filter(make_image_filter(false));
sk_sp<SkData> data(SkValidatingSerializeFlattenable(filter.get()));
const unsigned char* ptr = static_cast<const unsigned char*>(data->data());
@@ -763,9 +763,7 @@ static SkImageFilter* make_serialized_image_filter() {
}
}
#endif // SK_ADD_RANDOM_BIT_FLIPS
- SkFlattenable* flattenable = SkValidatingDeserializeFlattenable(ptr, len,
- SkImageFilter::GetFlattenableType());
- return static_cast<SkImageFilter*>(flattenable);
+ return SkValidatingDeserializeImageFilter(ptr, len);
}
static void drawClippedBitmap(SkCanvas* canvas, int x, int y, const SkPaint& paint) {
@@ -777,7 +775,7 @@ static void drawClippedBitmap(SkCanvas* canvas, int x, int y, const SkPaint& pai
}
static void do_fuzz(SkCanvas* canvas) {
- SkImageFilter* filter = make_serialized_image_filter();
+ sk_sp<SkImageFilter> filter = make_serialized_image_filter();
#ifdef SK_FUZZER_IS_VERBOSE
static uint32_t numFilters = 0;
@@ -794,7 +792,7 @@ static void do_fuzz(SkCanvas* canvas) {
#endif
SkPaint paint;
- SkSafeUnref(paint.setImageFilter(filter));
+ paint.setImageFilter(filter);
drawClippedBitmap(canvas, 0, 0, paint);
}