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

Unified Diff: src/effects/SkLayerRasterizer.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/SkLayerDrawLooper.cpp ('k') | src/effects/SkLerpXfermode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkLayerRasterizer.cpp
diff --git a/src/effects/SkLayerRasterizer.cpp b/src/effects/SkLayerRasterizer.cpp
index 8403d06147a602969aeb8c5f5d1af00a3fe062f5..d5ebb24a74fb10eca9ddf7e5c3f62c538eaf0f6d 100644
--- a/src/effects/SkLayerRasterizer.cpp
+++ b/src/effects/SkLayerRasterizer.cpp
@@ -25,10 +25,7 @@ struct SkLayerRasterizer_Rec {
SkVector fOffset;
};
-SkLayerRasterizer::SkLayerRasterizer()
- : fLayers(SkNEW_ARGS(SkDeque, (sizeof(SkLayerRasterizer_Rec))))
-{
-}
+SkLayerRasterizer::SkLayerRasterizer() : fLayers(new SkDeque(sizeof(SkLayerRasterizer_Rec))) {}
SkLayerRasterizer::SkLayerRasterizer(SkDeque* layers) : fLayers(layers)
{
@@ -42,7 +39,7 @@ static void clean_up_layers(SkDeque* layers) {
while ((rec = (SkLayerRasterizer_Rec*)iter.next()) != NULL)
rec->fPaint.~SkPaint();
- SkDELETE(layers);
+ delete layers;
}
SkLayerRasterizer::~SkLayerRasterizer() {
@@ -149,17 +146,17 @@ bool SkLayerRasterizer::onRasterize(const SkPath& path, const SkMatrix& matrix,
}
SkFlattenable* SkLayerRasterizer::CreateProc(SkReadBuffer& buffer) {
- return SkNEW_ARGS(SkLayerRasterizer, (ReadLayers(buffer)));
+ return new SkLayerRasterizer(ReadLayers(buffer));
}
SkDeque* SkLayerRasterizer::ReadLayers(SkReadBuffer& buffer) {
int count = buffer.readInt();
- SkDeque* layers = SkNEW_ARGS(SkDeque, (sizeof(SkLayerRasterizer_Rec)));
+ SkDeque* layers = new SkDeque(sizeof(SkLayerRasterizer_Rec));
for (int i = 0; i < count; i++) {
SkLayerRasterizer_Rec* rec = (SkLayerRasterizer_Rec*)layers->push_back();
- SkNEW_PLACEMENT(&rec->fPaint, SkPaint);
+ new (&rec->fPaint) SkPaint;
buffer.readPaint(&rec->fPaint);
buffer.readPoint(&rec->fOffset);
}
@@ -181,10 +178,7 @@ void SkLayerRasterizer::flatten(SkWriteBuffer& buffer) const {
}
}
-SkLayerRasterizer::Builder::Builder()
- : fLayers(SkNEW_ARGS(SkDeque, (sizeof(SkLayerRasterizer_Rec))))
-{
-}
+SkLayerRasterizer::Builder::Builder() : fLayers(new SkDeque(sizeof(SkLayerRasterizer_Rec))) {}
SkLayerRasterizer::Builder::~Builder()
{
@@ -198,7 +192,7 @@ void SkLayerRasterizer::Builder::addLayer(const SkPaint& paint, SkScalar dx,
SkASSERT(fLayers);
SkLayerRasterizer_Rec* rec = (SkLayerRasterizer_Rec*)fLayers->push_back();
- SkNEW_PLACEMENT_ARGS(&rec->fPaint, SkPaint, (paint));
+ new (&rec->fPaint) SkPaint(paint);
rec->fOffset.set(dx, dy);
}
@@ -206,9 +200,9 @@ SkLayerRasterizer* SkLayerRasterizer::Builder::detachRasterizer() {
SkLayerRasterizer* rasterizer;
if (0 == fLayers->count()) {
rasterizer = NULL;
- SkDELETE(fLayers);
+ delete fLayers;
} else {
- rasterizer = SkNEW_ARGS(SkLayerRasterizer, (fLayers));
+ rasterizer = new SkLayerRasterizer(fLayers);
}
fLayers = NULL;
return rasterizer;
@@ -218,18 +212,18 @@ SkLayerRasterizer* SkLayerRasterizer::Builder::snapshotRasterizer() const {
if (0 == fLayers->count()) {
return NULL;
}
- SkDeque* layers = SkNEW_ARGS(SkDeque, (sizeof(SkLayerRasterizer_Rec), fLayers->count()));
+ SkDeque* layers = new SkDeque(sizeof(SkLayerRasterizer_Rec), fLayers->count());
SkDeque::F2BIter iter(*fLayers);
const SkLayerRasterizer_Rec* recOrig;
SkDEBUGCODE(int count = 0;)
while ((recOrig = static_cast<SkLayerRasterizer_Rec*>(iter.next())) != NULL) {
SkDEBUGCODE(count++);
SkLayerRasterizer_Rec* recCopy = static_cast<SkLayerRasterizer_Rec*>(layers->push_back());
- SkNEW_PLACEMENT_ARGS(&recCopy->fPaint, SkPaint, (recOrig->fPaint));
+ new (&recCopy->fPaint) SkPaint(recOrig->fPaint);
recCopy->fOffset = recOrig->fOffset;
}
SkASSERT(fLayers->count() == count);
SkASSERT(layers->count() == count);
- SkLayerRasterizer* rasterizer = SkNEW_ARGS(SkLayerRasterizer, (layers));
+ SkLayerRasterizer* rasterizer = new SkLayerRasterizer(layers);
return rasterizer;
}
« no previous file with comments | « src/effects/SkLayerDrawLooper.cpp ('k') | src/effects/SkLerpXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698