Add placement new macros to SkPostConfig, call SkNEW* from Ganesh.
TODO: unify with the placement new implementation in SkTemplatesPriv.h,
once various issues there are overcome. reed@ should be taking the lead
there.
http://codereview.appspot.com/6384043/
git-svn-id: http://skia.googlecode.com/svn/trunk@4492 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGpuGL_unittest.cpp b/src/gpu/gl/GrGpuGL_unittest.cpp
index 5845919..7f71f48 100644
--- a/src/gpu/gl/GrGpuGL_unittest.cpp
+++ b/src/gpu/gl/GrGpuGL_unittest.cpp
@@ -65,9 +65,10 @@
// does not work with perspective or mul-by-alpha-mask
stageDesc->fOptFlags |= StageDesc::kNoPerspective_OptFlagBit;
stageDesc->fInConfigFlags &= ~kMulByAlphaMask;
- return new GrConvolutionEffect(gKernelDirections[direction],
- kernelRadius,
- kernel);
+ return SkNEW_ARGS(GrConvolutionEffect,
+ (gKernelDirections[direction],
+ kernelRadius,
+ kernel));
}
case kErode_EffectType: {
int direction = random_int(random, 2);
@@ -75,9 +76,10 @@
// does not work with perspective or mul-by-alpha-mask
stageDesc->fOptFlags |= StageDesc::kNoPerspective_OptFlagBit;
stageDesc->fInConfigFlags &= ~kMulByAlphaMask;
- return new GrMorphologyEffect(gKernelDirections[direction],
- kernelRadius,
- GrContext::kErode_MorphologyType);
+ return SkNEW_ARGS(GrMorphologyEffect,
+ (gKernelDirections[direction],
+ kernelRadius,
+ GrContext::kErode_MorphologyType));
}
case kDilate_EffectType: {
int direction = random_int(random, 2);
@@ -85,12 +87,13 @@
// does not work with perspective or mul-by-alpha-mask
stageDesc->fOptFlags |= StageDesc::kNoPerspective_OptFlagBit;
stageDesc->fInConfigFlags &= ~kMulByAlphaMask;
- return new GrMorphologyEffect(gKernelDirections[direction],
- kernelRadius,
- GrContext::kDilate_MorphologyType);
+ return SkNEW_ARGS(GrMorphologyEffect,
+ (gKernelDirections[direction],
+ kernelRadius,
+ GrContext::kDilate_MorphologyType));
}
case kRadialGradient_EffectType: {
- return new GrRadialGradient();
+ return SkNEW(GrRadialGradient);
}
case kRadial2Gradient_EffectType: {
float center;
@@ -99,10 +102,10 @@
} while (GR_Scalar1 == center);
float radius = random->nextF();
bool root = random_bool(random);
- return new GrRadial2Gradient(center, radius, root);
+ return SkNEW_ARGS(GrRadial2Gradient, (center, radius, root));
}
case kSweepGradient_EffectType: {
- return new GrSweepGradient();
+ return SkNEW(GrSweepGradient);
}
default:
GrCrash("Unexpected custom effect type");