Style Change: SkNEW->new; SkDELETE->delete
DOCS_PREVIEW= https://skia.org/?cl=1316123003
Review URL: https://codereview.chromium.org/1316123003
diff --git a/bench/AAClipBench.cpp b/bench/AAClipBench.cpp
index 4cc9abe..978a371 100644
--- a/bench/AAClipBench.cpp
+++ b/bench/AAClipBench.cpp
@@ -244,14 +244,14 @@
////////////////////////////////////////////////////////////////////////////////
-DEF_BENCH( return SkNEW_ARGS(AAClipBuilderBench, (false, false)); )
-DEF_BENCH( return SkNEW_ARGS(AAClipBuilderBench, (false, true)); )
-DEF_BENCH( return SkNEW_ARGS(AAClipBuilderBench, (true, false)); )
-DEF_BENCH( return SkNEW_ARGS(AAClipBuilderBench, (true, true)); )
-DEF_BENCH( return SkNEW_ARGS(AAClipRegionBench, ()); )
-DEF_BENCH( return SkNEW_ARGS(AAClipBench, (false, false)); )
-DEF_BENCH( return SkNEW_ARGS(AAClipBench, (false, true)); )
-DEF_BENCH( return SkNEW_ARGS(AAClipBench, (true, false)); )
-DEF_BENCH( return SkNEW_ARGS(AAClipBench, (true, true)); )
-DEF_BENCH( return SkNEW_ARGS(NestedAAClipBench, (false)); )
-DEF_BENCH( return SkNEW_ARGS(NestedAAClipBench, (true)); )
+DEF_BENCH(return new AAClipBuilderBench(false, false);)
+DEF_BENCH(return new AAClipBuilderBench(false, true);)
+DEF_BENCH(return new AAClipBuilderBench(true, false);)
+DEF_BENCH(return new AAClipBuilderBench(true, true);)
+DEF_BENCH(return new AAClipRegionBench();)
+DEF_BENCH(return new AAClipBench(false, false);)
+DEF_BENCH(return new AAClipBench(false, true);)
+DEF_BENCH(return new AAClipBench(true, false);)
+DEF_BENCH(return new AAClipBench(true, true);)
+DEF_BENCH(return new NestedAAClipBench(false);)
+DEF_BENCH(return new NestedAAClipBench(true);)
diff --git a/bench/AlternatingColorPatternBench.cpp b/bench/AlternatingColorPatternBench.cpp
index cbf5034..08a28ea 100644
--- a/bench/AlternatingColorPatternBench.cpp
+++ b/bench/AlternatingColorPatternBench.cpp
@@ -169,33 +169,32 @@
typedef Benchmark INHERITED;
};
-DEF_BENCH( return SkNEW_ARGS(AlternatingColorPatternBench,
- (kWhite_ColorPattern, kWhite_ColorPattern,
- kPath_DrawType)); )
-DEF_BENCH( return SkNEW_ARGS(AlternatingColorPatternBench,
- (kBlue_ColorPattern, kBlue_ColorPattern,
- kPath_DrawType)); )
-DEF_BENCH( return SkNEW_ARGS(AlternatingColorPatternBench,
- (kWhite_ColorPattern, kBlue_ColorPattern,
- kPath_DrawType)); )
+DEF_BENCH(return new AlternatingColorPatternBench(kWhite_ColorPattern,
+ kWhite_ColorPattern,
+ kPath_DrawType);)
+DEF_BENCH(return new AlternatingColorPatternBench(kBlue_ColorPattern,
+ kBlue_ColorPattern,
+ kPath_DrawType);)
+DEF_BENCH(return new AlternatingColorPatternBench(kWhite_ColorPattern,
+ kBlue_ColorPattern,
+ kPath_DrawType);)
-DEF_BENCH( return SkNEW_ARGS(AlternatingColorPatternBench,
- (kOpaqueBitmap_ColorPattern, kOpaqueBitmap_ColorPattern,
- kPath_DrawType)); )
-DEF_BENCH( return SkNEW_ARGS(AlternatingColorPatternBench,
- (kAlphaBitmap_ColorPattern, kAlphaBitmap_ColorPattern,
- kPath_DrawType)); )
-DEF_BENCH( return SkNEW_ARGS(AlternatingColorPatternBench,
- (kOpaqueBitmap_ColorPattern, kAlphaBitmap_ColorPattern,
- kPath_DrawType)); )
+DEF_BENCH(return new AlternatingColorPatternBench(kOpaqueBitmap_ColorPattern,
+ kOpaqueBitmap_ColorPattern,
+ kPath_DrawType);)
+DEF_BENCH(return new AlternatingColorPatternBench(kAlphaBitmap_ColorPattern,
+ kAlphaBitmap_ColorPattern,
+ kPath_DrawType);)
+DEF_BENCH(return new AlternatingColorPatternBench(kOpaqueBitmap_ColorPattern,
+ kAlphaBitmap_ColorPattern,
+ kPath_DrawType);)
-DEF_BENCH( return SkNEW_ARGS(AlternatingColorPatternBench,
- (kOpaqueBitmap_ColorPattern, kOpaqueBitmap_ColorPattern,
- kRect_DrawType)); )
-DEF_BENCH( return SkNEW_ARGS(AlternatingColorPatternBench,
- (kAlphaBitmap_ColorPattern, kAlphaBitmap_ColorPattern,
- kRect_DrawType)); )
-DEF_BENCH( return SkNEW_ARGS(AlternatingColorPatternBench,
- (kOpaqueBitmap_ColorPattern, kAlphaBitmap_ColorPattern,
- kRect_DrawType)); )
-
+DEF_BENCH(return new AlternatingColorPatternBench(kOpaqueBitmap_ColorPattern,
+ kOpaqueBitmap_ColorPattern,
+ kRect_DrawType);)
+DEF_BENCH(return new AlternatingColorPatternBench(kAlphaBitmap_ColorPattern,
+ kAlphaBitmap_ColorPattern,
+ kRect_DrawType);)
+DEF_BENCH(return new AlternatingColorPatternBench(kOpaqueBitmap_ColorPattern,
+ kAlphaBitmap_ColorPattern,
+ kRect_DrawType);)
diff --git a/bench/BenchLogger.cpp b/bench/BenchLogger.cpp
index 98423d0..5e74552 100644
--- a/bench/BenchLogger.cpp
+++ b/bench/BenchLogger.cpp
@@ -14,12 +14,12 @@
BenchLogger::~BenchLogger() {
if (fFileStream) {
- SkDELETE(fFileStream);
+ delete fFileStream;
}
}
bool BenchLogger::SetLogFile(const char *file) {
- fFileStream = SkNEW_ARGS(SkFILEWStream, (file));
+ fFileStream = new SkFILEWStream(file);
return fFileStream->isValid();
}
diff --git a/bench/ChromeBench.cpp b/bench/ChromeBench.cpp
index 4938785..231d09b 100644
--- a/bench/ChromeBench.cpp
+++ b/bench/ChromeBench.cpp
@@ -493,4 +493,4 @@
// Disabled this benchmark: it takes 15x longer than any other benchmark
// and is probably not giving us important information.
-// DEF_BENCH(return SkNEW(ScrollGmailBench));
+// DEF_BENCH(return new ScrollGmailBench);
diff --git a/bench/ColorPrivBench.cpp b/bench/ColorPrivBench.cpp
index e6c68b5..9c8acce 100644
--- a/bench/ColorPrivBench.cpp
+++ b/bench/ColorPrivBench.cpp
@@ -1,3 +1,9 @@
+/*
+ * Copyright 2013 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
#include "Benchmark.h"
#include "SkColorPriv.h"
#include "SkRandom.h"
@@ -74,8 +80,8 @@
};
#define COMMA ,
-DEF_BENCH( return SkNEW(FourByteInterpBench<true COMMA true>); )
-DEF_BENCH( return SkNEW(FourByteInterpBench<true COMMA false>); )
-DEF_BENCH( return SkNEW(FourByteInterpBench<false COMMA true>); )
-DEF_BENCH( return SkNEW(FourByteInterpBench<false COMMA false>); )
+DEF_BENCH(return (new FourByteInterpBench<true COMMA true>);)
+DEF_BENCH(return (new FourByteInterpBench<true COMMA false>);)
+DEF_BENCH(return (new FourByteInterpBench<false COMMA true>);)
+DEF_BENCH(return (new FourByteInterpBench<false COMMA false>);)
#undef COMMA
diff --git a/bench/FSRectBench.cpp b/bench/FSRectBench.cpp
index 914b5b6..03d1504 100644
--- a/bench/FSRectBench.cpp
+++ b/bench/FSRectBench.cpp
@@ -60,4 +60,4 @@
typedef Benchmark INHERITED;
};
-DEF_BENCH( return SkNEW_ARGS(FSRectBench, ()); )
+DEF_BENCH(return new FSRectBench();)
diff --git a/bench/FontScalerBench.cpp b/bench/FontScalerBench.cpp
index 0326a0c..f813adb 100644
--- a/bench/FontScalerBench.cpp
+++ b/bench/FontScalerBench.cpp
@@ -48,5 +48,5 @@
///////////////////////////////////////////////////////////////////////////////
-DEF_BENCH( return SkNEW_ARGS(FontScalerBench, (false)); )
-DEF_BENCH( return SkNEW_ARGS(FontScalerBench, (true)); )
+DEF_BENCH(return new FontScalerBench(false);)
+DEF_BENCH(return new FontScalerBench(true);)
diff --git a/bench/GameBench.cpp b/bench/GameBench.cpp
index 3d9885f..631a8f2 100644
--- a/bench/GameBench.cpp
+++ b/bench/GameBench.cpp
@@ -308,27 +308,18 @@
};
// Partial clear
-DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kScale_Type,
- GameBench::kPartial_Clear)); )
-DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kTranslate_Type,
- GameBench::kPartial_Clear)); )
-DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kTranslate_Type,
- GameBench::kPartial_Clear, true)); )
-DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kRotate_Type,
- GameBench::kPartial_Clear)); )
+DEF_BENCH(return new GameBench(GameBench::kScale_Type, GameBench::kPartial_Clear);)
+DEF_BENCH(return new GameBench(GameBench::kTranslate_Type, GameBench::kPartial_Clear);)
+DEF_BENCH(return new GameBench(GameBench::kTranslate_Type, GameBench::kPartial_Clear, true);)
+DEF_BENCH(return new GameBench(GameBench::kRotate_Type, GameBench::kPartial_Clear);)
// Full clear
-DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kScale_Type,
- GameBench::kFull_Clear)); )
-DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kTranslate_Type,
- GameBench::kFull_Clear)); )
-DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kTranslate_Type,
- GameBench::kFull_Clear, true)); )
-DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kRotate_Type,
- GameBench::kFull_Clear)); )
+DEF_BENCH(return new GameBench(GameBench::kScale_Type, GameBench::kFull_Clear);)
+DEF_BENCH(return new GameBench(GameBench::kTranslate_Type, GameBench::kFull_Clear);)
+DEF_BENCH(return new GameBench(GameBench::kTranslate_Type, GameBench::kFull_Clear, true);)
+DEF_BENCH(return new GameBench(GameBench::kRotate_Type, GameBench::kFull_Clear);)
// Atlased
-DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kTranslate_Type,
- GameBench::kFull_Clear, false, true)); )
-DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kTranslate_Type,
- GameBench::kFull_Clear, false, true, true)); )
+DEF_BENCH(return new GameBench(GameBench::kTranslate_Type, GameBench::kFull_Clear, false, true);)
+DEF_BENCH(return new GameBench(
+ GameBench::kTranslate_Type, GameBench::kFull_Clear, false, true, true);)
diff --git a/bench/GrResourceCacheBench.cpp b/bench/GrResourceCacheBench.cpp
index 1faff97..e7a9ca8 100644
--- a/bench/GrResourceCacheBench.cpp
+++ b/bench/GrResourceCacheBench.cpp
@@ -45,7 +45,7 @@
for (int i = 0; i < resourceCount; ++i) {
GrUniqueKey key;
BenchResource::ComputeKey(i, keyData32Count, &key);
- GrGpuResource* resource = SkNEW_ARGS(BenchResource, (gpu));
+ GrGpuResource* resource = new BenchResource(gpu);
resource->resourcePriv().setUniqueKey(key);
resource->unref();
}
diff --git a/bench/ImageCacheBench.cpp b/bench/ImageCacheBench.cpp
index 96c64f8..4d71cf0 100644
--- a/bench/ImageCacheBench.cpp
+++ b/bench/ImageCacheBench.cpp
@@ -46,7 +46,7 @@
void populateCache() {
for (int i = 0; i < CACHE_COUNT; ++i) {
- fCache.add(SkNEW_ARGS(TestRec, (TestKey(i), i)));
+ fCache.add(new TestRec(TestKey(i), i));
}
}
diff --git a/bench/RTreeBench.cpp b/bench/RTreeBench.cpp
index 3b3dc72..1da9fbe 100644
--- a/bench/RTreeBench.cpp
+++ b/bench/RTreeBench.cpp
@@ -127,12 +127,12 @@
///////////////////////////////////////////////////////////////////////////////
-DEF_BENCH(return SkNEW_ARGS(RTreeBuildBench, ("XY", &make_XYordered_rects)));
-DEF_BENCH(return SkNEW_ARGS(RTreeBuildBench, ("YX", &make_YXordered_rects)));
-DEF_BENCH(return SkNEW_ARGS(RTreeBuildBench, ("random", &make_random_rects)));
-DEF_BENCH(return SkNEW_ARGS(RTreeBuildBench, ("concentric", &make_concentric_rects)));
+DEF_BENCH(return new RTreeBuildBench("XY", &make_XYordered_rects));
+DEF_BENCH(return new RTreeBuildBench("YX", &make_YXordered_rects));
+DEF_BENCH(return new RTreeBuildBench("random", &make_random_rects));
+DEF_BENCH(return new RTreeBuildBench("concentric", &make_concentric_rects));
-DEF_BENCH(return SkNEW_ARGS(RTreeQueryBench, ("XY", &make_XYordered_rects)));
-DEF_BENCH(return SkNEW_ARGS(RTreeQueryBench, ("YX", &make_YXordered_rects)));
-DEF_BENCH(return SkNEW_ARGS(RTreeQueryBench, ("random", &make_random_rects)));
-DEF_BENCH(return SkNEW_ARGS(RTreeQueryBench, ("concentric", &make_concentric_rects)));
+DEF_BENCH(return new RTreeQueryBench("XY", &make_XYordered_rects));
+DEF_BENCH(return new RTreeQueryBench("YX", &make_YXordered_rects));
+DEF_BENCH(return new RTreeQueryBench("random", &make_random_rects));
+DEF_BENCH(return new RTreeQueryBench("concentric", &make_concentric_rects));
diff --git a/bench/RectBench.cpp b/bench/RectBench.cpp
index 4aa6b8b..db36395 100644
--- a/bench/RectBench.cpp
+++ b/bench/RectBench.cpp
@@ -249,40 +249,35 @@
kMaskType _type;
};
+DEF_BENCH(return new RectBench(1);)
+DEF_BENCH(return new RectBench(1, 4);)
+DEF_BENCH(return new RectBench(3);)
+DEF_BENCH(return new RectBench(3, 4);)
+DEF_BENCH(return new OvalBench(1);)
+DEF_BENCH(return new OvalBench(3);)
+DEF_BENCH(return new OvalBench(1, 4);)
+DEF_BENCH(return new OvalBench(3, 4);)
+DEF_BENCH(return new RRectBench(1);)
+DEF_BENCH(return new RRectBench(1, 4);)
+DEF_BENCH(return new RRectBench(3);)
+DEF_BENCH(return new RRectBench(3, 4);)
+DEF_BENCH(return new PointsBench(SkCanvas::kPoints_PointMode, "points");)
+DEF_BENCH(return new PointsBench(SkCanvas::kLines_PointMode, "lines");)
+DEF_BENCH(return new PointsBench(SkCanvas::kPolygon_PointMode, "polygon");)
-DEF_BENCH( return SkNEW_ARGS(RectBench, (1)); )
-DEF_BENCH( return SkNEW_ARGS(RectBench, (1, 4)); )
-DEF_BENCH( return SkNEW_ARGS(RectBench, (3)); )
-DEF_BENCH( return SkNEW_ARGS(RectBench, (3, 4)); )
-DEF_BENCH( return SkNEW_ARGS(OvalBench, (1)); )
-DEF_BENCH( return SkNEW_ARGS(OvalBench, (3)); )
-DEF_BENCH( return SkNEW_ARGS(OvalBench, (1, 4)); )
-DEF_BENCH( return SkNEW_ARGS(OvalBench, (3, 4)); )
-DEF_BENCH( return SkNEW_ARGS(RRectBench, (1)); )
-DEF_BENCH( return SkNEW_ARGS(RRectBench, (1, 4)); )
-DEF_BENCH( return SkNEW_ARGS(RRectBench, (3)); )
-DEF_BENCH( return SkNEW_ARGS(RRectBench, (3, 4)); )
-DEF_BENCH( return SkNEW_ARGS(PointsBench, (SkCanvas::kPoints_PointMode, "points")); )
-DEF_BENCH( return SkNEW_ARGS(PointsBench, (SkCanvas::kLines_PointMode, "lines")); )
-DEF_BENCH( return SkNEW_ARGS(PointsBench, (SkCanvas::kPolygon_PointMode, "polygon")); )
-
-DEF_BENCH( return SkNEW_ARGS(SrcModeRectBench, ()); )
+DEF_BENCH(return new SrcModeRectBench();)
/* init the blitmask bench
*/
-DEF_BENCH( return SkNEW_ARGS(BlitMaskBench,
- (SkCanvas::kPoints_PointMode,
- BlitMaskBench::kMaskOpaque, "maskopaque")
- ); )
-DEF_BENCH( return SkNEW_ARGS(BlitMaskBench,
- (SkCanvas::kPoints_PointMode,
- BlitMaskBench::kMaskBlack, "maskblack")
- ); )
-DEF_BENCH( return SkNEW_ARGS(BlitMaskBench,
- (SkCanvas::kPoints_PointMode,
- BlitMaskBench::kMaskColor, "maskcolor")
- ); )
-DEF_BENCH( return SkNEW_ARGS(BlitMaskBench,
- (SkCanvas::kPoints_PointMode,
- BlitMaskBench::KMaskShader, "maskshader")
- ); )
+DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode,
+ BlitMaskBench::kMaskOpaque,
+ "maskopaque");)
+DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode,
+ BlitMaskBench::kMaskBlack,
+ "maskblack");)
+DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode,
+ BlitMaskBench::kMaskColor,
+ "maskcolor");)
+DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode,
+ BlitMaskBench::KMaskShader,
+ "maskshader");)
diff --git a/bench/RectanizerBench.cpp b/bench/RectanizerBench.cpp
index f7e1f04..506a363 100644
--- a/bench/RectanizerBench.cpp
+++ b/bench/RectanizerBench.cpp
@@ -76,10 +76,10 @@
SkASSERT(NULL == fRectanizer.get());
if (kPow2_RectanizerType == fRectanizerType) {
- fRectanizer.reset(SkNEW_ARGS(GrRectanizerPow2, (kWidth, kHeight)));
+ fRectanizer.reset(new GrRectanizerPow2(kWidth, kHeight));
} else {
SkASSERT(kSkyline_RectanizerType == fRectanizerType);
- fRectanizer.reset(SkNEW_ARGS(GrRectanizerSkyline, (kWidth, kHeight)));
+ fRectanizer.reset(new GrRectanizerSkyline(kWidth, kHeight));
}
}
diff --git a/bench/RectoriBench.cpp b/bench/RectoriBench.cpp
index 8752a34..8d8bd3d 100644
--- a/bench/RectoriBench.cpp
+++ b/bench/RectoriBench.cpp
@@ -102,4 +102,4 @@
typedef Benchmark INHERITED;
};
-DEF_BENCH( return SkNEW_ARGS(RectoriBench, ()); )
+DEF_BENCH(return new RectoriBench();)
diff --git a/bench/RegionBench.cpp b/bench/RegionBench.cpp
index 2188cb3..b6f763c 100644
--- a/bench/RegionBench.cpp
+++ b/bench/RegionBench.cpp
@@ -121,12 +121,12 @@
#define SMALL 16
-DEF_BENCH( return SkNEW_ARGS(RegionBench, (SMALL, union_proc, "union")); )
-DEF_BENCH( return SkNEW_ARGS(RegionBench, (SMALL, sect_proc, "intersect")); )
-DEF_BENCH( return SkNEW_ARGS(RegionBench, (SMALL, diff_proc, "difference")); )
-DEF_BENCH( return SkNEW_ARGS(RegionBench, (SMALL, diffrect_proc, "differencerect")); )
-DEF_BENCH( return SkNEW_ARGS(RegionBench, (SMALL, diffrectbig_proc, "differencerectbig")); )
-DEF_BENCH( return SkNEW_ARGS(RegionBench, (SMALL, containsrect_proc, "containsrect")); )
-DEF_BENCH( return SkNEW_ARGS(RegionBench, (SMALL, sectsrgn_proc, "intersectsrgn")); )
-DEF_BENCH( return SkNEW_ARGS(RegionBench, (SMALL, sectsrect_proc, "intersectsrect")); )
-DEF_BENCH( return SkNEW_ARGS(RegionBench, (SMALL, containsxy_proc, "containsxy")); )
+DEF_BENCH(return new RegionBench(SMALL, union_proc, "union");)
+DEF_BENCH(return new RegionBench(SMALL, sect_proc, "intersect");)
+DEF_BENCH(return new RegionBench(SMALL, diff_proc, "difference");)
+DEF_BENCH(return new RegionBench(SMALL, diffrect_proc, "differencerect");)
+DEF_BENCH(return new RegionBench(SMALL, diffrectbig_proc, "differencerectbig");)
+DEF_BENCH(return new RegionBench(SMALL, containsrect_proc, "containsrect");)
+DEF_BENCH(return new RegionBench(SMALL, sectsrgn_proc, "intersectsrgn");)
+DEF_BENCH(return new RegionBench(SMALL, sectsrect_proc, "intersectsrect");)
+DEF_BENCH(return new RegionBench(SMALL, containsxy_proc, "containsxy");)
diff --git a/bench/RegionContainBench.cpp b/bench/RegionContainBench.cpp
index dfee956..10a6007 100644
--- a/bench/RegionContainBench.cpp
+++ b/bench/RegionContainBench.cpp
@@ -64,4 +64,4 @@
typedef Benchmark INHERITED;
};
-DEF_BENCH( return SkNEW_ARGS(RegionContainBench, (sect_proc, "sect")); )
+DEF_BENCH(return new RegionContainBench(sect_proc, "sect");)
diff --git a/bench/SKPAnimationBench.cpp b/bench/SKPAnimationBench.cpp
index 02fd48a..f43dc80 100644
--- a/bench/SKPAnimationBench.cpp
+++ b/bench/SKPAnimationBench.cpp
@@ -71,5 +71,5 @@
SKPAnimationBench::Animation* SKPAnimationBench::CreateZoomAnimation(SkScalar zoomMax,
double zoomPeriodMs) {
- return SkNEW_ARGS(ZoomAnimation, (zoomMax, zoomPeriodMs));
+ return new ZoomAnimation(zoomMax, zoomPeriodMs);
}
diff --git a/bench/SkipZeroesBench.cpp b/bench/SkipZeroesBench.cpp
index 7840a8a..75fe78a 100644
--- a/bench/SkipZeroesBench.cpp
+++ b/bench/SkipZeroesBench.cpp
@@ -113,5 +113,5 @@
};
// Enable the true version once the feature is checked in.
-DEF_BENCH( return SkNEW_ARGS(SkipZeroesBench, ("arrow.png", true)));
-DEF_BENCH( return SkNEW_ARGS(SkipZeroesBench, ("arrow.png", false)));
+DEF_BENCH(return new SkipZeroesBench("arrow.png", true));
+DEF_BENCH(return new SkipZeroesBench("arrow.png", false));
diff --git a/bench/StrokeBench.cpp b/bench/StrokeBench.cpp
index 70dc79e..750bd06 100644
--- a/bench/StrokeBench.cpp
+++ b/bench/StrokeBench.cpp
@@ -103,17 +103,17 @@
return paint;
}
-DEF_BENCH( return SkNEW_ARGS(StrokeBench, (line_path_maker(), paint_maker(), "line_1", 1)); )
-DEF_BENCH( return SkNEW_ARGS(StrokeBench, (quad_path_maker(), paint_maker(), "quad_1", 1)); )
-DEF_BENCH( return SkNEW_ARGS(StrokeBench, (conic_path_maker(), paint_maker(), "conic_1", 1)); )
-DEF_BENCH( return SkNEW_ARGS(StrokeBench, (cubic_path_maker(), paint_maker(), "cubic_1", 1)); )
+DEF_BENCH(return new StrokeBench(line_path_maker(), paint_maker(), "line_1", 1);)
+DEF_BENCH(return new StrokeBench(quad_path_maker(), paint_maker(), "quad_1", 1);)
+DEF_BENCH(return new StrokeBench(conic_path_maker(), paint_maker(), "conic_1", 1);)
+DEF_BENCH(return new StrokeBench(cubic_path_maker(), paint_maker(), "cubic_1", 1);)
-DEF_BENCH( return SkNEW_ARGS(StrokeBench, (line_path_maker(), paint_maker(), "line_4", 4)); )
-DEF_BENCH( return SkNEW_ARGS(StrokeBench, (quad_path_maker(), paint_maker(), "quad_4", 4)); )
-DEF_BENCH( return SkNEW_ARGS(StrokeBench, (conic_path_maker(), paint_maker(), "conic_4", 4)); )
-DEF_BENCH( return SkNEW_ARGS(StrokeBench, (cubic_path_maker(), paint_maker(), "cubic_4", 4)); )
+DEF_BENCH(return new StrokeBench(line_path_maker(), paint_maker(), "line_4", 4);)
+DEF_BENCH(return new StrokeBench(quad_path_maker(), paint_maker(), "quad_4", 4);)
+DEF_BENCH(return new StrokeBench(conic_path_maker(), paint_maker(), "conic_4", 4);)
+DEF_BENCH(return new StrokeBench(cubic_path_maker(), paint_maker(), "cubic_4", 4);)
-DEF_BENCH( return SkNEW_ARGS(StrokeBench, (line_path_maker(), paint_maker(), "line_.25", .25f)); )
-DEF_BENCH( return SkNEW_ARGS(StrokeBench, (quad_path_maker(), paint_maker(), "quad_.25", .25f)); )
-DEF_BENCH( return SkNEW_ARGS(StrokeBench, (conic_path_maker(), paint_maker(), "conic_.25", .25f)); )
-DEF_BENCH( return SkNEW_ARGS(StrokeBench, (cubic_path_maker(), paint_maker(), "cubic_.25", .25f)); )
+DEF_BENCH(return new StrokeBench(line_path_maker(), paint_maker(), "line_.25", .25f);)
+DEF_BENCH(return new StrokeBench(quad_path_maker(), paint_maker(), "quad_.25", .25f);)
+DEF_BENCH(return new StrokeBench(conic_path_maker(), paint_maker(), "conic_.25", .25f);)
+DEF_BENCH(return new StrokeBench(cubic_path_maker(), paint_maker(), "cubic_.25", .25f);)
diff --git a/bench/VertBench.cpp b/bench/VertBench.cpp
index e426ad8..6e49bf4 100644
--- a/bench/VertBench.cpp
+++ b/bench/VertBench.cpp
@@ -92,4 +92,4 @@
///////////////////////////////////////////////////////////////////////////////
-DEF_BENCH( return SkNEW_ARGS(VertBench, ()); )
+DEF_BENCH(return new VertBench();)
diff --git a/bench/WritePixelsBench.cpp b/bench/WritePixelsBench.cpp
index 3ee9034..0b98cf8 100644
--- a/bench/WritePixelsBench.cpp
+++ b/bench/WritePixelsBench.cpp
@@ -71,5 +71,5 @@
//////////////////////////////////////////////////////////////////////////////
-DEF_BENCH( return SkNEW_ARGS(WritePixelsBench, (kRGBA_8888_SkColorType, kPremul_SkAlphaType)); )
-DEF_BENCH( return SkNEW_ARGS(WritePixelsBench, (kRGBA_8888_SkColorType, kUnpremul_SkAlphaType)); )
+DEF_BENCH(return new WritePixelsBench(kRGBA_8888_SkColorType, kPremul_SkAlphaType);)
+DEF_BENCH(return new WritePixelsBench(kRGBA_8888_SkColorType, kUnpremul_SkAlphaType);)
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index 550a35f..75d0ce3 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -514,7 +514,7 @@
SkPMColor colors[256];
int colorCount;
const SkImageInfo info = codec->getInfo().makeColorType(colorType);
- SkAutoTDeleteArray<uint8_t> row(SkNEW_ARRAY(uint8_t, info.minRowBytes()));
+ SkAutoTDeleteArray<uint8_t> row(new uint8_t[info.minRowBytes()]);
SkAutoTDelete<SkScanlineDecoder> scanlineDecoder(SkScanlineDecoder::NewFromData(encoded));
if (NULL == scanlineDecoder || scanlineDecoder->start(info, NULL,
colors, &colorCount) != SkCodec::kSuccess)
@@ -553,7 +553,7 @@
}
static void cleanup_run(Target* target) {
- SkDELETE(target);
+ delete target;
#if SK_SUPPORT_GPU
if (FLAGS_abandonGpuContext) {
gGrFactory->abandonContexts();
@@ -676,7 +676,7 @@
if (gm->runAsBench()) {
fSourceType = "gm";
fBenchType = "micro";
- return SkNEW_ARGS(GMBench, (gm.detach()));
+ return new GMBench(gm.detach());
}
}
@@ -692,7 +692,7 @@
fBenchType = "recording";
fSKPBytes = static_cast<double>(SkPictureUtils::ApproximateBytesUsed(pic));
fSKPOps = pic->approximateOpCount();
- return SkNEW_ARGS(RecordingBench, (name.c_str(), pic.get(), FLAGS_bbh));
+ return new RecordingBench(name.c_str(), pic.get(), FLAGS_bbh);
}
// Then once each for each scale as SKPBenches (playback).
@@ -720,10 +720,8 @@
SkString name = SkOSPath::Basename(path.c_str());
fSourceType = "skp";
fBenchType = "playback";
- return SkNEW_ARGS(SKPBench,
- (name.c_str(), pic.get(), fClip, fScales[fCurrentScale],
- fUseMPDs[fCurrentUseMPD++], FLAGS_loopSKP));
-
+ return new SKPBench(name.c_str(), pic.get(), fClip, fScales[fCurrentScale],
+ fUseMPDs[fCurrentUseMPD++], FLAGS_loopSKP);
}
fCurrentUseMPD = 0;
fCurrentSKP++;
@@ -746,8 +744,8 @@
SkString name = SkOSPath::Basename(path.c_str());
SkAutoTUnref<SKPAnimationBench::Animation> animation(
SKPAnimationBench::CreateZoomAnimation(fZoomMax, fZoomPeriodMs));
- return SkNEW_ARGS(SKPAnimationBench, (name.c_str(), pic.get(), fClip, animation,
- FLAGS_loopSKP));
+ return new SKPAnimationBench(name.c_str(), pic.get(), fClip, animation,
+ FLAGS_loopSKP);
}
}
@@ -944,7 +942,7 @@
#if SK_SUPPORT_GPU
GrContextOptions grContextOpts;
grContextOpts.fDrawPathToCompressedTexture = FLAGS_gpuCompressAlphaMasks;
- gGrFactory.reset(SkNEW_ARGS(GrContextFactory, (grContextOpts)));
+ gGrFactory.reset(new GrContextFactory(grContextOpts));
#endif
if (FLAGS_veryVerbose) {
@@ -982,9 +980,9 @@
}
}
- SkAutoTDelete<ResultsWriter> log(SkNEW(ResultsWriter));
+ SkAutoTDelete<ResultsWriter> log(new ResultsWriter);
if (!FLAGS_outResultsFile.isEmpty()) {
- log.reset(SkNEW(NanoJSONResultsWriter(FLAGS_outResultsFile[0])));
+ log.reset(new NanoJSONResultsWriter(FLAGS_outResultsFile[0]));
}
if (1 == FLAGS_properties.count() % 2) {
diff --git a/bench/subset/SubsetBenchPriv.h b/bench/subset/SubsetBenchPriv.h
index d2c3410..d387684 100644
--- a/bench/subset/SubsetBenchPriv.h
+++ b/bench/subset/SubsetBenchPriv.h
@@ -40,7 +40,7 @@
static inline void alloc_pixels(SkBitmap* bitmap, const SkImageInfo& info, SkPMColor* colors,
int colorCount) {
if (kIndex_8_SkColorType == info.colorType()) {
- SkAutoTUnref<SkColorTable> colorTable(SkNEW_ARGS(SkColorTable, (colors, colorCount)));
+ SkAutoTUnref<SkColorTable> colorTable(new SkColorTable(colors, colorCount));
bitmap->allocPixels(info, NULL, colorTable);
} else {
bitmap->allocPixels(info);
diff --git a/bench/subset/SubsetSingleBench.cpp b/bench/subset/SubsetSingleBench.cpp
index 303cd55..9713cfd 100644
--- a/bench/subset/SubsetSingleBench.cpp
+++ b/bench/subset/SubsetSingleBench.cpp
@@ -67,7 +67,7 @@
SkAutoTDelete<SkScanlineDecoder> scanlineDecoder(
SkScanlineDecoder::NewFromStream(fStream->duplicate()));
const SkImageInfo info = scanlineDecoder->getInfo().makeColorType(fColorType);
- SkAutoTDeleteArray<uint8_t> row(SkNEW_ARRAY(uint8_t, info.minRowBytes()));
+ SkAutoTDeleteArray<uint8_t> row(new uint8_t[info.minRowBytes()]);
scanlineDecoder->start(info, NULL, colors, &colorCount);
SkBitmap bitmap;
diff --git a/bench/subset/SubsetTranslateBench.cpp b/bench/subset/SubsetTranslateBench.cpp
index 2e66c38..35654d6 100644
--- a/bench/subset/SubsetTranslateBench.cpp
+++ b/bench/subset/SubsetTranslateBench.cpp
@@ -63,7 +63,7 @@
SkAutoTDelete<SkScanlineDecoder> scanlineDecoder(
SkScanlineDecoder::NewFromStream(fStream->duplicate()));
const SkImageInfo info = scanlineDecoder->getInfo().makeColorType(fColorType);
- SkAutoTDeleteArray<uint8_t> row(SkNEW_ARRAY(uint8_t, info.minRowBytes()));
+ SkAutoTDeleteArray<uint8_t> row(new uint8_t[info.minRowBytes()]);
scanlineDecoder->start(info, NULL, colors, &colorCount);
SkBitmap bitmap;
@@ -94,7 +94,7 @@
// We create a color table here to satisfy allocPixels() when the output
// type is kIndex8. It's okay that this is uninitialized since we never
// use it.
- SkColorTable* colorTable = SkNEW_ARGS(SkColorTable, (colors, 0));
+ SkColorTable* colorTable = new SkColorTable(colors, 0);
for (int count = 0; count < n; count++) {
int width, height;
SkAutoTDelete<SkImageDecoder> decoder(SkImageDecoder::Factory(fStream));
diff --git a/bench/subset/SubsetZoomBench.cpp b/bench/subset/SubsetZoomBench.cpp
index 84d50aa..d8abfd7 100644
--- a/bench/subset/SubsetZoomBench.cpp
+++ b/bench/subset/SubsetZoomBench.cpp
@@ -63,7 +63,7 @@
SkAutoTDelete<SkScanlineDecoder> scanlineDecoder(
SkScanlineDecoder::NewFromStream(fStream->duplicate()));
const SkImageInfo info = scanlineDecoder->getInfo().makeColorType(fColorType);
- SkAutoTDeleteArray<uint8_t> row(SkNEW_ARRAY(uint8_t, info.minRowBytes()));
+ SkAutoTDeleteArray<uint8_t> row(new uint8_t[info.minRowBytes()]);
scanlineDecoder->start(info, NULL, colors, &colorCount);
const int centerX = info.width() / 2;