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

Unified Diff: src/effects/SkPerlinNoiseShader.cpp

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 years, 4 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 | « src/effects/SkMorphologyImageFilter.cpp ('k') | src/effects/SkRectShaderImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkPerlinNoiseShader.cpp
diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp
index 501e6361a53f0e2d1c6ede31b37dde9cc397e58c..2ca86c70f56e3a7f6434498f3ed70343f2dda49c 100644
--- a/src/effects/SkPerlinNoiseShader.cpp
+++ b/src/effects/SkPerlinNoiseShader.cpp
@@ -250,15 +250,15 @@ public:
SkShader* SkPerlinNoiseShader::CreateFractalNoise(SkScalar baseFrequencyX, SkScalar baseFrequencyY,
int numOctaves, SkScalar seed,
const SkISize* tileSize) {
- return SkNEW_ARGS(SkPerlinNoiseShader, (kFractalNoise_Type, baseFrequencyX, baseFrequencyY,
- numOctaves, seed, tileSize));
+ return new SkPerlinNoiseShader(kFractalNoise_Type, baseFrequencyX, baseFrequencyY, numOctaves,
+ seed, tileSize);
}
SkShader* SkPerlinNoiseShader::CreateTurbulence(SkScalar baseFrequencyX, SkScalar baseFrequencyY,
int numOctaves, SkScalar seed,
const SkISize* tileSize) {
- return SkNEW_ARGS(SkPerlinNoiseShader, (kTurbulence_Type, baseFrequencyX, baseFrequencyY,
- numOctaves, seed, tileSize));
+ return new SkPerlinNoiseShader(kTurbulence_Type, baseFrequencyX, baseFrequencyY, numOctaves,
+ seed, tileSize);
}
SkPerlinNoiseShader::SkPerlinNoiseShader(SkPerlinNoiseShader::Type type,
@@ -429,7 +429,7 @@ SkPMColor SkPerlinNoiseShader::PerlinNoiseShaderContext::shade(
SkShader::Context* SkPerlinNoiseShader::onCreateContext(const ContextRec& rec,
void* storage) const {
- return SkNEW_PLACEMENT_ARGS(storage, PerlinNoiseShaderContext, (*this, rec));
+ return new (storage) PerlinNoiseShaderContext(*this, rec);
}
size_t SkPerlinNoiseShader::contextSize() const {
@@ -448,12 +448,11 @@ SkPerlinNoiseShader::PerlinNoiseShaderContext::PerlinNoiseShaderContext(
// This (1,1) translation is due to WebKit's 1 based coordinates for the noise
// (as opposed to 0 based, usually). The same adjustment is in the setData() function.
fMatrix.setTranslate(-newMatrix.getTranslateX() + SK_Scalar1, -newMatrix.getTranslateY() + SK_Scalar1);
- fPaintingData = SkNEW_ARGS(PaintingData, (shader.fTileSize, shader.fSeed, shader.fBaseFrequencyX, shader.fBaseFrequencyY, newMatrix));
+ fPaintingData = new PaintingData(shader.fTileSize, shader.fSeed, shader.fBaseFrequencyX,
+ shader.fBaseFrequencyY, newMatrix);
}
-SkPerlinNoiseShader::PerlinNoiseShaderContext::~PerlinNoiseShaderContext() {
- SkDELETE(fPaintingData);
-}
+SkPerlinNoiseShader::PerlinNoiseShaderContext::~PerlinNoiseShaderContext() { delete fPaintingData; }
void SkPerlinNoiseShader::PerlinNoiseShaderContext::shadeSpan(
int x, int y, SkPMColor result[], int count) {
@@ -517,14 +516,11 @@ public:
SkPerlinNoiseShader::PaintingData* paintingData,
GrTexture* permutationsTexture, GrTexture* noiseTexture,
const SkMatrix& matrix, uint8_t alpha) {
- return SkNEW_ARGS(GrPerlinNoiseEffect, (procDataManager, type, numOctaves, stitchTiles,
- paintingData, permutationsTexture, noiseTexture,
- matrix, alpha));
+ return new GrPerlinNoiseEffect(procDataManager, type, numOctaves, stitchTiles, paintingData,
+ permutationsTexture, noiseTexture, matrix, alpha);
}
- virtual ~GrPerlinNoiseEffect() {
- SkDELETE(fPaintingData);
- }
+ virtual ~GrPerlinNoiseEffect() { delete fPaintingData; }
const char* name() const override { return "PerlinNoise"; }
@@ -539,7 +535,7 @@ public:
private:
GrGLFragmentProcessor* onCreateGLInstance() const override {
- return SkNEW_ARGS(GrGLPerlinNoise, (*this));
+ return new GrGLPerlinNoise(*this);
}
virtual void onGetGLProcessorKey(const GrGLSLCaps& caps,
@@ -624,7 +620,7 @@ GrFragmentProcessor* GrPerlinNoiseEffect::TestCreate(GrProcessorTestData* d) {
&paintColor, grPaint.getProcessorDataManager(),
&effect));
- SkDELETE(shader);
+ delete shader;
return effect;
}
@@ -968,7 +964,7 @@ bool SkPerlinNoiseShader::asFragmentProcessor(GrContext* context, const SkPaint&
SkASSERT(!fStitchTiles || !fTileSize.isEmpty());
SkPerlinNoiseShader::PaintingData* paintingData =
- SkNEW_ARGS(PaintingData, (fTileSize, fSeed, fBaseFrequencyX, fBaseFrequencyY, matrix));
+ new PaintingData(fTileSize, fSeed, fBaseFrequencyX, fBaseFrequencyY, matrix);
SkAutoTUnref<GrTexture> permutationsTexture(
GrRefCachedBitmapTexture(context, paintingData->getPermutationsBitmap(), NULL));
SkAutoTUnref<GrTexture> noiseTexture(
@@ -986,7 +982,7 @@ bool SkPerlinNoiseShader::asFragmentProcessor(GrContext* context, const SkPaint&
permutationsTexture, noiseTexture,
m, paint.getAlpha());
} else {
- SkDELETE(paintingData);
+ delete paintingData;
*fp = NULL;
}
return true;
« no previous file with comments | « src/effects/SkMorphologyImageFilter.cpp ('k') | src/effects/SkRectShaderImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698