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

Unified Diff: src/core/SkLightingShader.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/core/SkLightingShader.h ('k') | src/core/SkLocalMatrixShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkLightingShader.cpp
diff --git a/src/core/SkLightingShader.cpp b/src/core/SkLightingShader.cpp
index 3b2e062f3714d6cab0d11948a815564c61b64f14..0e20db44dead0961daf5ddb0989a72f194fdf344 100644
--- a/src/core/SkLightingShader.cpp
+++ b/src/core/SkLightingShader.cpp
@@ -291,7 +291,7 @@ public:
const SkVector& invNormRotation() const { return fInvNormRotation; }
private:
- GrGLFragmentProcessor* onCreateGLInstance() const override { return SkNEW(LightingGLFP); }
+ GrGLFragmentProcessor* onCreateGLInstance() const override { return new LightingGLFP; }
bool onIsEqual(const GrFragmentProcessor& proc) const override {
const LightingFP& lightingFP = proc.cast<LightingFP>();
@@ -393,10 +393,8 @@ bool SkLightingShaderImpl::asFragmentProcessor(GrContext* context, const SkPaint
return false;
}
-
- *fp = SkNEW_ARGS(LightingFP, (pdm, diffuseTexture, normalTexture,
- diffM, normM, diffParams, normParams, fLights,
- fInvNormRotation));
+ *fp = new LightingFP(pdm, diffuseTexture, normalTexture, diffM, normM, diffParams, normParams,
+ fLights, fInvNormRotation);
*color = GrColorPackA4(paint.getAlpha());
return true;
@@ -615,9 +613,8 @@ SkFlattenable* SkLightingShaderImpl::CreateProc(SkReadBuffer& buf) {
SkAutoTUnref<const SkLightingShader::Lights> lights(builder.finish());
- return SkNEW_ARGS(SkLightingShaderImpl, (diffuse, normal, lights,
- SkVector::Make(1.0f, 0.0f),
- &diffLocalM, &normLocalM));
+ return new SkLightingShaderImpl(diffuse, normal, lights, SkVector::Make(1.0f, 0.0f),
+ &diffLocalM, &normLocalM);
}
void SkLightingShaderImpl::flatten(SkWriteBuffer& buf) const {
@@ -672,7 +669,7 @@ SkShader::Context* SkLightingShaderImpl::onCreateContext(const ContextRec& rec,
}
void* diffuseStateStorage = (char*)storage + sizeof(LightingShaderContext);
- SkBitmapProcState* diffuseState = SkNEW_PLACEMENT(diffuseStateStorage, SkBitmapProcState);
+ SkBitmapProcState* diffuseState = new (diffuseStateStorage) SkBitmapProcState;
SkASSERT(diffuseState);
diffuseState->fTileModeX = SkShader::kClamp_TileMode;
@@ -684,7 +681,7 @@ SkShader::Context* SkLightingShaderImpl::onCreateContext(const ContextRec& rec,
}
void* normalStateStorage = (char*)storage + sizeof(LightingShaderContext) + sizeof(SkBitmapProcState);
- SkBitmapProcState* normalState = SkNEW_PLACEMENT(normalStateStorage, SkBitmapProcState);
+ SkBitmapProcState* normalState = new (normalStateStorage) SkBitmapProcState;
SkASSERT(normalState);
normalState->fTileModeX = SkShader::kClamp_TileMode;
@@ -696,8 +693,7 @@ SkShader::Context* SkLightingShaderImpl::onCreateContext(const ContextRec& rec,
return NULL;
}
- return SkNEW_PLACEMENT_ARGS(storage, LightingShaderContext, (*this, rec,
- diffuseState, normalState));
+ return new (storage) LightingShaderContext(*this, rec, diffuseState, normalState);
}
///////////////////////////////////////////////////////////////////////////////
@@ -725,8 +721,8 @@ SkShader* SkLightingShader::Create(const SkBitmap& diffuse, const SkBitmap& norm
SkASSERT(SkScalarNearlyEqual(invNormRotation.lengthSqd(), SK_Scalar1));
- return SkNEW_ARGS(SkLightingShaderImpl, (diffuse, normal, lights,
- invNormRotation, diffLocalM, normLocalM));
+ return new SkLightingShaderImpl(diffuse, normal, lights, invNormRotation, diffLocalM,
+ normLocalM);
}
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « src/core/SkLightingShader.h ('k') | src/core/SkLocalMatrixShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698