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

Unified Diff: gm/offsetimagefilter.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/morphology.cpp ('k') | gm/pictureimagefilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/offsetimagefilter.cpp
diff --git a/gm/offsetimagefilter.cpp b/gm/offsetimagefilter.cpp
index 52d6de9503b59e026eed58ad8b3634241e39e331..54597310abeca018692469d4d5638bd58f33783e 100644
--- a/gm/offsetimagefilter.cpp
+++ b/gm/offsetimagefilter.cpp
@@ -101,11 +101,11 @@ protected:
bitmap->width() - i * 8,
bitmap->height() - i * 12);
SkImageFilter::CropRect rect(SkRect::Make(cropRect));
- SkAutoTUnref<SkImageFilter> tileInput(SkNEW_ARGS(SkBitmapSource, (*bitmap)));
+ SkAutoTUnref<SkImageFilter> tileInput(SkBitmapSource::Create(*bitmap));
SkScalar dx = SkIntToScalar(i*5);
SkScalar dy = SkIntToScalar(i*10);
- SkAutoTUnref<SkImageFilter> filter(SkNEW_ARGS(
- SkOffsetImageFilter, (dx, dy, tileInput, &rect)));
+ SkAutoTUnref<SkImageFilter> filter(
+ SkOffsetImageFilter::Create(dx, dy, tileInput, &rect));
paint.setImageFilter(filter);
drawClippedBitmap(canvas, *bitmap, paint, SK_Scalar1, cropRect);
canvas->translate(SkIntToScalar(bitmap->width() + MARGIN), 0);
@@ -113,8 +113,8 @@ protected:
SkIRect cropRect = SkIRect::MakeXYWH(0, 0, 100, 100);
SkImageFilter::CropRect rect(SkRect::Make(cropRect));
- SkAutoTUnref<SkImageFilter> filter(SkNEW_ARGS(
- SkOffsetImageFilter, (SkIntToScalar(-5), SkIntToScalar(-10), NULL, &rect)));
+ SkAutoTUnref<SkImageFilter> filter(
+ SkOffsetImageFilter::Create(SkIntToScalar(-5), SkIntToScalar(-10), NULL, &rect));
paint.setImageFilter(filter);
drawClippedBitmap(canvas, fBitmap, paint, SkIntToScalar(2), cropRect);
}
« no previous file with comments | « gm/morphology.cpp ('k') | gm/pictureimagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698