Index: gm/displacement.cpp |
diff --git a/gm/displacement.cpp b/gm/displacement.cpp |
index b1f097b8bf848f0eaa3477f4098e778695bb39d7..af7c772532e21e7f596ab1d176ee1a6134d40651 100644 |
--- a/gm/displacement.cpp |
+++ b/gm/displacement.cpp |
@@ -83,135 +83,135 @@ protected: |
} |
canvas->clear(0x00000000); |
SkPaint paint; |
- SkAutoTUnref<SkImageFilter> displ(SkNEW_ARGS(SkBitmapSource, (fCheckerboard))); |
- paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect, |
- (SkDisplacementMapEffect::kR_ChannelSelectorType, |
- SkDisplacementMapEffect::kG_ChannelSelectorType, 0.0f, displ)))->unref(); |
+ SkAutoTUnref<SkImageFilter> displ(SkBitmapSource::Create(fCheckerboard)); |
+ paint.setImageFilter(SkDisplacementMapEffect::Create( |
+ SkDisplacementMapEffect::kR_ChannelSelectorType, |
+ SkDisplacementMapEffect::kG_ChannelSelectorType, 0.0f, displ))->unref(); |
drawClippedBitmap(canvas, 0, 0, paint); |
- paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect, |
- (SkDisplacementMapEffect::kB_ChannelSelectorType, |
- SkDisplacementMapEffect::kA_ChannelSelectorType, 16.0f, displ)))->unref(); |
+ paint.setImageFilter(SkDisplacementMapEffect::Create( |
+ SkDisplacementMapEffect::kB_ChannelSelectorType, |
+ SkDisplacementMapEffect::kA_ChannelSelectorType, 16.0f, displ))->unref(); |
drawClippedBitmap(canvas, 100, 0, paint); |
- paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect, |
- (SkDisplacementMapEffect::kR_ChannelSelectorType, |
- SkDisplacementMapEffect::kB_ChannelSelectorType, 32.0f, displ)))->unref(); |
+ paint.setImageFilter(SkDisplacementMapEffect::Create( |
+ SkDisplacementMapEffect::kR_ChannelSelectorType, |
+ SkDisplacementMapEffect::kB_ChannelSelectorType, 32.0f, displ))->unref(); |
drawClippedBitmap(canvas, 200, 0, paint); |
- paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect, |
- (SkDisplacementMapEffect::kG_ChannelSelectorType, |
- SkDisplacementMapEffect::kA_ChannelSelectorType, 48.0f, displ)))->unref(); |
+ paint.setImageFilter(SkDisplacementMapEffect::Create( |
+ SkDisplacementMapEffect::kG_ChannelSelectorType, |
+ SkDisplacementMapEffect::kA_ChannelSelectorType, 48.0f, displ))->unref(); |
drawClippedBitmap(canvas, 300, 0, paint); |
- paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect, |
- (SkDisplacementMapEffect::kR_ChannelSelectorType, |
- SkDisplacementMapEffect::kA_ChannelSelectorType, 64.0f, displ)))->unref(); |
+ paint.setImageFilter(SkDisplacementMapEffect::Create( |
+ SkDisplacementMapEffect::kR_ChannelSelectorType, |
+ SkDisplacementMapEffect::kA_ChannelSelectorType, 64.0f, displ))->unref(); |
drawClippedBitmap(canvas, 400, 0, paint); |
- paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect, |
- (SkDisplacementMapEffect::kR_ChannelSelectorType, |
- SkDisplacementMapEffect::kG_ChannelSelectorType, 40.0f, displ)))->unref(); |
+ paint.setImageFilter(SkDisplacementMapEffect::Create( |
+ SkDisplacementMapEffect::kR_ChannelSelectorType, |
+ SkDisplacementMapEffect::kG_ChannelSelectorType, 40.0f, displ))->unref(); |
drawClippedBitmap(canvas, 0, 100, paint); |
- paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect, |
- (SkDisplacementMapEffect::kB_ChannelSelectorType, |
- SkDisplacementMapEffect::kA_ChannelSelectorType, 40.0f, displ)))->unref(); |
+ paint.setImageFilter(SkDisplacementMapEffect::Create( |
+ SkDisplacementMapEffect::kB_ChannelSelectorType, |
+ SkDisplacementMapEffect::kA_ChannelSelectorType, 40.0f, displ))->unref(); |
drawClippedBitmap(canvas, 100, 100, paint); |
- paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect, |
- (SkDisplacementMapEffect::kR_ChannelSelectorType, |
- SkDisplacementMapEffect::kB_ChannelSelectorType, 40.0f, displ)))->unref(); |
+ paint.setImageFilter(SkDisplacementMapEffect::Create( |
+ SkDisplacementMapEffect::kR_ChannelSelectorType, |
+ SkDisplacementMapEffect::kB_ChannelSelectorType, 40.0f, displ))->unref(); |
drawClippedBitmap(canvas, 200, 100, paint); |
- paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect, |
- (SkDisplacementMapEffect::kG_ChannelSelectorType, |
- SkDisplacementMapEffect::kA_ChannelSelectorType, 40.0f, displ)))->unref(); |
+ paint.setImageFilter(SkDisplacementMapEffect::Create( |
+ SkDisplacementMapEffect::kG_ChannelSelectorType, |
+ SkDisplacementMapEffect::kA_ChannelSelectorType, 40.0f, displ))->unref(); |
drawClippedBitmap(canvas, 300, 100, paint); |
- paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect, |
- (SkDisplacementMapEffect::kR_ChannelSelectorType, |
- SkDisplacementMapEffect::kA_ChannelSelectorType, 40.0f, displ)))->unref(); |
+ paint.setImageFilter(SkDisplacementMapEffect::Create( |
+ SkDisplacementMapEffect::kR_ChannelSelectorType, |
+ SkDisplacementMapEffect::kA_ChannelSelectorType, 40.0f, displ))->unref(); |
drawClippedBitmap(canvas, 400, 100, paint); |
SkImageFilter::CropRect cropRect(SkRect::MakeXYWH(30, 30, 40, 40)); |
- paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect, |
- (SkDisplacementMapEffect::kR_ChannelSelectorType, |
- SkDisplacementMapEffect::kG_ChannelSelectorType, |
- 0.0f, displ, NULL, &cropRect)))->unref(); |
+ paint.setImageFilter(SkDisplacementMapEffect::Create( |
+ SkDisplacementMapEffect::kR_ChannelSelectorType, |
+ SkDisplacementMapEffect::kG_ChannelSelectorType, |
+ 0.0f, displ, NULL, &cropRect))->unref(); |
drawClippedBitmap(canvas, 0, 200, paint); |
- paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect, |
- (SkDisplacementMapEffect::kB_ChannelSelectorType, |
- SkDisplacementMapEffect::kA_ChannelSelectorType, |
- 16.0f, displ, NULL, &cropRect)))->unref(); |
+ paint.setImageFilter(SkDisplacementMapEffect::Create( |
+ SkDisplacementMapEffect::kB_ChannelSelectorType, |
+ SkDisplacementMapEffect::kA_ChannelSelectorType, |
+ 16.0f, displ, NULL, &cropRect))->unref(); |
drawClippedBitmap(canvas, 100, 200, paint); |
- paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect, |
- (SkDisplacementMapEffect::kR_ChannelSelectorType, |
- SkDisplacementMapEffect::kB_ChannelSelectorType, |
- 32.0f, displ, NULL, &cropRect)))->unref(); |
+ paint.setImageFilter(SkDisplacementMapEffect::Create( |
+ SkDisplacementMapEffect::kR_ChannelSelectorType, |
+ SkDisplacementMapEffect::kB_ChannelSelectorType, |
+ 32.0f, displ, NULL, &cropRect))->unref(); |
drawClippedBitmap(canvas, 200, 200, paint); |
- paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect, |
- (SkDisplacementMapEffect::kG_ChannelSelectorType, |
- SkDisplacementMapEffect::kA_ChannelSelectorType, |
- 48.0f, displ, NULL, &cropRect)))->unref(); |
+ paint.setImageFilter(SkDisplacementMapEffect::Create( |
+ SkDisplacementMapEffect::kG_ChannelSelectorType, |
+ SkDisplacementMapEffect::kA_ChannelSelectorType, |
+ 48.0f, displ, NULL, &cropRect))->unref(); |
drawClippedBitmap(canvas, 300, 200, paint); |
- paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect, |
- (SkDisplacementMapEffect::kR_ChannelSelectorType, |
- SkDisplacementMapEffect::kA_ChannelSelectorType, |
- 64.0f, displ, NULL, &cropRect)))->unref(); |
+ paint.setImageFilter(SkDisplacementMapEffect::Create( |
+ SkDisplacementMapEffect::kR_ChannelSelectorType, |
+ SkDisplacementMapEffect::kA_ChannelSelectorType, |
+ 64.0f, displ, NULL, &cropRect))->unref(); |
drawClippedBitmap(canvas, 400, 200, paint); |
- paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect, |
- (SkDisplacementMapEffect::kR_ChannelSelectorType, |
- SkDisplacementMapEffect::kG_ChannelSelectorType, |
- 40.0f, displ, NULL, &cropRect)))->unref(); |
+ paint.setImageFilter(SkDisplacementMapEffect::Create( |
+ SkDisplacementMapEffect::kR_ChannelSelectorType, |
+ SkDisplacementMapEffect::kG_ChannelSelectorType, |
+ 40.0f, displ, NULL, &cropRect))->unref(); |
drawClippedBitmap(canvas, 0, 300, paint); |
- paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect, |
- (SkDisplacementMapEffect::kB_ChannelSelectorType, |
- SkDisplacementMapEffect::kA_ChannelSelectorType, |
- 40.0f, displ, NULL, &cropRect)))->unref(); |
+ paint.setImageFilter(SkDisplacementMapEffect::Create( |
+ SkDisplacementMapEffect::kB_ChannelSelectorType, |
+ SkDisplacementMapEffect::kA_ChannelSelectorType, |
+ 40.0f, displ, NULL, &cropRect))->unref(); |
drawClippedBitmap(canvas, 100, 300, paint); |
- paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect, |
- (SkDisplacementMapEffect::kR_ChannelSelectorType, |
- SkDisplacementMapEffect::kB_ChannelSelectorType, |
- 40.0f, displ, NULL, &cropRect)))->unref(); |
+ paint.setImageFilter(SkDisplacementMapEffect::Create( |
+ SkDisplacementMapEffect::kR_ChannelSelectorType, |
+ SkDisplacementMapEffect::kB_ChannelSelectorType, |
+ 40.0f, displ, NULL, &cropRect))->unref(); |
drawClippedBitmap(canvas, 200, 300, paint); |
- paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect, |
- (SkDisplacementMapEffect::kG_ChannelSelectorType, |
- SkDisplacementMapEffect::kA_ChannelSelectorType, |
- 40.0f, displ, NULL, &cropRect)))->unref(); |
+ paint.setImageFilter(SkDisplacementMapEffect::Create( |
+ SkDisplacementMapEffect::kG_ChannelSelectorType, |
+ SkDisplacementMapEffect::kA_ChannelSelectorType, |
+ 40.0f, displ, NULL, &cropRect))->unref(); |
drawClippedBitmap(canvas, 300, 300, paint); |
- paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect, |
- (SkDisplacementMapEffect::kR_ChannelSelectorType, |
- SkDisplacementMapEffect::kA_ChannelSelectorType, |
- 40.0f, displ, NULL, &cropRect)))->unref(); |
+ paint.setImageFilter(SkDisplacementMapEffect::Create( |
+ SkDisplacementMapEffect::kR_ChannelSelectorType, |
+ SkDisplacementMapEffect::kA_ChannelSelectorType, |
+ 40.0f, displ, NULL, &cropRect))->unref(); |
drawClippedBitmap(canvas, 400, 300, paint); |
// Tests for images of different sizes |
- displ.reset(SkNEW_ARGS(SkBitmapSource, (fSmall))); |
- paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect, |
- (SkDisplacementMapEffect::kR_ChannelSelectorType, |
- SkDisplacementMapEffect::kG_ChannelSelectorType, |
- 40.0f, displ)))->unref(); |
+ displ.reset(SkBitmapSource::Create(fSmall)); |
+ paint.setImageFilter(SkDisplacementMapEffect::Create( |
+ SkDisplacementMapEffect::kR_ChannelSelectorType, |
+ SkDisplacementMapEffect::kG_ChannelSelectorType, |
+ 40.0f, displ))->unref(); |
drawClippedBitmap(canvas, 0, 400, paint); |
- displ.reset(SkNEW_ARGS(SkBitmapSource, (fLarge))); |
- paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect, |
- (SkDisplacementMapEffect::kB_ChannelSelectorType, |
- SkDisplacementMapEffect::kA_ChannelSelectorType, |
- 40.0f, displ)))->unref(); |
+ displ.reset(SkBitmapSource::Create(fLarge)); |
+ paint.setImageFilter(SkDisplacementMapEffect::Create( |
+ SkDisplacementMapEffect::kB_ChannelSelectorType, |
+ SkDisplacementMapEffect::kA_ChannelSelectorType, |
+ 40.0f, displ))->unref(); |
drawClippedBitmap(canvas, 100, 400, paint); |
- displ.reset(SkNEW_ARGS(SkBitmapSource, (fLargeW))); |
- paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect, |
- (SkDisplacementMapEffect::kR_ChannelSelectorType, |
- SkDisplacementMapEffect::kB_ChannelSelectorType, |
- 40.0f, displ)))->unref(); |
+ displ.reset(SkBitmapSource::Create(fLargeW)); |
+ paint.setImageFilter(SkDisplacementMapEffect::Create( |
+ SkDisplacementMapEffect::kR_ChannelSelectorType, |
+ SkDisplacementMapEffect::kB_ChannelSelectorType, |
+ 40.0f, displ))->unref(); |
drawClippedBitmap(canvas, 200, 400, paint); |
- displ.reset(SkNEW_ARGS(SkBitmapSource, (fLargeH))); |
- paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect, |
- (SkDisplacementMapEffect::kG_ChannelSelectorType, |
- SkDisplacementMapEffect::kA_ChannelSelectorType, |
- 40.0f, displ)))->unref(); |
+ displ.reset(SkBitmapSource::Create(fLargeH)); |
+ paint.setImageFilter(SkDisplacementMapEffect::Create( |
+ SkDisplacementMapEffect::kG_ChannelSelectorType, |
+ SkDisplacementMapEffect::kA_ChannelSelectorType, |
+ 40.0f, displ))->unref(); |
drawClippedBitmap(canvas, 300, 400, paint); |
// Test for no given displacement input. In this case, both displacement |
// and color should use the same bitmap, given to SkCanvas::drawBitmap() |
// as an input argument. |
- paint.setImageFilter(SkNEW_ARGS(SkDisplacementMapEffect, |
- (SkDisplacementMapEffect::kG_ChannelSelectorType, |
- SkDisplacementMapEffect::kA_ChannelSelectorType, |
- 40.0f, NULL)))->unref(); |
+ paint.setImageFilter(SkDisplacementMapEffect::Create( |
+ SkDisplacementMapEffect::kG_ChannelSelectorType, |
+ SkDisplacementMapEffect::kA_ChannelSelectorType, |
+ 40.0f, NULL))->unref(); |
drawClippedBitmap(canvas, 400, 400, paint); |
} |