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

Unified Diff: samplecode/SampleFilterFuzz.cpp

Issue 182983003: Factory methods for heap-allocated SkImageFilter objects. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 6 years, 9 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/SkXfermodeImageFilter.h ('k') | src/effects/SkDisplacementMapEffect.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 f753b503049c8f346f9cd5b000306bbcae615b9b..074452fb3a6103e608e8981c362ea36ebf929f92 100644
--- a/samplecode/SampleFilterFuzz.cpp
+++ b/samplecode/SampleFilterFuzz.cpp
@@ -226,7 +226,7 @@ static SkImageFilter* make_image_filter(bool canBeNull = true) {
filter = SkBicubicImageFilter::CreateMitchell(SkSize::Make(1, 1), make_image_filter());
break;
case MERGE:
- filter = new SkMergeImageFilter(make_image_filter(), make_image_filter(), make_xfermode());
+ filter = SkMergeImageFilter::Create(make_image_filter(), make_image_filter(), make_xfermode());
break;
case COLOR:
{
@@ -237,22 +237,22 @@ static SkImageFilter* make_image_filter(bool canBeNull = true) {
}
break;
case BLUR:
- filter = new SkBlurImageFilter(make_scalar(true), make_scalar(true), make_image_filter());
+ filter = SkBlurImageFilter::Create(make_scalar(true), make_scalar(true), make_image_filter());
break;
case MAGNIFIER:
- filter = new SkMagnifierImageFilter(make_rect(), make_scalar(true));
+ filter = SkMagnifierImageFilter::Create(make_rect(), make_scalar(true));
break;
case XFERMODE:
{
SkAutoTUnref<SkXfermode> mode(SkXfermode::Create(make_xfermode()));
- filter = new SkXfermodeImageFilter(mode, make_image_filter(), make_image_filter());
+ filter = SkXfermodeImageFilter::Create(mode, make_image_filter(), make_image_filter());
}
break;
case OFFSET:
- filter = new SkOffsetImageFilter(make_scalar(), make_scalar(), make_image_filter());
+ filter = SkOffsetImageFilter::Create(make_scalar(), make_scalar(), make_image_filter());
break;
case COMPOSE:
- filter = new SkComposeImageFilter(make_image_filter(), make_image_filter());
+ filter = SkComposeImageFilter::Create(make_image_filter(), make_image_filter());
break;
case DISTANT_LIGHT:
filter = (R(2) == 1) ?
@@ -292,32 +292,32 @@ static SkImageFilter* make_image_filter(bool canBeNull = true) {
}
break;
case DROP_SHADOW:
- filter = new SkDropShadowImageFilter(make_scalar(), make_scalar(),
+ filter = SkDropShadowImageFilter::Create(make_scalar(), make_scalar(),
make_scalar(true), make_color(), make_image_filter());
break;
case MORPHOLOGY:
if (R(2) == 1) {
- filter = new SkDilateImageFilter(R(static_cast<float>(kBitmapSize)),
+ filter = SkDilateImageFilter::Create(R(static_cast<float>(kBitmapSize)),
R(static_cast<float>(kBitmapSize)), make_image_filter());
} else {
- filter = new SkErodeImageFilter(R(static_cast<float>(kBitmapSize)),
+ filter = SkErodeImageFilter::Create(R(static_cast<float>(kBitmapSize)),
R(static_cast<float>(kBitmapSize)), make_image_filter());
}
break;
case BITMAP:
if (R(2) == 1) {
- filter = new SkBitmapSource(make_bitmap(), make_rect(), make_rect());
+ filter = SkBitmapSource::Create(make_bitmap(), make_rect(), make_rect());
} else {
- filter = new SkBitmapSource(make_bitmap());
+ filter = SkBitmapSource::Create(make_bitmap());
}
break;
case DISPLACE:
- filter = new SkDisplacementMapEffect(make_channel_selector_type(),
- make_channel_selector_type(), make_scalar(),
- make_image_filter(false), make_image_filter());
+ filter = SkDisplacementMapEffect::Create(make_channel_selector_type(),
+ make_channel_selector_type(), make_scalar(),
+ make_image_filter(false), make_image_filter());
break;
case TILE:
- filter = new SkTileImageFilter(make_rect(), make_rect(), make_image_filter(false));
+ filter = SkTileImageFilter::Create(make_rect(), make_rect(), make_image_filter(false));
break;
case PICTURE:
{
@@ -328,7 +328,7 @@ static SkImageFilter* make_image_filter(bool canBeNull = true) {
drawSomething(pict->beginRecording(kBitmapSize, kBitmapSize));
pict->endRecording();
#endif
- filter = new SkPictureImageFilter(pict, make_rect());
+ filter = SkPictureImageFilter::Create(pict, make_rect());
}
break;
default:
« no previous file with comments | « include/effects/SkXfermodeImageFilter.h ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698