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

Unified Diff: gm/testimagefilters.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 | « gm/spritebitmap.cpp ('k') | gm/tileimagefilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/testimagefilters.cpp
diff --git a/gm/testimagefilters.cpp b/gm/testimagefilters.cpp
index 6d27c3a21a482cd7c9282e159405fb1582534a6a..2b937ecf47e0e3a231c79ce911805583e1de1c56 100644
--- a/gm/testimagefilters.cpp
+++ b/gm/testimagefilters.cpp
@@ -21,8 +21,8 @@
#define FILTER_WIDTH SkIntToScalar(150)
#define FILTER_HEIGHT SkIntToScalar(200)
-static SkImageFilter* make0() { return new SkDownSampleImageFilter(SK_Scalar1 / 5); }
-static SkImageFilter* make1() { return new SkOffsetImageFilter(SkIntToScalar(16), SkIntToScalar(16)); }
+static SkImageFilter* make0() { return SkDownSampleImageFilter::Create(SK_Scalar1 / 5); }
+static SkImageFilter* make1() { return SkOffsetImageFilter::Create(SkIntToScalar(16), SkIntToScalar(16)); }
static SkImageFilter* make2() {
SkColorFilter* cf = SkColorFilter::CreateModeFilter(SK_ColorBLUE,
SkXfermode::kSrcIn_Mode);
@@ -30,30 +30,30 @@ static SkImageFilter* make2() {
return SkColorFilterImageFilter::Create(cf);
}
static SkImageFilter* make3() {
- return new SkBlurImageFilter(8, 0);
+ return SkBlurImageFilter::Create(8, 0);
}
static SkImageFilter* make4() {
- SkImageFilter* outer = new SkOffsetImageFilter(SkIntToScalar(16), SkIntToScalar(16));
- SkImageFilter* inner = new SkDownSampleImageFilter(SK_Scalar1 / 5);
+ SkImageFilter* outer = SkOffsetImageFilter::Create(SkIntToScalar(16), SkIntToScalar(16));
+ SkImageFilter* inner = SkDownSampleImageFilter::Create(SK_Scalar1 / 5);
SkAutoUnref aur0(outer);
SkAutoUnref aur1(inner);
- return new SkComposeImageFilter(outer, inner);
+ return SkComposeImageFilter::Create(outer, inner);
}
static SkImageFilter* make5() {
- SkImageFilter* first = new SkOffsetImageFilter(SkIntToScalar(16), SkIntToScalar(16));
- SkImageFilter* second = new SkDownSampleImageFilter(SK_Scalar1 / 5);
+ SkImageFilter* first = SkOffsetImageFilter::Create(SkIntToScalar(16), SkIntToScalar(16));
+ SkImageFilter* second = SkDownSampleImageFilter::Create(SK_Scalar1 / 5);
SkAutoUnref aur0(first);
SkAutoUnref aur1(second);
- return new SkMergeImageFilter(first, second);
+ return SkMergeImageFilter::Create(first, second);
}
static SkImageFilter* make6() {
- SkImageFilter* outer = new SkOffsetImageFilter(SkIntToScalar(16), SkIntToScalar(16));
- SkImageFilter* inner = new SkDownSampleImageFilter(SK_Scalar1 / 5);
+ SkImageFilter* outer = SkOffsetImageFilter::Create(SkIntToScalar(16), SkIntToScalar(16));
+ SkImageFilter* inner = SkDownSampleImageFilter::Create(SK_Scalar1 / 5);
SkAutoUnref aur0(outer);
SkAutoUnref aur1(inner);
- SkImageFilter* compose = new SkComposeImageFilter(outer, inner);
+ SkImageFilter* compose = SkComposeImageFilter::Create(outer, inner);
SkAutoUnref aur2(compose);
SkColorFilter* cf = SkColorFilter::CreateModeFilter(0x880000FF,
@@ -62,15 +62,15 @@ static SkImageFilter* make6() {
SkImageFilter* blue = SkColorFilterImageFilter::Create(cf);
SkAutoUnref aur4(blue);
- return new SkMergeImageFilter(compose, blue);
+ return SkMergeImageFilter::Create(compose, blue);
}
static SkImageFilter* make7() {
- SkImageFilter* outer = new SkOffsetImageFilter(SkIntToScalar(16), SkIntToScalar(16));
+ SkImageFilter* outer = SkOffsetImageFilter::Create(SkIntToScalar(16), SkIntToScalar(16));
SkImageFilter* inner = make3();
SkAutoUnref aur0(outer);
SkAutoUnref aur1(inner);
- SkImageFilter* compose = new SkComposeImageFilter(outer, inner);
+ SkImageFilter* compose = SkComposeImageFilter::Create(outer, inner);
SkAutoUnref aur2(compose);
SkColorFilter* cf = SkColorFilter::CreateModeFilter(0x880000FF,
@@ -79,7 +79,7 @@ static SkImageFilter* make7() {
SkImageFilter* blue = SkColorFilterImageFilter::Create(cf);
SkAutoUnref aur4(blue);
- return new SkMergeImageFilter(compose, blue);
+ return SkMergeImageFilter::Create(compose, blue);
}
static void draw0(SkCanvas* canvas) {
« no previous file with comments | « gm/spritebitmap.cpp ('k') | gm/tileimagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698