Style Change: SkNEW->new; SkDELETE->delete
authorhalcanary <halcanary@google.com>
Wed, 26 Aug 2015 20:07:48 +0000 (13:07 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 26 Aug 2015 20:07:49 +0000 (13:07 -0700)
DOCS_PREVIEW= https://skia.org/?cl=1316123003

Review URL: https://codereview.chromium.org/1316123003

542 files changed:
bench/AAClipBench.cpp
bench/AlternatingColorPatternBench.cpp
bench/BenchLogger.cpp
bench/ChromeBench.cpp
bench/ColorPrivBench.cpp
bench/FSRectBench.cpp
bench/FontScalerBench.cpp
bench/GameBench.cpp
bench/GrResourceCacheBench.cpp
bench/ImageCacheBench.cpp
bench/RTreeBench.cpp
bench/RectBench.cpp
bench/RectanizerBench.cpp
bench/RectoriBench.cpp
bench/RegionBench.cpp
bench/RegionContainBench.cpp
bench/SKPAnimationBench.cpp
bench/SkipZeroesBench.cpp
bench/StrokeBench.cpp
bench/VertBench.cpp
bench/WritePixelsBench.cpp
bench/nanobench.cpp
bench/subset/SubsetBenchPriv.h
bench/subset/SubsetSingleBench.cpp
bench/subset/SubsetTranslateBench.cpp
bench/subset/SubsetZoomBench.cpp
debugger/QT/SkDebuggerGUI.cpp
dm/DMSrcSink.cpp
experimental/SimpleCocoaApp/SimpleApp.mm
gm/aaclip.cpp
gm/all_bitmap_configs.cpp
gm/alphagradients.cpp
gm/anisotropic.cpp
gm/arcofzorro.cpp
gm/astcbitmap.cpp
gm/badpaint.cpp
gm/beziereffects.cpp
gm/bigblurs.cpp
gm/bigtext.cpp
gm/bigtileimagefilter.cpp
gm/bitmapsource2.cpp
gm/bmpfilterqualityrepeat.cpp
gm/clip_strokerect.cpp
gm/clipdrawdraw.cpp
gm/cmykjpeg.cpp
gm/colorfilters.cpp
gm/colortype.cpp
gm/colortypexfermode.cpp
gm/complexclip.cpp
gm/composeshader.cpp
gm/conicpaths.cpp
gm/constcolorprocessor.cpp
gm/convex_all_line_paths.cpp
gm/convexpolyclip.cpp
gm/convexpolyeffect.cpp
gm/dashing.cpp
gm/dcshader.cpp
gm/dftext.cpp [changed mode: 0755->0644]
gm/discard.cpp
gm/downsamplebitmap.cpp
gm/emboss.cpp
gm/etc1bitmap.cpp
gm/filterbitmap.cpp
gm/filterfastbounds.cpp
gm/filterindiabox.cpp
gm/fontcache.cpp
gm/fontmgr.cpp
gm/giantbitmap.cpp
gm/gm.h
gm/gradients_no_texture.cpp
gm/imagefiltersbase.cpp
gm/imagefiltersgraph.cpp
gm/imagefromyuvtextures.cpp
gm/internal_links.cpp
gm/largeglyphblur.cpp
gm/lerpmode.cpp
gm/lighting.cpp
gm/lightingshader.cpp
gm/lumafilter.cpp
gm/mixedtextblobs.cpp
gm/modecolorfilters.cpp
gm/multipicturedraw.cpp
gm/patch.cpp
gm/patchgrid.cpp
gm/peekpixels.cpp
gm/picture.cpp
gm/pictureimagegenerator.cpp
gm/pictureshader.cpp
gm/pictureshadertile.cpp
gm/pixelsnap.cpp
gm/smallarc.cpp [changed mode: 0755->0644]
gm/strokefill.cpp
gm/strokes.cpp
gm/stroketext.cpp
gm/tallstretchedbitmaps.cpp
gm/textblob.cpp
gm/textblobcolortrans.cpp
gm/textblobgeometrychange.cpp
gm/textbloblooper.cpp
gm/textblobmixedsizes.cpp
gm/textblobrandomfont.cpp
gm/textblobshader.cpp
gm/textblobtransforms.cpp
gm/textblobuseaftergpufree.cpp
gm/texturedomaineffect.cpp
gm/thinstrokedrects.cpp
gm/tiledscaledbitmap.cpp
gm/tileimagefilter.cpp
gm/variedtext.cpp
gm/vertices.cpp
gm/yuvtorgbeffect.cpp
include/core/SkAnnotation.h
include/core/SkImageDecoder.h
include/core/SkImageEncoder.h
include/core/SkLazyPtr.h
include/core/SkPathEffect.h
include/core/SkRefCnt.h
include/core/SkTArray.h
include/core/SkTDArray.h
include/core/SkTypeface.h
include/effects/Sk1DPathEffect.h
include/effects/Sk2DPathEffect.h
include/effects/SkArcToPathEffect.h
include/effects/SkBitmapSource.h
include/effects/SkBlurDrawLooper.h
include/effects/SkBlurImageFilter.h
include/effects/SkColorMatrixFilter.h
include/effects/SkComposeImageFilter.h
include/effects/SkCornerPathEffect.h
include/effects/SkDashPathEffect.h
include/effects/SkDiscretePathEffect.h
include/effects/SkDropShadowImageFilter.h
include/effects/SkMergeImageFilter.h
include/effects/SkMorphologyImageFilter.h
include/effects/SkOffsetImageFilter.h
include/effects/SkPictureImageFilter.h
include/effects/SkPixelXorXfermode.h
include/effects/SkTableMaskFilter.h
include/effects/SkTestImageFilters.h
include/effects/SkXfermodeImageFilter.h
include/gpu/GrPaint.h
include/gpu/GrProgramElement.h
include/gpu/effects/GrConstColorProcessor.h
include/gpu/gl/GrGLExtensions.h
include/gpu/gl/angle/SkANGLEGLContext.h
include/private/SkFunction.h
include/private/SkTHash.h
include/private/SkTemplates.h
platform_tools/android/apps/visualbench/src/main/jni/main.cpp
samplecode/ClockFaceView.cpp
samplecode/GMSampleView.cpp
samplecode/OverView.cpp
samplecode/SampleApp.cpp
samplecode/SampleArc.cpp
samplecode/SampleHT.cpp
samplecode/SampleIdentityScale.cpp
samplecode/SampleLua.cpp
samplecode/SamplePdfFileViewer.cpp
samplecode/SamplePictFile.cpp
samplecode/SampleSubpixelTranslate.cpp
site/dev/contrib/style.md
site/user/api/canvas.md
src/animator/SkAnimateActive.cpp
src/animator/SkAnimateSet.cpp
src/animator/SkAnimator.cpp
src/animator/SkAnimatorScript.cpp
src/animator/SkAnimatorScript2.cpp
src/animator/SkScript.cpp
src/animator/SkScriptRuntime.cpp
src/c/sk_paint.cpp
src/c/sk_surface.cpp
src/codec/SkBmpCodec.cpp
src/codec/SkBmpMaskCodec.cpp
src/codec/SkBmpRLECodec.cpp
src/codec/SkBmpStandardCodec.cpp
src/codec/SkCodec.cpp
src/codec/SkCodec_libgif.cpp
src/codec/SkCodec_libico.cpp
src/codec/SkCodec_libpng.cpp
src/codec/SkCodec_wbmp.cpp
src/codec/SkJpegCodec.cpp
src/codec/SkMaskSwizzler.cpp
src/codec/SkMasks.cpp
src/codec/SkScaledCodec.cpp
src/codec/SkScanlineDecoder.cpp
src/codec/SkSwizzler.cpp
src/codec/SkWebpCodec.cpp
src/core/SkBBHFactory.cpp
src/core/SkBigPicture.cpp
src/core/SkBitmap.cpp
src/core/SkBitmapCache.cpp
src/core/SkBitmapDevice.cpp
src/core/SkBitmapFilter.cpp
src/core/SkBitmapHeap.cpp
src/core/SkBitmapProcShader.cpp
src/core/SkBitmapScaler.cpp
src/core/SkBlitter.cpp
src/core/SkCachedData.cpp
src/core/SkCanvas.cpp
src/core/SkClipStack.cpp
src/core/SkColorFilter.cpp
src/core/SkComposeShader.cpp
src/core/SkDataTable.cpp
src/core/SkDevice.cpp
src/core/SkDeviceProfile.cpp
src/core/SkDraw.cpp
src/core/SkError.cpp
src/core/SkFilterShader.cpp
src/core/SkFont.cpp
src/core/SkFontDescriptor.cpp
src/core/SkFontMgr.cpp
src/core/SkGlyphCache.cpp [changed mode: 0755->0644]
src/core/SkGlyphCache_Globals.h
src/core/SkImageCacherator.cpp
src/core/SkImageFilter.cpp
src/core/SkImageGeneratorPriv.h
src/core/SkLayerInfo.h
src/core/SkLightingShader.cpp
src/core/SkLightingShader.h
src/core/SkLocalMatrixShader.cpp
src/core/SkMallocPixelRef.cpp
src/core/SkMaskCache.cpp
src/core/SkMatrixImageFilter.cpp
src/core/SkMiniRecorder.cpp
src/core/SkMipMap.cpp
src/core/SkMultiPictureDraw.cpp
src/core/SkPaint.cpp
src/core/SkPathRef.cpp
src/core/SkPicture.cpp
src/core/SkPictureData.cpp
src/core/SkPictureFlat.cpp
src/core/SkPictureFlat.h
src/core/SkPictureImageGenerator.cpp
src/core/SkPictureRecorder.cpp
src/core/SkPictureShader.cpp
src/core/SkPixelRef.cpp
src/core/SkRWBuffer.cpp
src/core/SkRecordDraw.cpp
src/core/SkRecorder.cpp
src/core/SkResourceCache.cpp
src/core/SkScalerContext.cpp
src/core/SkSemaphore.cpp
src/core/SkShader.cpp
src/core/SkSmallAllocator.h
src/core/SkStream.cpp
src/core/SkTLList.h
src/core/SkTLS.cpp
src/core/SkTMultiMap.h
src/core/SkTaskGroup.cpp
src/core/SkTypeface.cpp
src/core/SkXfermode.cpp
src/core/SkYUVPlanesCache.cpp
src/doc/SkDocument_PDF.cpp
src/doc/SkDocument_XPS.cpp
src/effects/SkAlphaThresholdFilter.cpp
src/effects/SkArithmeticMode.cpp
src/effects/SkArithmeticMode_gpu.cpp
src/effects/SkArithmeticMode_gpu.h
src/effects/SkBlurDrawLooper.cpp
src/effects/SkBlurMask.cpp
src/effects/SkBlurMaskFilter.cpp
src/effects/SkColorCubeFilter.cpp
src/effects/SkColorFilterImageFilter.cpp [changed mode: 0755->0644]
src/effects/SkColorFilters.cpp
src/effects/SkColorMatrixFilter.cpp
src/effects/SkDisplacementMapEffect.cpp
src/effects/SkEmbossMaskFilter.cpp
src/effects/SkLayerDrawLooper.cpp
src/effects/SkLayerRasterizer.cpp
src/effects/SkLerpXfermode.cpp
src/effects/SkLightingImageFilter.cpp
src/effects/SkLumaColorFilter.cpp
src/effects/SkMagnifierImageFilter.cpp
src/effects/SkMatrixConvolutionImageFilter.cpp
src/effects/SkMorphologyImageFilter.cpp
src/effects/SkPerlinNoiseShader.cpp
src/effects/SkRectShaderImageFilter.cpp
src/effects/SkTableColorFilter.cpp
src/effects/SkTileImageFilter.cpp
src/effects/gradients/SkGradientBitmapCache.cpp
src/effects/gradients/SkGradientShader.cpp
src/effects/gradients/SkLinearGradient.cpp
src/effects/gradients/SkRadialGradient.cpp
src/effects/gradients/SkSweepGradient.cpp
src/effects/gradients/SkTwoPointConicalGradient.cpp
src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
src/fonts/SkFontMgr_fontconfig.cpp
src/fonts/SkFontMgr_indirect.cpp
src/fonts/SkGScalerContext.cpp
src/fonts/SkRandomScalerContext.cpp
src/fonts/SkRemotableFontMgr.cpp
src/fonts/SkTestScalerContext.cpp
src/gpu/GrAAConvexPathRenderer.cpp
src/gpu/GrAAConvexTessellator.cpp
src/gpu/GrAADistanceFieldPathRenderer.cpp [changed mode: 0755->0644]
src/gpu/GrAAHairLinePathRenderer.cpp
src/gpu/GrAAHairLinePathRenderer.h
src/gpu/GrAALinearizingConvexPathRenderer.cpp
src/gpu/GrAddPathRenderers_default.cpp
src/gpu/GrAllocator.h
src/gpu/GrAtlas.cpp
src/gpu/GrAtlasTextContext.cpp
src/gpu/GrAtlasTextContext.h
src/gpu/GrBatchAtlas.cpp
src/gpu/GrBatchFontCache.cpp
src/gpu/GrBatchFontCache.h
src/gpu/GrBufferedDrawTarget.h
src/gpu/GrClipMaskCache.cpp
src/gpu/GrCommandBuilder.cpp
src/gpu/GrContext.cpp [changed mode: 0755->0644]
src/gpu/GrDefaultGeoProcFactory.cpp
src/gpu/GrDefaultPathRenderer.cpp
src/gpu/GrDrawContext.cpp
src/gpu/GrDrawTarget.cpp
src/gpu/GrFontScaler.cpp
src/gpu/GrGpuResource.cpp
src/gpu/GrGpuResourceCacheAccess.h
src/gpu/GrLayerCache.cpp
src/gpu/GrLayerCache.h
src/gpu/GrLayerHoister.cpp
src/gpu/GrNonAtomicRef.h
src/gpu/GrOvalRenderer.cpp
src/gpu/GrPaint.cpp
src/gpu/GrPathProcessor.cpp
src/gpu/GrPathProcessor.h
src/gpu/GrPathRendererChain.cpp
src/gpu/GrPathRendering.cpp
src/gpu/GrPipeline.cpp
src/gpu/GrPipelineBuilder.cpp
src/gpu/GrRecordReplaceDraw.cpp
src/gpu/GrRectanizer_pow2.cpp
src/gpu/GrRectanizer_skyline.cpp [changed mode: 0755->0644]
src/gpu/GrResourceCache.cpp
src/gpu/GrResourceProvider.cpp
src/gpu/GrStencilAndCoverPathRenderer.cpp
src/gpu/GrStencilAndCoverTextContext.cpp
src/gpu/GrTessellatingPathRenderer.cpp
src/gpu/GrTest.cpp
src/gpu/GrTestUtils.cpp
src/gpu/GrTextBlobCache.cpp
src/gpu/GrTextContext.cpp
src/gpu/SkGpuDevice.cpp
src/gpu/SkGr.cpp
src/gpu/SkGrPixelRef.cpp
src/gpu/batches/GrAAStrokeRectBatch.h
src/gpu/batches/GrCopySurfaceBatch.cpp
src/gpu/batches/GrDrawAtlasBatch.h
src/gpu/batches/GrDrawPathBatch.h
src/gpu/batches/GrDrawVerticesBatch.h
src/gpu/batches/GrStencilPathBatch.h
src/gpu/batches/GrStrokeRectBatch.h
src/gpu/batches/GrTInstanceBatch.h
src/gpu/effects/GrBezierEffect.cpp
src/gpu/effects/GrBezierEffect.h
src/gpu/effects/GrBicubicEffect.cpp
src/gpu/effects/GrBicubicEffect.h
src/gpu/effects/GrBitmapTextGeoProc.cpp
src/gpu/effects/GrBitmapTextGeoProc.h
src/gpu/effects/GrConfigConversionEffect.cpp
src/gpu/effects/GrConstColorProcessor.cpp
src/gpu/effects/GrConvexPolyEffect.cpp
src/gpu/effects/GrConvexPolyEffect.h
src/gpu/effects/GrConvolutionEffect.cpp
src/gpu/effects/GrConvolutionEffect.h
src/gpu/effects/GrCoverageSetOpXP.cpp
src/gpu/effects/GrCustomXfermode.cpp
src/gpu/effects/GrDashingEffect.cpp
src/gpu/effects/GrDisableColorXP.cpp
src/gpu/effects/GrDisableColorXP.h
src/gpu/effects/GrDistanceFieldGeoProc.cpp [changed mode: 0755->0644]
src/gpu/effects/GrDistanceFieldGeoProc.h
src/gpu/effects/GrDitherEffect.cpp
src/gpu/effects/GrMatrixConvolutionEffect.cpp
src/gpu/effects/GrMatrixConvolutionEffect.h
src/gpu/effects/GrOvalEffect.cpp
src/gpu/effects/GrPorterDuffXferProcessor.cpp
src/gpu/effects/GrRRectEffect.cpp
src/gpu/effects/GrSimpleTextureEffect.cpp
src/gpu/effects/GrSimpleTextureEffect.h
src/gpu/effects/GrTextureDomain.cpp
src/gpu/effects/GrTextureStripAtlas.cpp
src/gpu/effects/GrTextureStripAtlas.h
src/gpu/effects/GrYUVtoRGBEffect.cpp
src/gpu/gl/GrGLAssembleInterface.cpp
src/gpu/gl/GrGLCaps.cpp
src/gpu/gl/GrGLContext.cpp
src/gpu/gl/GrGLCreateNullInterface.cpp
src/gpu/gl/GrGLExtensions.cpp
src/gpu/gl/GrGLFragmentProcessor.h
src/gpu/gl/GrGLGpu.cpp
src/gpu/gl/GrGLGpu.h
src/gpu/gl/GrGLGpuProgramCache.cpp
src/gpu/gl/GrGLInterface.cpp
src/gpu/gl/GrGLNameAllocator.cpp
src/gpu/gl/GrGLPathRendering.cpp
src/gpu/gl/SkGLContext.cpp
src/gpu/gl/SkNullGLContext.cpp
src/gpu/gl/builders/GrGLPathProgramBuilder.cpp
src/gpu/gl/builders/GrGLProgramBuilder.cpp
src/gpu/gl/debug/GrDebugGL.h
src/gpu/gl/debug/GrFakeRefObj.h
src/gpu/gl/debug/GrGLCreateDebugInterface.cpp
src/gpu/gl/debug/SkDebugGLContext.h
src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp
src/gpu/gl/glx/SkCreatePlatformGLContext_glx.cpp
src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp
src/gpu/gl/mesa/SkMesaGLContext.h
src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp
src/image/SkImage.cpp
src/image/SkImage_Gpu.cpp
src/image/SkImage_Raster.cpp
src/image/SkSurface_Gpu.cpp
src/image/SkSurface_Raster.cpp
src/images/SkDecodingImageGenerator.cpp
src/images/SkImageDecoder.cpp
src/images/SkImageDecoder_FactoryRegistrar.cpp
src/images/SkImageDecoder_astc.cpp
src/images/SkImageDecoder_ktx.cpp
src/images/SkImageDecoder_libbmp.cpp
src/images/SkImageDecoder_libgif.cpp
src/images/SkImageDecoder_libico.cpp
src/images/SkImageDecoder_libjpeg.cpp
src/images/SkImageDecoder_libpng.cpp
src/images/SkImageDecoder_libwebp.cpp
src/images/SkImageDecoder_pkm.cpp
src/images/SkImageDecoder_wbmp.cpp
src/images/SkMovie_gif.cpp
src/lazy/SkCachingPixelRef.cpp
src/lazy/SkCachingPixelRef.h
src/lazy/SkDiscardableMemoryPool.cpp
src/lazy/SkDiscardablePixelRef.cpp
src/opts/SkXfermode_opts.h
src/opts/opts_check_x86.cpp
src/pathops/SkPathOpsDebug.cpp
src/pathops/SkPathOpsTSect.h
src/pdf/SkDeflate.cpp
src/pdf/SkPDFBitmap.cpp
src/pdf/SkPDFDevice.cpp
src/pdf/SkPDFDevice.h
src/pdf/SkPDFGraphicState.cpp
src/pdf/SkPDFResourceDict.cpp
src/pdf/SkPDFShader.cpp
src/pdf/SkPDFTypes.cpp
src/pdf/SkPDFTypes.h
src/pipe/SkGPipePriv.h
src/pipe/SkGPipeRead.cpp
src/pipe/SkGPipeWrite.cpp
src/ports/SkFontConfigInterface_direct.cpp
src/ports/SkFontConfigTypeface.h
src/ports/SkFontHost_FreeType.cpp
src/ports/SkFontHost_mac.cpp [changed mode: 0755->0644]
src/ports/SkFontHost_win.cpp [changed mode: 0755->0644]
src/ports/SkFontMgr_android.cpp
src/ports/SkFontMgr_custom.cpp
src/ports/SkFontMgr_fontconfig.cpp
src/ports/SkFontMgr_win_dw.cpp
src/ports/SkImageDecoder_CG.cpp
src/ports/SkImageDecoder_WIC.cpp
src/ports/SkImageDecoder_empty.cpp
src/ports/SkImageGenerator_skia.cpp
src/ports/SkOSFile_posix.cpp
src/ports/SkOSFile_win.cpp
src/ports/SkRemotableFontMgr_win_dw.cpp
src/ports/SkTypeface_win_dw.cpp
src/ports/SkTypeface_win_dw.h
src/svg/SkSVGCanvas.cpp
src/svg/SkSVGDevice.cpp
src/svg/skp2svg.cpp
src/utils/SkCamera.cpp
src/utils/SkCanvasStateUtils.cpp
src/utils/SkEventTracer.cpp
src/utils/SkFrontBufferedStream.cpp
src/utils/SkImageGeneratorUtils.cpp
src/utils/SkNullCanvas.cpp
src/utils/SkPatchGrid.cpp
src/utils/SkPatchUtils.cpp
src/utils/SkPatchUtils.h
src/utils/SkRTConf.cpp
src/utils/debugger/SkDebugCanvas.cpp
src/utils/debugger/SkObjectParser.cpp
src/utils/mac/SkStream_mac.cpp
src/utils/win/SkDWriteFontFileStream.cpp
src/utils/win/SkWGL_win.cpp
src/views/SkEventSink.cpp
src/xml/SkDOM.cpp
tests/BlurTest.cpp
tests/CachedDataTest.cpp
tests/CachedDecodingPixelRefTest.cpp
tests/CanvasTest.cpp
tests/DataRefTest.cpp
tests/DrawBitmapRectTest.cpp
tests/DrawFilterTest.cpp
tests/FrontBufferedStreamTest.cpp
tests/GLProgramsTest.cpp
tests/ImageCacheTest.cpp
tests/ImageDecodingTest.cpp
tests/ImageFilterTest.cpp
tests/ImageTest.cpp
tests/JpegTest.cpp
tests/KtxTest.cpp
tests/LayerRasterizerTest.cpp
tests/LazyPtrTest.cpp
tests/PDFInvalidBitmapTest.cpp
tests/PDFPrimitivesTest.cpp
tests/PathOpsOpCircleThreadedTest.cpp
tests/PathOpsOpCubicThreadedTest.cpp
tests/PathOpsOpLoopThreadedTest.cpp [changed mode: 0755->0644]
tests/PathOpsOpRectThreadedTest.cpp
tests/PathOpsQuadLineIntersectionThreadedTest.cpp
tests/PathOpsSimplifyDegenerateThreadedTest.cpp [changed mode: 0755->0644]
tests/PathOpsSimplifyQuadThreadedTest.cpp
tests/PathOpsSimplifyQuadralateralsThreadedTest.cpp [changed mode: 0755->0644]
tests/PathOpsSimplifyRectThreadedTest.cpp
tests/PathOpsSimplifyTrianglesThreadedTest.cpp [changed mode: 0755->0644]
tests/PathOpsSkpClipTest.cpp [changed mode: 0755->0644]
tests/PathOpsThreadedCommon.cpp
tests/PathOpsTightBoundsTest.cpp
tests/PathTest.cpp
tests/PixelRefTest.cpp
tests/QuickRejectTest.cpp
tests/RecordTest.cpp
tests/ResourceCacheTest.cpp
tests/SkResourceCacheTest.cpp
tests/SkpSkGrTest.cpp
tests/SurfaceTest.cpp
tests/SwizzlerTest.cpp
tests/TArrayTest.cpp
tests/TextBlobCacheTest.cpp
tests/skia_test.cpp
tools/PictureBenchmark.cpp
tools/PictureRenderer.cpp
tools/PictureRenderingFlags.cpp
tools/VisualBench/VisualBench.cpp
tools/VisualBench/VisualBenchmarkStream.cpp
tools/bench_pictures_main.cpp
tools/flags/SkCommandLineFlags.cpp
tools/flags/SkCommandLineFlags.h
tools/render_pdfs_main.cpp
tools/render_pictures_main.cpp
tools/sk_tool_utils_font.cpp
tools/skpdiff/SkDiffContext.cpp
tools/skpdiff/SkPMetric.cpp

index 4cc9abe..978a371 100644 (file)
@@ -244,14 +244,14 @@ private:
 
 ////////////////////////////////////////////////////////////////////////////////
 
-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);)
index cbf5034..08a28ea 100644 (file)
@@ -169,33 +169,32 @@ private:
     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 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 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(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 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 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);)
index 98423d0..5e74552 100644 (file)
@@ -14,12 +14,12 @@ BenchLogger::BenchLogger()
 
 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();
 }
 
index 4938785..231d09b 100644 (file)
@@ -493,4 +493,4 @@ private:
 
 // 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);
index e6c68b5..9c8acce 100644 (file)
@@ -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 @@ private:
 };
 
 #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
index 914b5b6..03d1504 100644 (file)
@@ -60,4 +60,4 @@ private:
     typedef Benchmark INHERITED;
 };
 
-DEF_BENCH( return SkNEW_ARGS(FSRectBench, ()); )
+DEF_BENCH(return new FSRectBench();)
index 0326a0c..f813adb 100644 (file)
@@ -48,5 +48,5 @@ private:
 
 ///////////////////////////////////////////////////////////////////////////////
 
-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);)
index 3d9885f..631a8f2 100644 (file)
@@ -308,27 +308,18 @@ private:
 };
 
 // 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);)
index 1faff97..e7a9ca8 100644 (file)
@@ -45,7 +45,7 @@ static void populate_cache(GrGpu* gpu, int resourceCount, int keyData32Count) {
     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();
     }
index 96c64f8..4d71cf0 100644 (file)
@@ -46,7 +46,7 @@ public:
 
     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));
         }
     }
 
index 3b3dc72..1da9fbe 100644 (file)
@@ -127,12 +127,12 @@ static inline SkRect make_concentric_rects(SkRandom&, int index, int numRects) {
 
 ///////////////////////////////////////////////////////////////////////////////
 
-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 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 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 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));
index 4aa6b8b..db36395 100644 (file)
@@ -249,40 +249,35 @@ private:
     kMaskType _type;
 };
 
-
-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 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 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");)
index f7e1f04..506a363 100644 (file)
@@ -76,10 +76,10 @@ protected:
         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));
         }
     }
 
index 8752a34..8d8bd3d 100644 (file)
@@ -102,4 +102,4 @@ private:
     typedef Benchmark INHERITED;
 };
 
-DEF_BENCH( return SkNEW_ARGS(RectoriBench, ()); )
+DEF_BENCH(return new RectoriBench();)
index 2188cb3..b6f763c 100644 (file)
@@ -121,12 +121,12 @@ private:
 
 #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");)
index dfee956..10a6007 100644 (file)
@@ -64,4 +64,4 @@ private:
     typedef Benchmark INHERITED;
 };
 
-DEF_BENCH( return SkNEW_ARGS(RegionContainBench, (sect_proc, "sect")); )
+DEF_BENCH(return new RegionContainBench(sect_proc, "sect");)
index 02fd48a..f43dc80 100644 (file)
@@ -71,5 +71,5 @@ private:
 
 SKPAnimationBench::Animation* SKPAnimationBench::CreateZoomAnimation(SkScalar zoomMax,
                                                                      double zoomPeriodMs) {
-    return SkNEW_ARGS(ZoomAnimation, (zoomMax, zoomPeriodMs));
+    return new ZoomAnimation(zoomMax, zoomPeriodMs);
 }
index 7840a8a..75fe78a 100644 (file)
@@ -113,5 +113,5 @@ private:
 };
 
 // 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));
index 70dc79e..750bd06 100644 (file)
@@ -103,17 +103,17 @@ static SkPaint paint_maker() {
     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);)
index e426ad8..6e49bf4 100644 (file)
@@ -92,4 +92,4 @@ private:
 
 ///////////////////////////////////////////////////////////////////////////////
 
-DEF_BENCH( return SkNEW_ARGS(VertBench, ()); )
+DEF_BENCH(return new VertBench();)
index 3ee9034..0b98cf8 100644 (file)
@@ -71,5 +71,5 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-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);)
index 550a35f..75d0ce3 100644 (file)
@@ -514,7 +514,7 @@ static bool valid_subset_bench(const SkString& path, SkColorType colorType, bool
         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 bool valid_subset_bench(const SkString& path, SkColorType colorType, bool
 }
 
 static void cleanup_run(Target* target) {
-    SkDELETE(target);
+    delete target;
 #if SK_SUPPORT_GPU
     if (FLAGS_abandonGpuContext) {
         gGrFactory->abandonContexts();
@@ -676,7 +676,7 @@ public:
             if (gm->runAsBench()) {
                 fSourceType = "gm";
                 fBenchType  = "micro";
-                return SkNEW_ARGS(GMBench, (gm.detach()));
+                return new GMBench(gm.detach());
             }
         }
 
@@ -692,7 +692,7 @@ public:
             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 @@ public:
                     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 @@ public:
                 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 @@ int nanobench_main() {
 #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 @@ int nanobench_main() {
         }
     }
 
-    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) {
index d2c3410..d387684 100644 (file)
@@ -40,7 +40,7 @@ static const char* get_color_name(SkColorType colorType) {
 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);
index 303cd55..9713cfd 100644 (file)
@@ -67,7 +67,7 @@ void SubsetSingleBench::onDraw(const int n, SkCanvas* canvas) {
             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;
index 2e66c38..35654d6 100644 (file)
@@ -63,7 +63,7 @@ void SubsetTranslateBench::onDraw(const int n, SkCanvas* canvas) {
             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 @@ void SubsetTranslateBench::onDraw(const int n, SkCanvas* canvas) {
         // 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));
index 84d50aa..d8abfd7 100644 (file)
@@ -63,7 +63,7 @@ void SubsetZoomBench::onDraw(const int n, SkCanvas* canvas) {
             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;
index cd888b2..d86e378 100644 (file)
@@ -725,7 +725,7 @@ void SkDebuggerGUI::setupDirectoryWidget(const QString& path) {
 void SkDebuggerGUI::loadPicture(const SkString& fileName) {
     fFileName = fileName;
     fLoading = true;
-    SkAutoTDelete<SkStream> stream(SkNEW_ARGS(SkFILEStream, (fileName.c_str())));
+    SkAutoTDelete<SkStream> stream(new SkFILEStream(fileName.c_str()));
 
     SkPicture* picture = SkPicture::CreateFromStream(stream);
 
index a7240b8..d46e590 100644 (file)
@@ -134,7 +134,7 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
     int maxColors = 256;
     if (kIndex_8_SkColorType == decodeInfo.colorType()) {
         SkPMColor colors[256];
-        colorTable.reset(SkNEW_ARGS(SkColorTable, (colors, maxColors)));
+        colorTable.reset(new SkColorTable(colors, maxColors));
         colorPtr = const_cast<SkPMColor*>(colorTable->readColors());
         colorCountPtr = &maxColors;
     }
@@ -220,7 +220,7 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
                         largestSubsetDecodeInfo.width(), largestSubsetDecodeInfo.height());
             }
             const size_t rowBytes = decodeInfo.minRowBytes();
-            char* buffer = SkNEW_ARRAY(char, largestSubsetDecodeInfo.height() * rowBytes);
+            char* buffer = new char[largestSubsetDecodeInfo.height() * rowBytes];
             SkAutoTDeleteArray<char> lineDeleter(buffer);
             for (int col = 0; col < divisor; col++) {
                 //currentSubsetWidth may be larger than subsetWidth for rightmost subsets
@@ -767,7 +767,7 @@ Error SKPSink::draw(const Src& src, SkBitmap*, SkWStream* dst, SkString*) const
 SVGSink::SVGSink() {}
 
 Error SVGSink::draw(const Src& src, SkBitmap*, SkWStream* dst, SkString*) const {
-    SkAutoTDelete<SkXMLWriter> xmlWriter(SkNEW_ARGS(SkXMLStreamWriter, (dst)));
+    SkAutoTDelete<SkXMLWriter> xmlWriter(new SkXMLStreamWriter(dst));
     SkAutoTUnref<SkCanvas> canvas(SkSVGCanvas::Create(
         SkRect::MakeWH(SkIntToScalar(src.size().width()), SkIntToScalar(src.size().height())),
         xmlWriter));
index 7dac2a4..6f9958f 100644 (file)
@@ -1,3 +1,9 @@
+/*
+ * Copyright 2011 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
 #include "SkCanvas.h"
 #include "SkCGUtils.h"
 #include "SkGraphics.h"
@@ -23,15 +29,14 @@ static SkPicture* LoadPicture(const char path[]) {
     SkBitmap bm;
     if (SkImageDecoder::DecodeFile(path, &bm)) {
         bm.setImmutable();
-        pic = SkNEW(SkPicture);
+        pic = new SkPicture;
         SkCanvas* can = pic->beginRecording(bm.width(), bm.height());
         can->drawBitmap(bm, 0, 0, NULL);
         pic->endRecording();
     } else {
         SkFILEStream stream(path);
         if (stream.isValid()) {
-            pic = SkNEW_ARGS(SkPicture,
-                             (&stream, NULL, &SkImageDecoder::DecodeStream));
+            pic = new SkPicture(&stream, NULL, &SkImageDecoder::DecodeStream);
         }
 
         if (false) { // re-record
@@ -247,7 +252,7 @@ void application_init() {
         canvas.divName(filename, false);
         SkPicture* pic = LoadPicture(path.c_str());
         pic->draw(&canvas);
-        SkDELETE(pic);
+        delete pic;
     }
     SkDebugf("\n</div>\n\n");
 
@@ -261,7 +266,7 @@ void application_init() {
         canvas.divName(filename, true);
         SkPicture* pic = LoadPicture(path.c_str());
         pic->draw(&canvas);
-        SkDELETE(pic);
+        delete pic;
     }
     SkDebugf("];\n\n");
 
index 10733b3..7ede6a5 100644 (file)
@@ -105,7 +105,7 @@ private:
     typedef skiagm::GM INHERITED;
 };
 
-DEF_GM( return SkNEW(AAClipGM); )
+DEF_GM(return new AAClipGM;)
 
 /////////////////////////////////////////////////////////////////////////
 
@@ -118,7 +118,7 @@ static SkCanvas* make_canvas(const SkBitmap& bm) {
                                             (SkPMColor*)bm.getPixels(),
                                             bm.rowBytes());
     } else {
-        return SkNEW_ARGS(SkCanvas, (bm));
+        return new SkCanvas(bm);
     }
 }
 
@@ -190,7 +190,7 @@ private:
 };
 
 #if 0 // Disabled pending fix from reed@
-DEF_GM( return SkNEW(CGImageGM); )
+DEF_GM( return new CGImageGM; )
 #endif
 #endif
 
@@ -260,5 +260,4 @@ protected:
 private:
     typedef skiagm::GM INHERITED;
 };
-DEF_GM( return SkNEW(ClipCubicGM); )
-
+DEF_GM(return new ClipCubicGM;)
index 7ff8675..2fbd71d 100644 (file)
@@ -124,8 +124,7 @@ static SkBitmap indexed_bitmap() {
         pmColors[i] = premultiply_color(colors[i]);
     }
     SkBitmap bm;
-    SkAutoTUnref<SkColorTable> ctable(
-            SkNEW_ARGS(SkColorTable, (pmColors, SK_ARRAY_COUNT(pmColors))));
+    SkAutoTUnref<SkColorTable> ctable(new SkColorTable(pmColors, SK_ARRAY_COUNT(pmColors)));
     SkImageInfo info = SkImageInfo::Make(SCALE, SCALE, kIndex_8_SkColorType,
                                          kPremul_SkAlphaType);
     bm.allocPixels(info, NULL, ctable);
index 426acaa..b209cec 100644 (file)
@@ -76,4 +76,4 @@ private:
     typedef skiagm::GM INHERITED;
 };
 
-DEF_GM( return SkNEW(AlphaGradientsGM); )
+DEF_GM(return new AlphaGradientsGM;)
index c1f5190..6610926 100644 (file)
@@ -109,6 +109,5 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(AnisotropicGM); )
-
+DEF_GM(return new AnisotropicGM;)
 }
index 6efea27..792f7da 100644 (file)
@@ -79,6 +79,5 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(ArcOfZorroGM); )
-
+DEF_GM(return new ArcOfZorroGM;)
 }
index 316bf88..8ee7746 100644 (file)
@@ -99,4 +99,4 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(skiagm::ASTCBitmapGM); )
+DEF_GM(return new skiagm::ASTCBitmapGM;)
index cce8146..7c51c74 100644 (file)
@@ -57,4 +57,4 @@ private:
 
 /////////////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(BadPaintGM); )
+DEF_GM(return new BadPaintGM;)
index 2636f26..9edc114 100644 (file)
@@ -40,7 +40,7 @@ public:
 
     static GrDrawBatch* Create(const GrGeometryProcessor* gp, const Geometry& geo,
                                const SkScalar klmEqs[9], SkScalar sign) {
-        return SkNEW_ARGS(BezierCubicOrConicTestBatch, (gp, geo, klmEqs, sign));
+        return new BezierCubicOrConicTestBatch(gp, geo, klmEqs, sign);
     }
 
 private:
@@ -440,7 +440,7 @@ public:
 
     static GrDrawBatch* Create(const GrGeometryProcessor* gp, const Geometry& geo,
                                const GrPathUtils::QuadUVMatrix& devToUV) {
-        return SkNEW_ARGS(BezierQuadTestBatch, (gp, geo, devToUV));
+        return new BezierQuadTestBatch(gp, geo, devToUV);
     }
 
 private:
@@ -631,10 +631,9 @@ private:
     typedef GM INHERITED;
 };
 
-DEF_GM( return SkNEW(BezierCubicEffects); )
-DEF_GM( return SkNEW(BezierConicEffects); )
-DEF_GM( return SkNEW(BezierQuadEffects); )
-
+DEF_GM(return new BezierCubicEffects;)
+DEF_GM(return new BezierConicEffects;)
+DEF_GM(return new BezierQuadEffects;)
 }
 
 #endif
index 5500005..d68b2ca 100644 (file)
@@ -111,6 +111,5 @@ private:
     typedef GM INHERITED;
 };
 
-DEF_GM( return SkNEW(BigBlursGM); )
-
+DEF_GM(return new BigBlursGM;)
 }
index c69d9b9..17f69c5 100644 (file)
@@ -52,4 +52,4 @@ private:
     typedef skiagm::GM INHERITED;
 };
 
-DEF_GM( return SkNEW(BigTextGM); )
+DEF_GM(return new BigTextGM;)
index b788209..dbd41c2 100644 (file)
@@ -103,6 +103,5 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(BigTileImageFilterGM); )
-
+DEF_GM(return new BigTileImageFilterGM;)
 }
index bc4acf7..6c32f62 100644 (file)
@@ -82,9 +82,8 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW_ARGS(BitmapSourceGM, ("none", kNone_SkFilterQuality) );   )
-DEF_GM( return SkNEW_ARGS(BitmapSourceGM, ("low",  kLow_SkFilterQuality) );    )
-DEF_GM( return SkNEW_ARGS(BitmapSourceGM, ("med",  kMedium_SkFilterQuality) ); )
-DEF_GM( return SkNEW_ARGS(BitmapSourceGM, ("high", kHigh_SkFilterQuality) );   )
-
+DEF_GM(return new BitmapSourceGM("none", kNone_SkFilterQuality);)
+DEF_GM(return new BitmapSourceGM("low", kLow_SkFilterQuality);)
+DEF_GM(return new BitmapSourceGM("med", kMedium_SkFilterQuality);)
+DEF_GM(return new BitmapSourceGM("high", kHigh_SkFilterQuality);)
 }
index dd7b901..c147014 100644 (file)
@@ -77,4 +77,4 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(BmpFilterQualityRepeat); )
+DEF_GM(return new BmpFilterQualityRepeat;)
index 0175eda..f4183b1 100644 (file)
@@ -67,5 +67,4 @@ private:
     typedef skiagm::GM INHERITED;
 };
 
-DEF_GM( return SkNEW(ClipStrokeRectGM); )
-
+DEF_GM(return new ClipStrokeRectGM;)
index 9659201..aa635d9 100644 (file)
@@ -64,6 +64,5 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM(return SkNEW(ClipDrawDrawGM);)
-
+DEF_GM(return new ClipDrawDrawGM;)
 }
index 851e9c7..d4fb2fa 100644 (file)
@@ -38,7 +38,7 @@ protected:
             stream.rewind();
             codec->setDitherImage(dither);
             codec->decode(&stream, &fBitmap, kN32_SkColorType, SkImageDecoder::kDecodePixels_Mode);
-            SkDELETE(codec);
+            delete codec;
         }
     }
 
index bedb7f6..73ca7f3 100644 (file)
@@ -84,4 +84,4 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(ColorFiltersGM); )
+DEF_GM(return new ColorFiltersGM;)
index 8e69664..4d8c9d6 100644 (file)
@@ -40,7 +40,7 @@ protected:
         if (NULL == orig) {
             orig = SkTypeface::RefDefault();
         }
-        fColorType = SkNEW_ARGS(SkGTypeface, (orig, paint));
+        fColorType = new SkGTypeface(orig, paint);
         orig->unref();
     }
 
@@ -70,4 +70,4 @@ private:
     typedef skiagm::GM INHERITED;
 };
 
-DEF_GM( return SkNEW(ColorTypeGM); )
+DEF_GM(return new ColorTypeGM;)
index 97becde..2926523 100644 (file)
@@ -47,7 +47,7 @@ protected:
         if (NULL == orig) {
             orig = SkTypeface::RefDefault();
         }
-        fColorType = SkNEW_ARGS(SkGTypeface, (orig, paint));
+        fColorType = new SkGTypeface(orig, paint);
         orig->unref();
 
         fBG.installPixels(SkImageInfo::Make(2, 2, kARGB_4444_SkColorType,
index ba44aa0..74c877d 100644 (file)
@@ -200,13 +200,12 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW_ARGS(ComplexClipGM, (false, false, false)); )
-DEF_GM( return SkNEW_ARGS(ComplexClipGM, (false, false, true));  )
-DEF_GM( return SkNEW_ARGS(ComplexClipGM, (false, true,  false)); )
-DEF_GM( return SkNEW_ARGS(ComplexClipGM, (false, true,  true));  )
-DEF_GM( return SkNEW_ARGS(ComplexClipGM, (true,  false, false)); )
-DEF_GM( return SkNEW_ARGS(ComplexClipGM, (true,  false, true));  )
-DEF_GM( return SkNEW_ARGS(ComplexClipGM, (true,  true,  false)); )
-DEF_GM( return SkNEW_ARGS(ComplexClipGM, (true,  true,  true));  )
-
+DEF_GM(return new ComplexClipGM(false, false, false);)
+DEF_GM(return new ComplexClipGM(false, false, true);)
+DEF_GM(return new ComplexClipGM(false, true, false);)
+DEF_GM(return new ComplexClipGM(false, true, true);)
+DEF_GM(return new ComplexClipGM(true, false, false);)
+DEF_GM(return new ComplexClipGM(true, false, true);)
+DEF_GM(return new ComplexClipGM(true, true, false);)
+DEF_GM(return new ComplexClipGM(true, true, true);)
 }
index 8933cf3..9d2103b 100644 (file)
@@ -35,7 +35,7 @@ static SkShader* make_shader(SkXfermode::Mode mode) {
 
     SkAutoTUnref<SkXfermode> xfer(SkXfermode::Create(mode));
 
-    return SkNEW_ARGS(SkComposeShader, (shaderA, shaderB, xfer));
+    return new SkComposeShader(shaderA, shaderB, xfer);
 }
 
 class ComposeShaderGM : public skiagm::GM {
index 2bdd1f8..71057b8 100644 (file)
@@ -128,7 +128,7 @@ private:
     SkPath           fGiantCircle;
     typedef skiagm::GM INHERITED;
 };
-DEF_GM( return SkNEW(ConicPathsGM); )
+DEF_GM(return new ConicPathsGM;)
 
 //////////////////////////////////////////////////////////////////////////////
 
index 30544af..2287af4 100644 (file)
@@ -192,7 +192,7 @@ private:
 const SkScalar ConstColorProcessor::kPad = 10.f;
 const SkScalar ConstColorProcessor::kRectSize = 20.f;
 
-DEF_GM( return SkNEW(ConstColorProcessor); )
+DEF_GM(return new ConstColorProcessor;)
 }
 
 #endif
index 435a37a..6c494cd 100644 (file)
@@ -211,7 +211,7 @@ protected:
                 break;
             }
 
-            data.reset(SkNEW_ARRAY(SkPoint, numPts));
+            data.reset(new SkPoint[numPts]);
 
             create_ngon(numPts, data.get(), width, height);
             points = data.get();
@@ -317,6 +317,5 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(ConvexLineOnlyPathsGM); )
-
+DEF_GM(return new ConvexLineOnlyPathsGM;)
 }
index 2ed17f2..2aa05a8 100644 (file)
@@ -297,6 +297,5 @@ private:
     typedef GM INHERITED;
 };
 
-DEF_GM( return SkNEW(ConvexPolyClip); )
-
+DEF_GM(return new ConvexPolyClip;)
 }
index 30471a7..bd92069 100644 (file)
@@ -38,7 +38,7 @@ public:
     const char* name() const override { return "ConvexPolyTestBatch"; }
 
     static GrDrawBatch* Create(const GrGeometryProcessor* gp, const Geometry& geo) {
-        return SkNEW_ARGS(ConvexPolyTestBatch, (gp, geo));
+        return new ConvexPolyTestBatch(gp, geo);
     }
 
 private:
@@ -275,7 +275,7 @@ private:
     typedef GM INHERITED;
 };
 
-DEF_GM( return SkNEW(ConvexPolyEffect); )
+DEF_GM(return new ConvexPolyEffect;)
 }
 
 #endif
index bd906cb..15e4bc2 100644 (file)
@@ -474,10 +474,9 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM(return SkNEW(DashingGM);)
-DEF_GM(return SkNEW(Dashing2GM);)
-DEF_GM(return SkNEW(Dashing3GM);)
-DEF_GM(return SkNEW(Dashing4GM);)
-DEF_GM(return SkNEW_ARGS(Dashing5GM, (true));)
-DEF_GM(return SkNEW_ARGS(Dashing5GM, (false));)
-
+DEF_GM(return new DashingGM;)
+DEF_GM(return new Dashing2GM;)
+DEF_GM(return new Dashing3GM;)
+DEF_GM(return new Dashing4GM;)
+DEF_GM(return new Dashing5GM(true);)
+DEF_GM(return new Dashing5GM(false);)
index 0c4049b..e0cb2d7 100644 (file)
@@ -50,7 +50,7 @@ private:
 SkFlattenable* DCShader::CreateProc(SkReadBuffer& buf) {
     SkMatrix matrix;
     buf.readMatrix(&matrix);
-    return SkNEW_ARGS(DCShader, (matrix));
+    return new DCShader(matrix);
 }
 
 class DCFP : public GrFragmentProcessor {
@@ -76,7 +76,7 @@ public:
             }
             void onSetData(const GrGLProgramDataManager&, const GrProcessor&) override {}
         };
-        return SkNEW(DCGLFP);
+        return new DCGLFP;
     }
 
     const char* name() const override { return "DCFP"; }
@@ -98,7 +98,7 @@ bool DCShader::asFragmentProcessor(GrContext*, const SkPaint& paint, const SkMat
                                    const SkMatrix* localMatrix, GrColor* color,
                                    GrProcessorDataManager* procDataManager,
                                    GrFragmentProcessor** fp) const {
-    *fp = SkNEW_ARGS(DCFP, (procDataManager, fDeviceMatrix));
+    *fp = new DCFP(procDataManager, fDeviceMatrix);
     *color = GrColorPackA4(paint.getAlpha());
     return true;
 }
@@ -111,7 +111,7 @@ public:
 
     ~DCShaderGM() override {
         for (int i = 0; i < fPrims.count(); ++i) {
-            SkDELETE(fPrims[i]);
+            delete fPrims[i];
         }
     }
 
@@ -212,15 +212,15 @@ protected:
             virtual const char* text() const { return "Hello, Skia!"; }
         };
 
-        fPrims.push_back(SkNEW(Rect));
-        fPrims.push_back(SkNEW(Circle));
-        fPrims.push_back(SkNEW(RRect));
-        fPrims.push_back(SkNEW(DRRect));
-        fPrims.push_back(SkNEW(Path));
-        fPrims.push_back(SkNEW(Points(SkCanvas::kPoints_PointMode)));
-        fPrims.push_back(SkNEW(Points(SkCanvas::kLines_PointMode)));
-        fPrims.push_back(SkNEW(Points(SkCanvas::kPolygon_PointMode)));
-        fPrims.push_back(SkNEW(Text));
+        fPrims.push_back(new Rect);
+        fPrims.push_back(new Circle);
+        fPrims.push_back(new RRect);
+        fPrims.push_back(new DRRect);
+        fPrims.push_back(new Path);
+        fPrims.push_back(new Points(SkCanvas::kPoints_PointMode));
+        fPrims.push_back(new Points(SkCanvas::kLines_PointMode));
+        fPrims.push_back(new Points(SkCanvas::kPolygon_PointMode));
+        fPrims.push_back(new Text);
     }
 
     void onDraw(SkCanvas* canvas) override {
@@ -253,7 +253,7 @@ protected:
             for (int i = 0; i < fPrims.count(); ++i) {
                 for (int j = 0; j < devMats.count(); ++j) {
                     for (int k = 0; k < viewMats.count(); ++k) {
-                        paint.setShader(SkNEW_ARGS(DCShader, (devMats[j])))->unref();
+                        paint.setShader(new DCShader(devMats[j]))->unref();
                         paint.setAntiAlias(SkToBool(aa));
                         canvas->save();
                         canvas->concat(viewMats[k]);
@@ -291,6 +291,6 @@ private:
     typedef GM INHERITED;
 };
 
-DEF_GM( return SkNEW(DCShaderGM); )
+DEF_GM(return new DCShaderGM;)
 }
 #endif
old mode 100755 (executable)
new mode 100644 (file)
index 0b68add..f6bc0b2
@@ -215,4 +215,4 @@ private:
     typedef skiagm::GM INHERITED;
 };
 
-DEF_GM( return SkNEW(DFTextGM); )
+DEF_GM(return new DFTextGM;)
index d30e15c..93da1ab 100644 (file)
@@ -87,7 +87,7 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(DiscardGM); )
+DEF_GM(return new DiscardGM;)
 
 } // end namespace
 
index 4aceef9..5732378 100644 (file)
@@ -180,7 +180,7 @@ class DownsampleBitmapImageGM: public DownsampleBitmapGM {
           if (codec) {
               stream.rewind();
               codec->decode(&stream, &fBM, kN32_SkColorType, SkImageDecoder::kDecodePixels_Mode);
-              SkDELETE(codec);
+              delete codec;
           } else {
               fBM.allocN32Pixels(1, 1);
               *(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad
index d3a8937..20d3c91 100644 (file)
@@ -58,4 +58,4 @@ private:
     typedef skiagm::GM INHERITED;
 };
 
-DEF_GM( return SkNEW(EmbossGM); )
+DEF_GM(return new EmbossGM;)
index c66f7b2..363bd44 100644 (file)
@@ -219,10 +219,10 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(skiagm::ETC1Bitmap_PKM_GM); )
-DEF_GM( return SkNEW(skiagm::ETC1Bitmap_KTX_GM); )
-DEF_GM( return SkNEW(skiagm::ETC1Bitmap_R11_KTX_GM); )
+DEF_GM(return new skiagm::ETC1Bitmap_PKM_GM;)
+DEF_GM(return new skiagm::ETC1Bitmap_KTX_GM;)
+DEF_GM(return new skiagm::ETC1Bitmap_R11_KTX_GM;)
 
 #ifndef SK_IGNORE_ETC1_SUPPORT
-DEF_GM( return SkNEW(skiagm::ETC1Bitmap_NPOT_GM); )
+DEF_GM(return new skiagm::ETC1Bitmap_NPOT_GM;)
 #endif  // SK_IGNORE_ETC1_SUPPORT
index 46500ba..1af1695 100644 (file)
@@ -205,7 +205,7 @@ protected:
           if (codec) {
               stream.rewind();
               codec->decode(&stream, &fBM, kN32_SkColorType, SkImageDecoder::kDecodePixels_Mode);
-              SkDELETE(codec);
+              delete codec;
           } else {
               fBM.allocN32Pixels(1, 1);
               *(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad
index a4b65e0..f6797db 100644 (file)
@@ -321,6 +321,5 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM(return SkNEW(ImageFilterFastBoundGM);)
-
+DEF_GM(return new ImageFilterFastBoundGM;)
 }
index b9f5a7a..8df39bc 100644 (file)
@@ -108,7 +108,7 @@ protected:
           if (codec) {
               stream.rewind();
               codec->decode(&stream, &fBM, kN32_SkColorType, SkImageDecoder::kDecodePixels_Mode);
-              SkDELETE(codec);
+              delete codec;
           } else {
               fBM.allocN32Pixels(1, 1);
               *(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad
index 5f1141e..77a4c86 100644 (file)
@@ -83,4 +83,4 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(FontCacheGM); )
+DEF_GM(return new FontCacheGM;)
index 35914e7..9339115 100644 (file)
@@ -300,12 +300,12 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(FontMgrGM); )
-DEF_GM( return SkNEW(FontMgrMatchGM); )
-DEF_GM( return SkNEW(FontMgrBoundsGM(1.0, 0)); )
-DEF_GM( return SkNEW(FontMgrBoundsGM(0.75, 0)); )
-DEF_GM( return SkNEW(FontMgrBoundsGM(1.0, -0.25)); )
+DEF_GM(return new FontMgrGM;)
+DEF_GM(return new FontMgrMatchGM;)
+DEF_GM(return new FontMgrBoundsGM(1.0, 0);)
+DEF_GM(return new FontMgrBoundsGM(0.75, 0);)
+DEF_GM(return new FontMgrBoundsGM(1.0, -0.25);)
 
 #ifdef SK_BUILD_FOR_WIN
-    DEF_GM( return SkNEW_ARGS(FontMgrGM, (SkFontMgr_New_DirectWrite())); )
+DEF_GM(return new FontMgrGM(SkFontMgr_New_DirectWrite());)
 #endif
index 2ee3797..e8bfad4 100644 (file)
@@ -66,9 +66,7 @@ public:
         fDoRotate = doRotate;
     }
 
-    virtual ~GiantBitmapGM() {
-        SkDELETE(fBM);
-    }
+    virtual ~GiantBitmapGM() { delete fBM; }
 
 protected:
 
diff --git a/gm/gm.h b/gm/gm.h
index 24c6100..7765dca 100644 (file)
--- a/gm/gm.h
+++ b/gm/gm.h
@@ -24,13 +24,11 @@ struct GrContextOptions;
     static skiagm::GMRegistry   SK_MACRO_APPEND_LINE(R_)(SK_MACRO_APPEND_LINE(F_));
 
 // See colorwheel.cpp for example usage.
-#define DEF_SIMPLE_GM(NAME, CANVAS, W, H)                               \
-    static void SK_MACRO_CONCAT(NAME, _GM)(SkCanvas* CANVAS);           \
-    DEF_GM( return SkNEW_ARGS(skiagm::SimpleGM,                         \
-                              (SkString(#NAME),                         \
-                               SK_MACRO_CONCAT(NAME, _GM),              \
-                               SkISize::Make(W, H))); )                 \
-    void SK_MACRO_CONCAT(NAME, _GM)(SkCanvas* CANVAS)
+#define DEF_SIMPLE_GM(NAME, CANVAS, W, H)                                           \
+    static void SK_MACRO_CONCAT(NAME, _GM)(SkCanvas * CANVAS);                      \
+    DEF_GM(return new skiagm::SimpleGM(SkString(#NAME), SK_MACRO_CONCAT(NAME, _GM), \
+                                       SkISize::Make(W, H));)                       \
+    void SK_MACRO_CONCAT(NAME, _GM)(SkCanvas * CANVAS)
 
 namespace skiagm {
 
index e706ac6..d06ae5b 100644 (file)
@@ -128,15 +128,15 @@ struct ColorPos {
 
     ColorPos() : fColors(NULL), fPos(NULL), fCount(0) {}
     ~ColorPos() {
-        SkDELETE_ARRAY(fColors);
-        SkDELETE_ARRAY(fPos);
+        delete[] fColors;
+        delete[] fPos;
     }
 
     void construct(const SkColor colors[], const SkScalar pos[], int count) {
-        fColors = SkNEW_ARRAY(SkColor, count);
+        fColors = new SkColor[count];
         memcpy(fColors, colors, count * sizeof(SkColor));
         if (pos) {
-            fPos = SkNEW_ARRAY(SkScalar, count);
+            fPos = new SkScalar[count];
             memcpy(fPos, pos, count * sizeof(SkScalar));
             fPos[0] = 0;
             fPos[count - 1] = 1;
@@ -248,5 +248,5 @@ private:
 
 ///////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(GradientsNoTextureGM));
-DEF_GM( return SkNEW(GradientsManyColorsGM));
+DEF_GM(return new GradientsNoTextureGM);
+DEF_GM(return new GradientsManyColorsGM);
index 426a4dc..61c3f11 100644 (file)
@@ -26,9 +26,7 @@ public:
                                     FailImageFilter::GetFlattenableType());
         }
     };
-    static FailImageFilter* Create() {
-        return SkNEW(FailImageFilter);
-    }
+    static FailImageFilter* Create() { return new FailImageFilter; }
 
     SK_TO_STRING_OVERRIDE()
     SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(FailImageFilter)
@@ -70,7 +68,7 @@ public:
         }
     };
     static IdentityImageFilter* Create(SkImageFilter* input = NULL) {
-        return SkNEW_ARGS(IdentityImageFilter, (input));
+        return new IdentityImageFilter(input);
     }
 
     SK_TO_STRING_OVERRIDE()
index cfedaf0..521dd3c 100644 (file)
@@ -34,7 +34,7 @@ public:
         }
     };
     static SkImageFilter* Create(SkScalar dx, SkScalar dy, SkImageFilter* input) {
-        return SkNEW_ARGS(SimpleOffsetFilter, (dx, dy, input));
+        return new SimpleOffsetFilter(dx, dy, input);
     }
 
     virtual bool onFilterImage(Proxy* proxy, const SkBitmap& src, const Context& ctx,
index 7767c46..68faf80 100644 (file)
@@ -169,7 +169,7 @@ private:
     typedef GM INHERITED;
 };
 
-DEF_GM( return SkNEW(ImageFromYUVTextures); )
+DEF_GM(return new ImageFromYUVTextures;)
 }
 
 #endif
index bb5447e..bc1dc24 100644 (file)
@@ -72,7 +72,7 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-static GM* MyFactory(void*) { return SkNEW(InternalLinksGM); }
+static GM* MyFactory(void*) { return new InternalLinksGM; }
 static GMRegistry reg(MyFactory);
 
 }
index 8723824..b74f902 100644 (file)
@@ -65,5 +65,5 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(LargeGlyphBlur); )
+DEF_GM(return new LargeGlyphBlur;)
 }
index b483c13..f690c76 100644 (file)
@@ -60,4 +60,4 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(LerpXfermodeGM); )
+DEF_GM(return new LerpXfermodeGM;)
index f6d236c..a464a07 100644 (file)
@@ -170,6 +170,5 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(ImageLightingGM); )
-
+DEF_GM(return new ImageLightingGM;)
 }
index c73ad5b..8bb3595 100644 (file)
@@ -185,6 +185,5 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(LightingShaderGM); )
-
+DEF_GM(return new LightingShaderGM;)
 }
index 1423788..46a22f8 100644 (file)
@@ -152,4 +152,4 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(LumaFilterGM); )
+DEF_GM(return new LumaFilterGM;)
index a98f531..e66e73c 100644 (file)
@@ -163,5 +163,5 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(MixedTextBlobsGM); )
+DEF_GM(return new MixedTextBlobsGM;)
 }
index f9a3a10..9f70bf8 100644 (file)
@@ -49,8 +49,7 @@ static SkShader* make_bg_shader(int checkSize) {
                                     SkIntToScalar(checkSize), SkIntToScalar(checkSize));
     canvas.drawRect(rect1, paint);
     canvas.drawRect(rect0, paint);
-    return SkNEW_ARGS(SkBitmapProcShader, (bmp, SkShader::kRepeat_TileMode,
-                                                SkShader::kRepeat_TileMode));
+    return new SkBitmapProcShader(bmp, SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode);
 }
 
 class ModeColorFilterGM : public GM {
index 21c9d18..3a0b0fa 100644 (file)
@@ -258,7 +258,10 @@ static SkSurface* create_compat_surface(SkCanvas* canvas, int width, int height)
 class ComposeStep {
 public:
     ComposeStep() : fSurf(NULL), fX(0.0f), fY(0.0f), fPaint(NULL) { }
-    ~ComposeStep() { SkSafeUnref(fSurf);  SkDELETE(fPaint); }
+    ~ComposeStep() {
+        SkSafeUnref(fSurf);
+        delete fPaint;
+    }
 
     SkSurface* fSurf;
     SkScalar   fX;
@@ -415,7 +418,7 @@ static void tiled(SkCanvas* finalCanvas, SkMultiPictureDraw* mpd,
 
             step.fX = SkIntToScalar(x*kTileWidth);
             step.fY = SkIntToScalar(y*kTileHeight);
-            step.fPaint = SkNEW(SkPaint);
+            step.fPaint = new SkPaint;
             step.fPaint->setColorFilter(
                 SkColorFilter::CreateModeFilter(colors[x][y], SkXfermode::kModulate_Mode))->unref();
 
@@ -540,33 +543,33 @@ namespace skiagm {
         typedef GM INHERITED;
     };
 
-    DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kNoClipSingle_Content,
-                                                MultiPictureDraw::kSimple_Layout));)
-    DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kRectClipMulti_Content,
-                                                MultiPictureDraw::kSimple_Layout));)
-    DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kRRectClipMulti_Content,
-                                                MultiPictureDraw::kSimple_Layout));)
-    DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kPathClipMulti_Content,
-                                                MultiPictureDraw::kSimple_Layout));)
-    DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kInvPathClipMulti_Content,
-                                                MultiPictureDraw::kSimple_Layout));)
-    DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kSierpinski_Content,
-                                                MultiPictureDraw::kSimple_Layout));)
-    DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kBigLayer_Content,
-                                                MultiPictureDraw::kSimple_Layout));)
-
-    DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kNoClipSingle_Content,
-                                                MultiPictureDraw::kTiled_Layout));)
-    DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kRectClipMulti_Content,
-                                                MultiPictureDraw::kTiled_Layout));)
-    DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kRRectClipMulti_Content,
-                                                MultiPictureDraw::kTiled_Layout));)
-    DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kPathClipMulti_Content,
-                                                MultiPictureDraw::kTiled_Layout));)
-    DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kInvPathClipMulti_Content,
-                                                MultiPictureDraw::kTiled_Layout));)
-    DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kSierpinski_Content,
-                                                MultiPictureDraw::kTiled_Layout));)
-    DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kBigLayer_Content,
-                                                MultiPictureDraw::kTiled_Layout));)
+    DEF_GM(return new MultiPictureDraw(MultiPictureDraw::kNoClipSingle_Content,
+                                       MultiPictureDraw::kSimple_Layout);)
+    DEF_GM(return new MultiPictureDraw(MultiPictureDraw::kRectClipMulti_Content,
+                                       MultiPictureDraw::kSimple_Layout);)
+    DEF_GM(return new MultiPictureDraw(MultiPictureDraw::kRRectClipMulti_Content,
+                                       MultiPictureDraw::kSimple_Layout);)
+    DEF_GM(return new MultiPictureDraw(MultiPictureDraw::kPathClipMulti_Content,
+                                       MultiPictureDraw::kSimple_Layout);)
+    DEF_GM(return new MultiPictureDraw(MultiPictureDraw::kInvPathClipMulti_Content,
+                                       MultiPictureDraw::kSimple_Layout);)
+    DEF_GM(return new MultiPictureDraw(MultiPictureDraw::kSierpinski_Content,
+                                       MultiPictureDraw::kSimple_Layout);)
+    DEF_GM(return new MultiPictureDraw(MultiPictureDraw::kBigLayer_Content,
+                                       MultiPictureDraw::kSimple_Layout);)
+
+    DEF_GM(return new MultiPictureDraw(MultiPictureDraw::kNoClipSingle_Content,
+                                       MultiPictureDraw::kTiled_Layout);)
+    DEF_GM(return new MultiPictureDraw(MultiPictureDraw::kRectClipMulti_Content,
+                                       MultiPictureDraw::kTiled_Layout);)
+    DEF_GM(return new MultiPictureDraw(MultiPictureDraw::kRRectClipMulti_Content,
+                                       MultiPictureDraw::kTiled_Layout);)
+    DEF_GM(return new MultiPictureDraw(MultiPictureDraw::kPathClipMulti_Content,
+                                       MultiPictureDraw::kTiled_Layout);)
+    DEF_GM(return new MultiPictureDraw(MultiPictureDraw::kInvPathClipMulti_Content,
+                                       MultiPictureDraw::kTiled_Layout);)
+    DEF_GM(return new MultiPictureDraw(MultiPictureDraw::kSierpinski_Content,
+                                       MultiPictureDraw::kTiled_Layout);)
+    DEF_GM(return new MultiPictureDraw(MultiPictureDraw::kBigLayer_Content,
+                                       MultiPictureDraw::kTiled_Layout);)
 }
index ea7954c..df3a84e 100644 (file)
@@ -154,6 +154,5 @@ private:
     typedef GM INHERITED;
 };
 
-DEF_GM(return SkNEW(SkPatchGM); )
-
+DEF_GM(return new SkPatchGM;)
 }
index 5c719bf..89a9847 100644 (file)
@@ -156,6 +156,5 @@ private:
     typedef GM INHERITED;
 };
 
-DEF_GM(return SkNEW(SkPatchGridGM); )
-
+DEF_GM(return new SkPatchGridGM;)
 }
index 37ec32f..b8c1678 100644 (file)
@@ -68,4 +68,4 @@ private:
     typedef skiagm::GM INHERITED;
 };
 
-DEF_GM( return SkNEW(PeekPixelsGM); )
+DEF_GM(return new PeekPixelsGM;)
index f1d2a79..175e0a7 100644 (file)
@@ -81,4 +81,4 @@ private:
     typedef skiagm::GM INHERITED;
 };
 
-DEF_GM( return SkNEW(PictureGM); )
+DEF_GM(return new PictureGM;)
index a978e67..9149ec1 100644 (file)
@@ -183,4 +183,4 @@ private:
     typedef skiagm::GM INHERITED;
 };
 
-DEF_GM( return SkNEW(PictureGeneratorGM); )
+DEF_GM(return new PictureGeneratorGM;)
index 3f719be..d28749a 100644 (file)
@@ -181,7 +181,7 @@ private:
     typedef GM INHERITED;
 };
 
-DEF_GM( return SkNEW_ARGS(PictureShaderGM, (50, 100)); )
+DEF_GM(return new PictureShaderGM(50, 100);)
 
 DEF_SIMPLE_GM(tiled_picture_shader, canvas, 400, 400) {
     // https://code.google.com/p/skia/issues/detail?id=3398
index 11d6b34..a84e233 100644 (file)
@@ -155,4 +155,4 @@ private:
     typedef GM INHERITED;
 };
 
-DEF_GM( return SkNEW(PictureShaderTileGM); )
+DEF_GM(return new PictureShaderTileGM;)
index ea85a94..5f1a745 100644 (file)
@@ -175,7 +175,7 @@ private:
 };
 
 //////////////////////////////////////////////////////////////////////////////
-DEF_GM( return SkNEW(PointSnapGM); )
-DEF_GM( return SkNEW(LineSnapGM); )
-DEF_GM( return SkNEW(RectSnapGM); )
-DEF_GM( return SkNEW(ComboSnapGM); )
+DEF_GM(return new PointSnapGM;)
+DEF_GM(return new LineSnapGM;)
+DEF_GM(return new RectSnapGM;)
+DEF_GM(return new ComboSnapGM;)
old mode 100755 (executable)
new mode 100644 (file)
index 2109b90..6c0df8d
@@ -50,6 +50,5 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(SmallArcGM); )
-
+DEF_GM(return new SmallArcGM;)
 }
index a7e404d..4e8eaff 100644 (file)
@@ -355,6 +355,5 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM(return SkNEW(StrokeFillGM);)
-
+DEF_GM(return new StrokeFillGM;)
 }
index 19ba844..57517a0 100644 (file)
@@ -407,4 +407,4 @@ static skiagm::GMRegistry R2(F2);
 static skiagm::GMRegistry R3(F3);
 static skiagm::GMRegistry R4(F4);
 
-DEF_GM( return SkNEW(ZeroLenStrokesGM); )
+DEF_GM( return new ZeroLenStrokesGM; )
index 6ec425b..75ce164 100644 (file)
@@ -98,4 +98,4 @@ private:
     typedef skiagm::GM INHERITED;
 };
 
-DEF_GM( return SkNEW(StrokeTextGM); )
+DEF_GM(return new StrokeTextGM;)
index 4581f10..dfd31a0 100644 (file)
@@ -103,5 +103,4 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM(return SkNEW(TallStretchedBitmapsGM);)
-
+DEF_GM(return new TallStretchedBitmapsGM;)
index cd5c12a..5020e7c 100644 (file)
@@ -186,4 +186,4 @@ private:
     typedef skiagm::GM INHERITED;
 };
 
-DEF_GM( return SkNEW_ARGS(TextBlobGM, ("hamburgefons")); )
+DEF_GM(return new TextBlobGM("hamburgefons");)
index 8b5413a..0e4e0ff 100644 (file)
@@ -97,5 +97,5 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(TextBlobColorTrans); )
+DEF_GM(return new TextBlobColorTrans;)
 }
index fec1ac0..bae2381 100644 (file)
@@ -77,5 +77,5 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(TextBlobGeometryChange); )
+DEF_GM(return new TextBlobGeometryChange;)
 }
index 337942c..dc4be0b 100644 (file)
@@ -255,5 +255,5 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(TextBlobLooperGM); )
+DEF_GM(return new TextBlobLooperGM;)
 }
index 9d91b61..a76c6f5 100644 (file)
@@ -184,8 +184,8 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW_ARGS(TextBlobMixedSizes, (false)); )
+DEF_GM( return new TextBlobMixedSizes(false); )
 #if SK_SUPPORT_GPU
-DEF_GM( return SkNEW_ARGS(TextBlobMixedSizes, (true)); )
+DEF_GM( return new TextBlobMixedSizes(true); )
 #endif
 }
index c1e754c..ada46ca 100644 (file)
@@ -44,7 +44,7 @@ protected:
         if (NULL == orig) {
             orig.reset(SkTypeface::RefDefault());
         }
-        SkAutoTUnref<SkTypeface> random(SkNEW_ARGS(SkRandomTypeface, (orig, paint, false)));
+        SkAutoTUnref<SkTypeface> random(new SkRandomTypeface(orig, paint, false));
         paint.setTypeface(random);
 
         SkRect bounds;
@@ -74,8 +74,7 @@ protected:
             const char* emojiText = sk_tool_utils::emoji_sample_text();
             paint.measureText(emojiText, strlen(emojiText), &bounds);
             offset += bounds.height();
-            SkAutoTUnref<SkTypeface> randomEmoji(SkNEW_ARGS(SkRandomTypeface, (orig, paint,
-                                                                               false)));
+            SkAutoTUnref<SkTypeface> randomEmoji(new SkRandomTypeface(orig, paint, false));
             paint.setTypeface(randomEmoji);
             sk_tool_utils::add_to_text_blob(&builder, emojiText, paint, 0, offset);
         }
@@ -149,6 +148,6 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(TextBlobRandomFont); )
+DEF_GM(return new TextBlobRandomFont;)
 }
 #endif
index 3b2a9a5..5c9372d 100644 (file)
@@ -109,4 +109,4 @@ private:
     typedef skiagm::GM INHERITED;
 };
 
-DEF_GM( return SkNEW_ARGS(TextBlobShaderGM, ("Blobber")); )
+DEF_GM(return new TextBlobShaderGM("Blobber");)
index 0813d87..eed1809 100644 (file)
@@ -168,5 +168,5 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(TextBlobTransforms); )
+DEF_GM(return new TextBlobTransforms;)
 }
index 3994c5d..363cd2f 100644 (file)
@@ -70,6 +70,6 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(TextBlobUseAfterGpuFree); )
+DEF_GM(return new TextBlobUseAfterGpuFree;)
 }
 #endif
index 07b7119..7c53467 100644 (file)
@@ -155,7 +155,7 @@ private:
 const SkScalar TextureDomainEffect::kDrawPad = 10.f;
 const SkScalar TextureDomainEffect::kTestPad = 10.f;
 
-DEF_GM( return SkNEW(TextureDomainEffect); )
+DEF_GM(return new TextureDomainEffect;)
 }
 
 #endif
index 8bde102..73e1f52 100644 (file)
@@ -73,6 +73,5 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(ThinStrokedRectsGM); )
-
+DEF_GM(return new ThinStrokedRectsGM;)
 }
index 79e1111..daecbb0 100644 (file)
@@ -79,6 +79,5 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM(return SkNEW(TiledScaledBitmapGM);)
-
+DEF_GM(return new TiledScaledBitmapGM;)
 }
index 9d0f95e..1ec0511 100644 (file)
@@ -121,6 +121,5 @@ private:
 
 //////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW(TileImageFilterGM); )
-
+DEF_GM(return new TileImageFilterGM;)
 }
index 887a7c3..83fe720 100644 (file)
@@ -160,7 +160,7 @@ private:
     typedef skiagm::GM INHERITED;
 };
 
-DEF_GM( return SkNEW(VariedTextGM(false, false)); )
-DEF_GM( return SkNEW(VariedTextGM(true, false)); )
-DEF_GM( return SkNEW(VariedTextGM(false, true)); )
-DEF_GM( return SkNEW(VariedTextGM(true, true)); )
+DEF_GM(return new VariedTextGM(false, false);)
+DEF_GM(return new VariedTextGM(true, false);)
+DEF_GM(return new VariedTextGM(false, true);)
+DEF_GM(return new VariedTextGM(true, true);)
index 2f7a9b9..9533d81 100644 (file)
@@ -123,5 +123,5 @@ private:
 
 /////////////////////////////////////////////////////////////////////////////////////
 
-DEF_GM( return SkNEW_ARGS(VerticesGM, (0xFF)); )
-DEF_GM( return SkNEW_ARGS(VerticesGM, (0x80)); )
+DEF_GM(return new VerticesGM(0xFF);)
+DEF_GM(return new VerticesGM(0x80);)
index 4ec86f4..7dbd24e 100644 (file)
@@ -140,7 +140,7 @@ private:
     typedef GM INHERITED;
 };
 
-DEF_GM( return SkNEW(YUVtoRGBEffect); )
+DEF_GM(return new YUVtoRGBEffect;)
 }
 
 #endif
index 62c844a..80503c7 100644 (file)
@@ -26,12 +26,10 @@ public:
     virtual ~SkAnnotation();
 
     static SkAnnotation* Create(const char key[], SkData* value) {
-        return SkNEW_ARGS(SkAnnotation, (key, value));
+        return new SkAnnotation(key, value);
     }
 
-    static SkAnnotation* Create(SkReadBuffer& buffer) {
-        return SkNEW_ARGS(SkAnnotation, (buffer));
-    }
+    static SkAnnotation* Create(SkReadBuffer& buffer) { return new SkAnnotation(buffer); }
 
     /**
      *  Return the data for the specified key, or NULL.
index f1e36e1..15953ef 100644 (file)
@@ -442,10 +442,8 @@ public:
 
 // This macro defines the global creation entry point for each decoder. Each
 // decoder implementation that registers with the decoder factory must call it.
-#define DEFINE_DECODER_CREATOR(codec)           \
-    SkImageDecoder *Create ## codec () {        \
-        return SkNEW( Sk ## codec );            \
-    }
+#define DEFINE_DECODER_CREATOR(codec) \
+    SkImageDecoder* Create##codec() { return new Sk##codec; }
 
 // All the decoders known by Skia. Note that, depending on the compiler settings,
 // not all of these will be available
index a9eecc4..fc999dc 100644 (file)
@@ -87,10 +87,8 @@ protected:
 
 // This macro defines the global creation entry point for each encoder. Each
 // encoder implementation that registers with the encoder factory must call it.
-#define DEFINE_ENCODER_CREATOR(codec)           \
-    SkImageEncoder *Create ## codec () {        \
-        return SkNEW( Sk ## codec );            \
-    }
+#define DEFINE_ENCODER_CREATOR(codec) \
+    SkImageEncoder* Create##codec() { return new Sk##codec; }
 
 // All the encoders known by Skia. Note that, depending on the compiler settings,
 // not all of these will be available
index 035a269..b0cd2ff 100644 (file)
  *  Example usage:
  *
  *  Foo* GetSingletonFoo() {
- *      SK_DECLARE_STATIC_LAZY_PTR(Foo, singleton);  // Created with SkNEW, destroyed with SkDELETE.
+ *      SK_DECLARE_STATIC_LAZY_PTR(Foo, singleton);  // Created with new, destroyed with delete.
  *      return singleton.get();
  *  }
  *
  *  These macros take an optional T* (*Create)() and void (*Destroy)(T*) at the end.
- *  If not given, we'll use SkNEW and SkDELETE.
+ *  If not given, we'll use new and delete.
  *  These options are most useful when T doesn't have a public constructor or destructor.
  *  Create comes first, so you may use a custom Create with a default Destroy, but not vice versa.
  *
@@ -86,8 +86,14 @@ static P try_cas(P* dst, P ptr) {
     }
 }
 
-template <typename T> T* sk_new() { return SkNEW(T); }
-template <typename T> void sk_delete(T* ptr) { SkDELETE(ptr); }
+template <typename T>
+T* sk_new() {
+    return new T;
+}
+template <typename T>
+void sk_delete(T* ptr) {
+    delete ptr;
+}
 
 // We're basing these implementations here on this article:
 //   http://preshing.com/20140709/the-purpose-of-memory_order_consume-in-cpp11/
@@ -128,7 +134,10 @@ private:
     T* fPtr;
 };
 
-template <typename T> T* sk_new_arg(int i) { return SkNEW_ARGS(T, (i)); }
+template <typename T>
+T* sk_new_arg(int i) {
+    return new T(i);
+}
 
 // This has no constructor and must be zero-initalized (the macro above does this).
 template <typename T, int N, T* (*Create)(int) = sk_new_arg<T>, void (*Destroy)(T*) = sk_delete<T> >
@@ -162,7 +171,7 @@ public:
 
     T* get() const {
         T* ptr = Private::consume_load(&fPtr);
-        return ptr ? ptr : Private::try_cas<T*, Destroy>(&fPtr, SkNEW(T));
+        return ptr ? ptr : Private::try_cas<T*, Destroy>(&fPtr, new T);
     }
 
     template <typename Create>
index 34d0dd7..72ea462 100644 (file)
@@ -185,7 +185,7 @@ public:
         and decremented in the destructor.
     */
     static SkComposePathEffect* Create(SkPathEffect* outer, SkPathEffect* inner) {
-        return SkNEW_ARGS(SkComposePathEffect, (outer, inner));
+        return new SkComposePathEffect(outer, inner);
     }
 
     virtual bool filterPath(SkPath* dst, const SkPath& src,
@@ -222,7 +222,7 @@ public:
         and decremented in the destructor.
     */
     static SkSumPathEffect* Create(SkPathEffect* first, SkPathEffect* second) {
-        return SkNEW_ARGS(SkSumPathEffect, (first, second));
+        return new SkSumPathEffect(first, second);
     }
 
     virtual bool filterPath(SkPath* dst, const SkPath& src,
index 0462540..5b83d0b 100644 (file)
@@ -109,7 +109,7 @@ private:
      */
     virtual void internal_dispose() const {
         this->internal_dispose_restore_refcnt_to_1();
-        SkDELETE(this);
+        delete this;
     }
 
     // The following friends are those which override internal_dispose()
@@ -242,8 +242,8 @@ public:
     void    ref() const { (void)sk_atomic_fetch_add(&fRefCnt, +1, sk_memory_order_relaxed); }
     void  unref() const {
         if (1 == sk_atomic_fetch_add(&fRefCnt, -1, sk_memory_order_acq_rel)) {
-            SkDEBUGCODE(fRefCnt = 1;)   // restore the 1 for our destructor's assert
-            SkDELETE((const Derived*)this);
+            SkDEBUGCODE(fRefCnt = 1;)  // restore the 1 for our destructor's assert
+                    delete (const Derived*)this;
         }
     }
     void  deref() const { this->unref(); }
index 9dc5880..d67956b 100644 (file)
@@ -32,18 +32,18 @@ inline void copyAndDelete(SkTArray<T, true>* self, char* newMemArray) {
 
 template<typename T>
 inline void copy(SkTArray<T, false>* self, int dst, int src) {
-    SkNEW_PLACEMENT_ARGS(&self->fItemArray[dst], T, (self->fItemArray[src]));
+    new (&self->fItemArray[dst]) T(self->fItemArray[src]);
 }
 template<typename T>
 inline void copy(SkTArray<T, false>* self, const T* array) {
     for (int i = 0; i < self->fCount; ++i) {
-        SkNEW_PLACEMENT_ARGS(self->fItemArray + i, T, (array[i]));
+        new (self->fItemArray + i) T(array[i]);
     }
 }
 template<typename T>
 inline void copyAndDelete(SkTArray<T, false>* self, char* newMemArray) {
     for (int i = 0; i < self->fCount; ++i) {
-        SkNEW_PLACEMENT_ARGS(newMemArray + sizeof(T) * i, T, (self->fItemArray[i]));
+        new (newMemArray + sizeof(T) * i) T(self->fItemArray[i]);
         self->fItemArray[i].~T();
     }
 }
@@ -135,7 +135,7 @@ public:
         this->checkRealloc(n);
         fCount = n;
         for (int i = 0; i < fCount; ++i) {
-            SkNEW_PLACEMENT(fItemArray + i, T);
+            new (fItemArray + i) T;
         }
     }
 
@@ -180,7 +180,7 @@ public:
      */
     T& push_back() {
         T* newT = reinterpret_cast<T*>(this->push_back_raw(1));
-        SkNEW_PLACEMENT(newT, T);
+        new (newT) T;
         return *newT;
     }
 
@@ -189,7 +189,7 @@ public:
      */
     T& push_back(const T& t) {
         T* newT = reinterpret_cast<T*>(this->push_back_raw(1));
-        SkNEW_PLACEMENT_ARGS(newT, T, (t));
+        new (newT) T(t);
         return *newT;
     }
 
@@ -202,7 +202,7 @@ public:
         SkASSERT(n >= 0);
         T* newTs = reinterpret_cast<T*>(this->push_back_raw(n));
         for (int i = 0; i < n; ++i) {
-            SkNEW_PLACEMENT(newTs + i, T);
+            new (newTs + i) T;
         }
         return newTs;
     }
@@ -215,7 +215,7 @@ public:
         SkASSERT(n >= 0);
         T* newTs = reinterpret_cast<T*>(this->push_back_raw(n));
         for (int i = 0; i < n; ++i) {
-            SkNEW_PLACEMENT_ARGS(newTs[i], T, (t));
+            new (newTs[i]) T(t);
         }
         return newTs;
     }
@@ -228,7 +228,7 @@ public:
         SkASSERT(n >= 0);
         this->checkRealloc(n);
         for (int i = 0; i < n; ++i) {
-            SkNEW_PLACEMENT_ARGS(fItemArray + fCount + i, T, (t[i]));
+            new (fItemArray + fCount + i) T(t[i]);
         }
         fCount += n;
         return fItemArray + fCount - n;
index 337b6fd..26c6c7f 100644 (file)
@@ -274,7 +274,7 @@ public:
         T*  iter = fArray;
         T*  stop = fArray + fCount;
         while (iter < stop) {
-            SkDELETE (*iter);
+            delete *iter;
             iter += 1;
         }
         this->reset();
index 863b8ab..f6f30e6 100644 (file)
@@ -263,7 +263,7 @@ public:
     public:
         virtual ~LocalizedStrings() { }
         virtual bool next(LocalizedString* localizedString) = 0;
-        void unref() { SkDELETE(this); }
+        void unref() { delete this; }
     };
     /**
      *  Returns an iterator which will attempt to enumerate all of the
index 6b3ec6d..6a7804f 100644 (file)
@@ -58,7 +58,7 @@ public:
     */
     static SkPath1DPathEffect* Create(const SkPath& path, SkScalar advance, SkScalar phase,
                                       Style style) {
-        return SkNEW_ARGS(SkPath1DPathEffect, (path, advance, phase, style));
+        return new SkPath1DPathEffect(path, advance, phase, style);
     }
 
     virtual bool filterPath(SkPath*, const SkPath&,
index 7fbf94b..fa12dcf 100644 (file)
@@ -56,7 +56,7 @@ private:
 class SK_API SkLine2DPathEffect : public Sk2DPathEffect {
 public:
     static SkLine2DPathEffect* Create(SkScalar width, const SkMatrix& matrix) {
-        return SkNEW_ARGS(SkLine2DPathEffect, (width, matrix));
+        return new SkLine2DPathEffect(width, matrix);
     }
 
     virtual bool filterPath(SkPath* dst, const SkPath& src,
@@ -85,7 +85,7 @@ public:
      *  the latice.
      */
     static SkPath2DPathEffect* Create(const SkMatrix& matrix, const SkPath& path) {
-        return SkNEW_ARGS(SkPath2DPathEffect, (matrix, path));
+        return new SkPath2DPathEffect(matrix, path);
     }
 
     SK_TO_STRING_OVERRIDE()
index 6ae7e36..4716ea1 100644 (file)
@@ -19,7 +19,7 @@ public:
         if (radius <= 0) {
             return NULL;
         }
-        return SkNEW_ARGS(SkArcToPathEffect, (radius));
+        return new SkArcToPathEffect(radius);
     }
 
     bool filterPath(SkPath* dst, const SkPath& src, SkStrokeRec*, const SkRect*) const override;
index e4281c9..38b1302 100644 (file)
 
 class SK_API SkBitmapSource : public SkImageFilter {
 public:
-    static SkBitmapSource* Create(const SkBitmap& bitmap) {
-        return SkNEW_ARGS(SkBitmapSource, (bitmap));
-    }
+    static SkBitmapSource* Create(const SkBitmap& bitmap) { return new SkBitmapSource(bitmap); }
     static SkBitmapSource* Create(const SkBitmap& bitmap,
                                   const SkRect& srcRect, const SkRect& dstRect,
                                   SkFilterQuality filterQuality = kHigh_SkFilterQuality) {
-        return SkNEW_ARGS(SkBitmapSource, (bitmap, srcRect, dstRect, filterQuality));
+        return new SkBitmapSource(bitmap, srcRect, dstRect, filterQuality);
     }
     void computeFastBounds(const SkRect& src, SkRect* dst) const override;
 
index 26bcd52..808557b 100644 (file)
@@ -37,7 +37,7 @@ public:
 
     static SkBlurDrawLooper* Create(SkColor color, SkScalar sigma, SkScalar dx, SkScalar dy,
                                     uint32_t flags = kNone_BlurFlag) {
-        return SkNEW_ARGS(SkBlurDrawLooper, (color, sigma, dx, dy, flags));
+        return new SkBlurDrawLooper(color, sigma, dx, dy, flags);
     }
 
     virtual ~SkBlurDrawLooper();
index ec29c8e..b0bd309 100644 (file)
@@ -17,7 +17,7 @@ public:
                                      SkScalar sigmaY,
                                      SkImageFilter* input = NULL,
                                      const CropRect* cropRect = NULL) {
-        return SkNEW_ARGS(SkBlurImageFilter, (sigmaX, sigmaY, input, cropRect));
+        return new SkBlurImageFilter(sigmaX, sigmaY, input, cropRect);
     }
 
     void computeFastBounds(const SkRect&, SkRect*) const override;
index a129654..9f16643 100644 (file)
 class SK_API SkColorMatrixFilter : public SkColorFilter {
 public:
     static SkColorMatrixFilter* Create(const SkColorMatrix& cm) {
-        return SkNEW_ARGS(SkColorMatrixFilter, (cm));
+        return new SkColorMatrixFilter(cm);
     }
     static SkColorMatrixFilter* Create(const SkScalar array[20]) {
-        return SkNEW_ARGS(SkColorMatrixFilter, (array));
+        return new SkColorMatrixFilter(array);
     }
 
     void filterSpan(const SkPMColor src[], int count, SkPMColor[]) const override;
index e3dc1ff..4946fa1 100644 (file)
@@ -22,7 +22,7 @@ public:
             return SkRef(outer);
         }
         SkImageFilter* inputs[2] = { outer, inner };
-        return SkNEW_ARGS(SkComposeImageFilter, (inputs));
+        return new SkComposeImageFilter(inputs);
     }
     void computeFastBounds(const SkRect& src, SkRect* dst) const override;
 
index 1935790..4c89085 100644 (file)
@@ -20,9 +20,7 @@ public:
     /** radius must be > 0 to have an effect. It specifies the distance from each corner
         that should be "rounded".
     */
-    static SkCornerPathEffect* Create(SkScalar radius) {
-        return SkNEW_ARGS(SkCornerPathEffect, (radius));
-    }
+    static SkCornerPathEffect* Create(SkScalar radius) { return new SkCornerPathEffect(radius); }
     virtual ~SkCornerPathEffect();
 
     virtual bool filterPath(SkPath* dst, const SkPath& src,
index 0fd00d7..d3adeed 100644 (file)
@@ -38,7 +38,7 @@ public:
     */
     static SkDashPathEffect* Create(const SkScalar intervals[], int count,
                                     SkScalar phase) {
-        return SkNEW_ARGS(SkDashPathEffect, (intervals, count, phase));
+        return new SkDashPathEffect(intervals, count, phase);
     }
     virtual ~SkDashPathEffect();
 
index d05d181..b55dca8 100644 (file)
@@ -32,8 +32,7 @@ public:
     static SkDiscretePathEffect* Create(SkScalar segLength,
                                         SkScalar deviation,
                                         uint32_t seedAssist=0) {
-        return SkNEW_ARGS(SkDiscretePathEffect,
-                          (segLength, deviation, seedAssist));
+        return new SkDiscretePathEffect(segLength, deviation, seedAssist);
     }
 
     virtual bool filterPath(SkPath* dst, const SkPath& src,
index 3ff3d80..964a576 100644 (file)
@@ -25,8 +25,8 @@ public:
                                            ShadowMode shadowMode,
                                            SkImageFilter* input = NULL,
                                            const CropRect* cropRect = NULL) {
-        return SkNEW_ARGS(SkDropShadowImageFilter, (dx, dy, sigmaX, sigmaY, color,
-                                                    shadowMode, input, cropRect));
+        return new SkDropShadowImageFilter(dx, dy, sigmaX, sigmaY, color, shadowMode, input,
+                                           cropRect);
     }
 
     void computeFastBounds(const SkRect&, SkRect*) const override;
index 5bb6826..714a755 100644 (file)
@@ -21,12 +21,12 @@ public:
                                       const CropRect* cropRect = NULL) {
         SkImageFilter* inputs[2] = { first, second };
         SkXfermode::Mode modes[2] = { mode, mode };
-        return SkNEW_ARGS(SkMergeImageFilter, (inputs, 2, modes, cropRect));
+        return new SkMergeImageFilter(inputs, 2, modes, cropRect);
     }
     static SkMergeImageFilter* Create(SkImageFilter* filters[], int count,
                                       const SkXfermode::Mode modes[] = NULL,
                                       const CropRect* cropRect = NULL) {
-        return SkNEW_ARGS(SkMergeImageFilter, (filters, count, modes, cropRect));
+        return new SkMergeImageFilter(filters, count, modes, cropRect);
     }
 
     SK_TO_STRING_OVERRIDE()
index 3a24225..8d17609 100644 (file)
@@ -57,7 +57,7 @@ public:
         if (radiusX < 0 || radiusY < 0) {
             return NULL;
         }
-        return SkNEW_ARGS(SkDilateImageFilter, (radiusX, radiusY, input, cropRect));
+        return new SkDilateImageFilter(radiusX, radiusY, input, cropRect);
     }
 
     bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
@@ -85,7 +85,7 @@ public:
         if (radiusX < 0 || radiusY < 0) {
             return NULL;
         }
-        return SkNEW_ARGS(SkErodeImageFilter, (radiusX, radiusY, input, cropRect));
+        return new SkErodeImageFilter(radiusX, radiusY, input, cropRect);
     }
 
     bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
index 17c9627..30e380d 100644 (file)
@@ -20,7 +20,7 @@ public:
         if (!SkScalarIsFinite(dx) || !SkScalarIsFinite(dy)) {
             return NULL;
         }
-        return SkNEW_ARGS(SkOffsetImageFilter, (dx, dy, input, cropRect));
+        return new SkOffsetImageFilter(dx, dy, input, cropRect);
     }
     void computeFastBounds(const SkRect& src, SkRect* dst) const override;
     SK_TO_STRING_OVERRIDE()
index 731e11e..231a492 100644 (file)
@@ -17,7 +17,7 @@ public:
      *  Refs the passed-in picture.
      */
     static SkPictureImageFilter* Create(const SkPicture* picture) {
-        return SkNEW_ARGS(SkPictureImageFilter, (picture));
+        return new SkPictureImageFilter(picture);
     }
 
     /**
@@ -25,9 +25,8 @@ public:
      *  the picture is drawn. (No scaling is implied by the dest rect; only the CTM is applied.)
      */
     static SkPictureImageFilter* Create(const SkPicture* picture, const SkRect& cropRect) {
-        return SkNEW_ARGS(SkPictureImageFilter, (picture, cropRect,
-                                                 kDeviceSpace_PictureResolution,
-                                                 kLow_SkFilterQuality));
+        return new SkPictureImageFilter(picture, cropRect, kDeviceSpace_PictureResolution,
+                                        kLow_SkFilterQuality);
     }
 
     /**
@@ -40,8 +39,8 @@ public:
     static SkPictureImageFilter* CreateForLocalSpace(const SkPicture* picture,
                                                      const SkRect& cropRect,
                                                      SkFilterQuality filterQuality) {
-        return SkNEW_ARGS(SkPictureImageFilter, (picture, cropRect,
-                                                 kLocalSpace_PictureResolution, filterQuality));
+        return new SkPictureImageFilter(picture, cropRect, kLocalSpace_PictureResolution,
+                                        filterQuality);
     }
     SK_TO_STRING_OVERRIDE()
     SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPictureImageFilter)
index 3e6fa84..8b7f338 100644 (file)
@@ -17,9 +17,7 @@
 */
 class SK_API SkPixelXorXfermode : public SkXfermode {
 public:
-    static SkPixelXorXfermode* Create(SkColor opColor) {
-        return SkNEW_ARGS(SkPixelXorXfermode, (opColor));
-    }
+    static SkPixelXorXfermode* Create(SkColor opColor) { return new SkPixelXorXfermode(opColor); }
 
     SK_TO_STRING_OVERRIDE()
     SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPixelXorXfermode)
index 6084ec4..1d53087 100644 (file)
@@ -30,19 +30,19 @@ public:
     static void MakeClipTable(uint8_t table[256], uint8_t min, uint8_t max);
 
     static SkTableMaskFilter* Create(const uint8_t table[256]) {
-        return SkNEW_ARGS(SkTableMaskFilter, (table));
+        return new SkTableMaskFilter(table);
     }
 
     static SkTableMaskFilter* CreateGamma(SkScalar gamma) {
         uint8_t table[256];
         MakeGammaTable(table, gamma);
-        return SkNEW_ARGS(SkTableMaskFilter, (table));
+        return new SkTableMaskFilter(table);
     }
 
     static SkTableMaskFilter* CreateClip(uint8_t min, uint8_t max) {
         uint8_t table[256];
         MakeClipTable(table, min, max);
-        return SkNEW_ARGS(SkTableMaskFilter, (table));
+        return new SkTableMaskFilter(table);
     }
 
     SkMask::Format getFormat() const override;
index 233d7b2..4fa0c43 100644 (file)
@@ -22,7 +22,7 @@ public:
         if (scale > SK_Scalar1 || scale <= 0) {
             return NULL;
         }
-        return SkNEW_ARGS(SkDownSampleImageFilter, (scale, input));
+        return new SkDownSampleImageFilter(scale, input);
     }
 
     SK_TO_STRING_OVERRIDE()
index 30a3a5c..57fd288 100644 (file)
@@ -27,7 +27,7 @@ public:
                                          SkImageFilter* foreground = NULL,
                                          const CropRect* cropRect = NULL) {
         SkImageFilter* inputs[2] = { background, foreground };
-        return SkNEW_ARGS(SkXfermodeImageFilter, (mode, inputs, cropRect));
+        return new SkXfermodeImageFilter(mode, inputs, cropRect);
     }
 
     SK_TO_STRING_OVERRIDE()
index e4b2b09..e11ccc7 100644 (file)
@@ -126,7 +126,7 @@ public:
         fCoverageStages = paint.fCoverageStages;
 
         fXPFactory.reset(SkRef(paint.getXPFactory()));
-        fProcDataManager.reset(SkNEW_ARGS(GrProcessorDataManager, (*paint.processorDataManager())));
+        fProcDataManager.reset(new GrProcessorDataManager(*paint.processorDataManager()));
 
         return *this;
     }
index 2d834de..e788486 100644 (file)
@@ -45,7 +45,7 @@ public:
         --fRefCnt;
         if (0 == fRefCnt) {
             if (0 == fPendingExecutions) {
-                SkDELETE(this);
+                delete this;
                 return;
             } else {
                 this->removeRefs();
@@ -96,7 +96,7 @@ private:
         --fPendingExecutions;
         if (0 == fPendingExecutions) {
             if (0 == fRefCnt) {
-                SkDELETE(this);
+                delete this;
                 return;
             } else {
                 this->pendingIOComplete();
index 505c1b3..ccd2868 100644 (file)
@@ -29,7 +29,7 @@ public:
     static const int kInputModeCnt = kLastInputMode + 1;
 
     static GrFragmentProcessor* Create(GrColor color, InputMode mode) {
-        return SkNEW_ARGS(GrConstColorProcessor, (color, mode));
+        return new GrConstColorProcessor(color, mode);
     }
 
     ~GrConstColorProcessor() override {}
index 89adadf..6a8557b 100644 (file)
@@ -21,7 +21,7 @@ struct GrGLInterface;
  */
 class SK_API GrGLExtensions {
 public:
-    GrGLExtensions() : fInitialized(false), fStrings(SkNEW(SkTArray<SkString>)) {}
+    GrGLExtensions() : fInitialized(false), fStrings(new SkTArray<SkString>) {}
 
     GrGLExtensions(const GrGLExtensions&);
 
index 8850cd0..6590c76 100644 (file)
@@ -20,9 +20,9 @@ public:
         if (kGL_GrGLStandard == forcedGpuAPI) {
             return NULL;
         }
-        SkANGLEGLContext* ctx = SkNEW(SkANGLEGLContext);
+        SkANGLEGLContext* ctx = new SkANGLEGLContext;
         if (!ctx->isValid()) {
-            SkDELETE(ctx);
+            delete ctx;
             return NULL;
         }
         return ctx;
index 024ba7c..1b99030 100644 (file)
@@ -21,9 +21,10 @@ public:
     SkFunction() {}
 
     template <typename Fn>
-    SkFunction(const Fn& fn) : fFunction(SkNEW_ARGS(LambdaImpl<Fn>, (fn))) {}
+    SkFunction(const Fn& fn)
+        : fFunction(new LambdaImpl<Fn>(fn)) {}
 
-    SkFunction(R (*fn)(Args...)) : fFunction(SkNEW_ARGS(FnPtrImpl, (fn))) {}
+    SkFunction(R (*fn)(Args...)) : fFunction(new FnPtrImpl(fn)) {}
 
     SkFunction(const SkFunction& other) { *this = other; }
     SkFunction& operator=(const SkFunction& other) {
@@ -51,7 +52,8 @@ private:
         LambdaImpl(const Fn& fn) : fFn(fn) {}
 
         R call(Args... args) const override { return fFn(skstd::forward<Args>(args)...); }
-        Interface* clone() const override { return SkNEW_ARGS(LambdaImpl<Fn>, (fFn)); }
+        Interface* clone() const override { return new LambdaImpl<Fn>(fFn); }
+
     private:
         Fn fFn;
     };
@@ -61,7 +63,8 @@ private:
         FnPtrImpl(R (*fn)(Args...)) : fFn(fn) {}
 
         R call(Args... args) const override { return fFn(skstd::forward<Args>(args)...); }
-        Interface* clone() const override { return SkNEW_ARGS(FnPtrImpl, (fFn)); }
+        Interface* clone() const override { return new FnPtrImpl(fFn); }
+
     private:
         R (*fFn)(Args...);
     };
index 561fc89..53d5275 100644 (file)
@@ -29,7 +29,7 @@ public:
     // Clear the table.
     void reset() {
         this->~SkTHashTable();
-        SkNEW_PLACEMENT(this, SkTHashTable);
+        new (this) SkTHashTable;
     }
 
     // How many entries are in the table?
index afab0ef..1cbc4f1 100644 (file)
@@ -138,7 +138,7 @@ private:
 template <typename T> class SkAutoTDelete : SkNoncopyable {
 public:
     SkAutoTDelete(T* obj = NULL) : fObj(obj) {}
-    ~SkAutoTDelete() { SkDELETE(fObj); }
+    ~SkAutoTDelete() { delete fObj; }
 
     T* get() const { return fObj; }
     operator T*() const { return fObj; }
@@ -147,7 +147,7 @@ public:
 
     void reset(T* obj) {
         if (fObj != obj) {
-            SkDELETE(fObj);
+            delete fObj;
             fObj = obj;
         }
     }
@@ -156,7 +156,7 @@ public:
      *  Delete the owned object, setting the internal pointer to NULL.
      */
     void free() {
-        SkDELETE(fObj);
+        delete fObj;
         fObj = NULL;
     }
 
@@ -200,15 +200,18 @@ private:
 template <typename T> class SkAutoTDeleteArray : SkNoncopyable {
 public:
     SkAutoTDeleteArray(T array[]) : fArray(array) {}
-    ~SkAutoTDeleteArray() { SkDELETE_ARRAY(fArray); }
+    ~SkAutoTDeleteArray() { delete[] fArray; }
 
     T*      get() const { return fArray; }
-    void    free() { SkDELETE_ARRAY(fArray); fArray = NULL; }
+    void free() {
+        delete[] fArray;
+        fArray = NULL;
+    }
     T*      detach() { T* array = fArray; fArray = NULL; return array; }
 
     void reset(T array[]) {
         if (fArray != array) {
-            SkDELETE_ARRAY(fArray);
+            delete[] fArray;
             fArray = array;
         }
     }
@@ -231,7 +234,7 @@ public:
         SkASSERT(count >= 0);
         fArray = NULL;
         if (count) {
-            fArray = SkNEW_ARRAY(T, count);
+            fArray = new T[count];
         }
         SkDEBUGCODE(fCount = count;)
     }
@@ -239,18 +242,16 @@ public:
     /** Reallocates given a new count. Reallocation occurs even if new count equals old count.
      */
     void reset(int count) {
-        SkDELETE_ARRAY(fArray);
+        delete[] fArray;
         SkASSERT(count >= 0);
         fArray = NULL;
         if (count) {
-            fArray = SkNEW_ARRAY(T, count);
+            fArray = new T[count];
         }
         SkDEBUGCODE(fCount = count;)
     }
 
-    ~SkAutoTArray() {
-        SkDELETE_ARRAY(fArray);
-    }
+    ~SkAutoTArray() { delete[] fArray; }
 
     /** Return the array of T elements. Will be NULL if count == 0
      */
@@ -329,7 +330,7 @@ public:
         iter = fArray;
         T* stop = fArray + count;
         while (iter < stop) {
-            SkNEW_PLACEMENT(iter++, T);
+            new (iter++) T;
         }
     }
 
@@ -499,7 +500,7 @@ template <typename T> void SkInPlaceDeleteCheck(T* obj, void* storage) {
     if (storage == obj) {
         obj->~T();
     } else {
-        SkDELETE(obj);
+        delete obj;
     }
 }
 
@@ -512,12 +513,12 @@ template <typename T> void SkInPlaceDeleteCheck(T* obj, void* storage) {
  *      SkInPlaceDeleteCheck(obj, storage);
  */
 template <typename T> T* SkInPlaceNewCheck(void* storage, size_t size) {
-    return (sizeof(T) <= size) ? new (storage) T : SkNEW(T);
+    return (sizeof(T) <= size) ? new (storage) T : new T;
 }
 
 template <typename T, typename A1, typename A2, typename A3>
 T* SkInPlaceNewCheck(void* storage, size_t size, const A1& a1, const A2& a2, const A3& a3) {
-    return (sizeof(T) <= size) ? new (storage) T(a1, a2, a3) : SkNEW_ARGS(T, (a1, a2, a3));
+    return (sizeof(T) <= size) ? new (storage) T(a1, a2, a3) : new T(a1, a2, a3);
 }
 
 /**
index 2ea6b76..ba78c3f 100644 (file)
@@ -124,7 +124,7 @@ void android_main(struct android_app* state) {
         }
 
         if (kDestroyRequested_State == visualBenchState.fState) {
-            SkDELETE(visualBenchState.fWindow);
+            delete visualBenchState.fWindow;
             visualBenchState.fWindow = NULL;
             application_term();
             ANativeActivity_finish(state->activity);
index 4717c30..9a1f8f9 100644 (file)
@@ -104,7 +104,7 @@ private:
 SkFlattenable* Dot2DPathEffect::CreateProc(SkReadBuffer& buffer) {
     SkMatrix matrix;
     buffer.readMatrix(&matrix);
-    return SkNEW_ARGS(Dot2DPathEffect, (buffer.readScalar(), matrix, NULL));
+    return new Dot2DPathEffect(buffer.readScalar(), matrix, NULL);
 }
 
 class InverseFillPE : public SkPathEffect {
@@ -129,9 +129,7 @@ private:
     typedef SkPathEffect INHERITED;
 };
 
-SkFlattenable* InverseFillPE::CreateProc(SkReadBuffer& buffer) {
-    return SkNEW(InverseFillPE);
-}
+SkFlattenable* InverseFillPE::CreateProc(SkReadBuffer& buffer) { return new InverseFillPE; }
 
 static SkPathEffect* makepe(float interp, SkTDArray<SkPoint>* pts) {
     SkMatrix    lattice;
index e74612b..24c94cb 100644 (file)
@@ -14,7 +14,7 @@ GMSampleView::~GMSampleView() {
 }
 
 SkEvent* GMSampleView::NewShowSizeEvt(bool doShowSize) {
-    SkEvent* evt = SkNEW_ARGS(SkEvent, ("GMSampleView::showSize"));
+    SkEvent* evt = new SkEvent("GMSampleView::showSize");
     evt->setFast32(doShowSize);
     return evt;
 }
index bdb8ddd..9e229ff 100644 (file)
@@ -119,7 +119,7 @@ private:
 };
 
 SkView* create_overview(int count, const SkViewFactory* factories[]) {
-    return SkNEW_ARGS(OverView, (count, factories));
+    return new OverView(count, factories);
 }
 
 bool is_overview(SkView* view) {
index 1d4bd1e..d2f10b3 100644 (file)
@@ -1275,9 +1275,8 @@ SkCanvas* SampleWindow::beforeChildren(SkCanvas* canvas) {
         fSubpixelState != SkOSMenu::kMixedState ||
         fHintingState > 0 ||
         fFilterQualityIndex > 0) {
-
-        canvas = SkNEW_ARGS(FlagsFilterCanvas, (canvas, fLCDState, fAAState, fSubpixelState,
-                                                fHintingState, fFilterQualityIndex));
+        canvas = new FlagsFilterCanvas(canvas, fLCDState, fAAState, fSubpixelState, fHintingState,
+                                       fFilterQualityIndex);
         fFlagsFilterCanvas.reset(canvas);
     }
 
@@ -1671,10 +1670,10 @@ bool SampleWindow::onHandleChar(SkUnichar uni) {
             }
             break;
         case 'B':
-            post_event_to_sink(SkNEW_ARGS(SkEvent, ("PictFileView::toggleBBox")), curr_view(this));
+            post_event_to_sink(new SkEvent("PictFileView::toggleBBox"), curr_view(this));
             // Cannot call updateTitle() synchronously, because the toggleBBox event is still in
             // the queue.
-            post_event_to_sink(SkNEW_ARGS(SkEvent, (gUpdateWindowTitleEvtName)), this);
+            post_event_to_sink(new SkEvent(gUpdateWindowTitleEvtName), this);
             this->inval(NULL);
             break;
         case 'D':
index 842e7a0..90fbb78 100644 (file)
@@ -92,7 +92,7 @@ public:
 
         fRect.set(0, 0, SkIntToScalar(200), SkIntToScalar(200));
         fRect.offset(SkIntToScalar(20), SkIntToScalar(20));
-        fAnimatingDrawable = SkNEW_ARGS(MyDrawable, (fRect));
+        fAnimatingDrawable = new MyDrawable(fRect);
 
         SkPictureRecorder recorder;
         this->drawRoot(recorder.beginRecording(SkRect::MakeWH(800, 500)));
index 20648cc..7b45250 100644 (file)
@@ -61,8 +61,8 @@ public:
     void spawnAnimation(SkMSec now) {
         this->setTime(now);
 
-        SkDELETE(fInterp);
-        fInterp = SkNEW_ARGS(SkInterpolator, (5, 3));
+        delete fInterp;
+        fInterp = new SkInterpolator(5, 3);
         SkScalar values[5];
         color_to_floats(fColor, values); values[4] = 0;
         fInterp->setKeyFrame(0, now, values);
@@ -101,7 +101,7 @@ public:
 
             switch (res) {
                 case SkInterpolator::kFreezeEnd_Result:
-                    SkDELETE(fInterp);
+                    delete fInterp;
                     fInterp = NULL;
                     break;
                 default:
index 3302d27..7a329de 100644 (file)
@@ -33,7 +33,7 @@ public:
       if (codec) {
           stream.rewind();
           codec->decode(&stream, &fBM, kN32_SkColorType, SkImageDecoder::kDecodePixels_Mode);
-          SkDELETE(codec);
+          delete codec;
       } else {
           fBM.allocN32Pixels(1, 1);
           *(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad
index 8865f1a..5fc9ab0 100644 (file)
@@ -41,9 +41,7 @@ class LuaView : public SampleView {
 public:
     LuaView() : fLua(NULL) {}
 
-    virtual ~LuaView() {
-        SkDELETE(fLua);
-    }
+    virtual ~LuaView() { delete fLua; }
 
     void setImageFilename(lua_State* L) {
         SkString str = GetResourcePath("mandrill_256.png");
@@ -59,7 +57,7 @@ public:
 
     lua_State* ensureLua() {
         if (NULL == fLua) {
-            fLua = SkNEW(SkLua);
+            fLua = new SkLua;
 
             SkString str = GetResourcePath(LUA_FILENAME);
             SkData* data = SkData::NewFromFileName(str.c_str());
index 6faea55..747f729 100644 (file)
@@ -5,6 +5,8 @@
  * found in the LICENSE file.
  */
 
+#include "SkTypes.h"
+
 #ifdef SAMPLE_PDF_FILE_VIEWER
 
 #include "SampleCode.h"
@@ -40,7 +42,7 @@ private:
             return NULL;
         }
 
-        SkPicture* pic = SkNEW(SkPicture);
+        SkPicture* pic = new SkPicture;
         SkCanvas* canvas = pic->beginRecording((int) renderer->MediaBox(0).width(),
                                                (int) renderer->MediaBox(0).height());
         renderer->renderPage(0, canvas, renderer->MediaBox(0));
index c0973a5..dd315f8 100644 (file)
@@ -194,7 +194,7 @@ private:
             // no bbox playback necessary
             return pic.detach();
         case kRTree_BBoxType:
-            factory.reset(SkNEW(SkRTreeFactory));
+            factory.reset(new SkRTreeFactory);
             break;
         default:
             SkASSERT(false);
index 0299363..0f7639e 100644 (file)
@@ -35,7 +35,7 @@ public:
       if (codec) {
           stream.rewind();
           codec->decode(&stream, &fBM, kN32_SkColorType, SkImageDecoder::kDecodePixels_Mode);
-          SkDELETE(codec);
+          delete codec;
       } else {
           fBM.allocN32Pixels(1, 1);
           *(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad
index 177a58b..ec556d9 100644 (file)
@@ -385,23 +385,6 @@ Method calls within method calls should be prefixed with dereference of the
 <!--?prettify?-->
 ~~~~
 this->method();
-Memory Management
-~~~~
-
-All memory allocation should be routed through SkNEW and its variants. These are
-#defined in SkPostConfig.h, but the correct way to get access to the config
-system is to #include SkTypes.h, which will allow external users of the library
-to provide a custom memory manager or other adaptations.
-
-<!--?prettify?-->
-~~~~
-SkNEW(type_name)
-SkNEW_ARGS(type_name, args)
-SkNEW_ARRAY(type_name, count)
-SkNEW_PLACEMENT(buf, type_name)
-SkNEW_PLACEMENT_ARGS(buf, type_name, args)
-SkDELETE(obj)
-SkDELETE_ARRAY(array)
 ~~~~
 
 Comparisons
index eacd1cc..bb29652 100644 (file)
@@ -202,7 +202,7 @@ The (*still experimental*) SkSVG canvas writes into an SVG document.
                void(*draw)(SkCanvas*),
                const char* path) {
         SkFILEWStream svgStream(path);
-        SkAutoTDelete<SkXMLWriter> xmlWriter(SkNEW_ARGS(SkXMLStreamWriter, (&svgStream)));
+        SkAutoTDelete<SkXMLWriter> xmlWriter(new SkXMLStreamWriter(&svgStream));
         SkAutoTUnref<SkCanvas> svgCanvas(SkSVGCanvas::Create(
                 SkRect::MakeWH(SkIntToScalar(src.size().width()),
                                SkIntToScalar(src.size().height())),
index 697c077..8d8c268 100644 (file)
@@ -31,7 +31,7 @@ void SkActive::init()
     fState.setCount(animators);
     int index;
     for (index = 0; index < animators; index++)
-        fInterpolators[index] = SkNEW(SkOperandInterpolator);
+        fInterpolators[index] = new SkOperandInterpolator;
     initState(&fApply, 0);
 //  for (index = 0; index < animators; index++)
 //      fState[index].bumpSave();
@@ -65,7 +65,7 @@ void SkActive::append(SkApply* apply) {
     fInterpolators.setCount(total);
     memset(&fInterpolators.begin()[oldCount], 0, newCount * sizeof(SkOperandInterpolator*));
     for (index = oldCount; index < total; index++)
-        fInterpolators[index] = SkNEW(SkOperandInterpolator);
+        fInterpolators[index] = new SkOperandInterpolator;
     fAnimators.setCount(total);
     memcpy(&fAnimators[oldCount], animates.begin(), sizeof(fAnimators[0]) *
         newCount);
index ec06a9e..6679a92 100644 (file)
@@ -67,7 +67,7 @@ void SkSet::onEndElement(SkAnimateMaker& maker) {
         fValues.setType(outType);
         fValues.setCount(comps);
         if (outType == SkType_String || outType == SkType_DynamicString)
-            fValues[0].fString = SkNEW(SkString);
+            fValues[0].fString = new SkString;
         else
             memset(fValues.begin(), 0, fValues.count() * sizeof(fValues.begin()[0]));
     } else {
index f2b7780..97f55af 100644 (file)
@@ -46,9 +46,7 @@ SkAnimator::SkAnimator() : fMaker(NULL) {
     initialize();
 }
 
-SkAnimator::~SkAnimator() {
-    SkDELETE(fMaker);
-}
+SkAnimator::~SkAnimator() { delete fMaker; }
 
 void SkAnimator::addExtras(SkExtras* extras) {
     *fMaker->fExtras.append() = extras;
@@ -386,8 +384,8 @@ const char* SkAnimator::getURIBase() {
 }
 
 void SkAnimator::initialize() {
-    SkDELETE(fMaker);
-    fMaker = SkNEW_ARGS(SkAnimateMaker, (this, NULL, NULL));
+    delete fMaker;
+    fMaker = new SkAnimateMaker(this, NULL, NULL);
     decodeMemory(gMathPrimer, sizeof(gMathPrimer)-1);
 #ifdef SK_BUILD_FOR_ANDROID
     InitializeSkExtraPathEffects(this);
index f4ea518..051dc0d 100644 (file)
@@ -462,13 +462,13 @@ bool SkAnimatorScript::Unbox(void* m, SkScriptValue* scriptValue) {
             } break;
         case SkType_String: {
             SkDisplayString* boxedValue = (SkDisplayString*) displayable;
-            scriptValue->fOperand.fString = SkNEW_ARGS(SkString, (boxedValue->value));
+            scriptValue->fOperand.fString = new SkString(boxedValue->value);
             } break;
         default: {
             const char* id = NULL;
             SkDEBUGCODE(bool success = ) maker->findKey(displayable, &id);
             SkASSERT(success);
-            scriptValue->fOperand.fString = SkNEW_ARGS(SkString, (id));
+            scriptValue->fOperand.fString = new SkString(id);
             type = SkType_String;
         }
     }
index 28912fb..700027a 100644 (file)
@@ -329,13 +329,13 @@ public:
                 } break;
             case SkType_String: {
                 SkDisplayString* boxedValue = (SkDisplayString*) displayable;
-                operand->fString = SkNEW_ARGS(SkString, (boxedValue->value));
+                operand->fString = new SkString(boxedValue->value);
                 } break;
             default: {
                 const char* id;
                 bool success = fEngine->getMaker().findKey(displayable, &id);
                 SkASSERT(success);
-                operand->fString = SkNEW_ARGS(SkString, (id));
+                operand->fString = new SkString(id);
             }
         }
         return true;
index c430695..0694fc4 100644 (file)
@@ -1356,7 +1356,7 @@ bool SkScriptEngine::processOp() {
             break;
         case kAddString:
             if (fTrackString.find(operand1.fString) < 0) {
-                operand1.fString = SkNEW_ARGS(SkString, (*operand1.fString));
+                operand1.fString = new SkString(*operand1.fString);
                 track(operand1.fString);
             }
             operand1.fString->append(*operand2.fString);
index 07bd4c9..5517b51 100644 (file)
@@ -221,9 +221,9 @@ bool SkScriptRuntime::executeTokens(unsigned char* opCode) {
             break;
         case SkScriptEngine2::kAddString:
 //            if (fTrackString.find(operand[1].fString) < 0) {
-//                operand[1].fString = SkNEW_ARGS(SkString, (*operand[1].fString));
-//                track(operand[1].fString);
-//            }
+            //                operand[1].fString = new SkString  (*operand[1].fString);
+            //                track(operand[1].fString);
+            //            }
             operand[0].fString->append(*operand[1].fString);
             break;
         case SkScriptEngine2::kBitAndInt:
index 330c796..dcf2683 100644 (file)
@@ -42,13 +42,9 @@ const struct {
 
 //////////////////////////////////////////////////////////////////////////////////////////////////
 
-sk_paint_t* sk_paint_new() {
-    return (sk_paint_t*)SkNEW(SkPaint);
-}
+sk_paint_t* sk_paint_new() { return (sk_paint_t*)new SkPaint; }
 
-void sk_paint_delete(sk_paint_t* cpaint) {
-    SkDELETE(AsPaint(cpaint));
-}
+void sk_paint_delete(sk_paint_t* cpaint) { delete AsPaint(cpaint); }
 
 bool sk_paint_is_antialias(const sk_paint_t* cpaint) {
     return AsPaint(*cpaint).isAntiAlias();
index ccab9df..722ca46 100644 (file)
@@ -258,13 +258,9 @@ uint32_t sk_image_get_unique_id(const sk_image_t* cimage) {
 
 ///////////////////////////////////////////////////////////////////////////////////////////
 
-sk_path_t* sk_path_new() {
-    return (sk_path_t*)SkNEW(SkPath);
-}
+sk_path_t* sk_path_new() { return (sk_path_t*)new SkPath; }
 
-void sk_path_delete(sk_path_t* cpath) {
-    SkDELETE(as_path(cpath));
-}
+void sk_path_delete(sk_path_t* cpath) { delete as_path(cpath); }
 
 void sk_path_move_to(sk_path_t* cpath, float x, float y) {
     as_path(cpath)->moveTo(x, y);
index 20af2da..b88c892 100644 (file)
@@ -113,8 +113,7 @@ bool SkBmpCodec::ReadHeader(SkStream* stream, bool inIco, SkCodec** codecOut) {
     // Bmps embedded in Icos skip the first Bmp header
     if (!inIco) {
         // Read the first header and the size of the second header
-        SkAutoTDeleteArray<uint8_t> hBuffer(
-                SkNEW_ARRAY(uint8_t, kBmpHeaderBytesPlusFour));
+        SkAutoTDeleteArray<uint8_t> hBuffer(new uint8_t[kBmpHeaderBytesPlusFour]);
         if (stream->read(hBuffer.get(), kBmpHeaderBytesPlusFour) !=
                 kBmpHeaderBytesPlusFour) {
             SkCodecPrintf("Error: unable to read first bitmap header.\n");
@@ -148,8 +147,7 @@ bool SkBmpCodec::ReadHeader(SkStream* stream, bool inIco, SkCodec** codecOut) {
         offset = 0;
 
         // Read the size of the second header
-        SkAutoTDeleteArray<uint8_t> hBuffer(
-                SkNEW_ARRAY(uint8_t, 4));
+        SkAutoTDeleteArray<uint8_t> hBuffer(new uint8_t[4]);
         if (stream->read(hBuffer.get(), 4) != 4) {
             SkCodecPrintf("Error: unable to read size of second bitmap header.\n");
             return false;
@@ -165,8 +163,7 @@ bool SkBmpCodec::ReadHeader(SkStream* stream, bool inIco, SkCodec** codecOut) {
     const uint32_t infoBytesRemaining = infoBytes - 4;
 
     // Read the second header
-    SkAutoTDeleteArray<uint8_t> iBuffer(
-            SkNEW_ARRAY(uint8_t, infoBytesRemaining));
+    SkAutoTDeleteArray<uint8_t> iBuffer(new uint8_t[infoBytesRemaining]);
     if (stream->read(iBuffer.get(), infoBytesRemaining) != infoBytesRemaining) {
         SkCodecPrintf("Error: unable to read second bitmap header.\n");
         return false;
@@ -313,8 +310,7 @@ bool SkBmpCodec::ReadHeader(SkStream* stream, bool inIco, SkCodec** codecOut) {
             switch (headerType) {
                 case kInfoV1_BmpHeaderType: {
                     // The V1 header stores the bit masks after the header
-                    SkAutoTDeleteArray<uint8_t> mBuffer(
-                            SkNEW_ARRAY(uint8_t, kBmpMaskBytes));
+                    SkAutoTDeleteArray<uint8_t> mBuffer(new uint8_t[kBmpMaskBytes]);
                     if (stream->read(mBuffer.get(), kBmpMaskBytes) !=
                             kBmpMaskBytes) {
                         SkCodecPrintf("Error: unable to read bit inputMasks.\n");
@@ -472,9 +468,9 @@ bool SkBmpCodec::ReadHeader(SkStream* stream, bool inIco, SkCodec** codecOut) {
         // Return the codec
         switch (inputFormat) {
             case kStandard_BmpInputFormat:
-                *codecOut = SkNEW_ARGS(SkBmpStandardCodec, (imageInfo, stream,
-                        bitsPerPixel, numColors, bytesPerColor,
-                        offset - bytesRead, rowOrder, inIco));
+                *codecOut =
+                        new SkBmpStandardCodec(imageInfo, stream, bitsPerPixel, numColors,
+                                               bytesPerColor, offset - bytesRead, rowOrder, inIco);
                 return true;
             case kBitMask_BmpInputFormat:
                 // Bmp-in-Ico must be standard mode
@@ -490,8 +486,8 @@ bool SkBmpCodec::ReadHeader(SkStream* stream, bool inIco, SkCodec** codecOut) {
                     return false;
                 }
 
-                *codecOut = SkNEW_ARGS(SkBmpMaskCodec, (imageInfo, stream,
-                        bitsPerPixel, masks.detach(), rowOrder));
+                *codecOut = new SkBmpMaskCodec(imageInfo, stream, bitsPerPixel, masks.detach(),
+                                               rowOrder);
                 return true;
             case kRLE_BmpInputFormat:
                 // Bmp-in-Ico must be standard mode
@@ -499,9 +495,9 @@ bool SkBmpCodec::ReadHeader(SkStream* stream, bool inIco, SkCodec** codecOut) {
                 // require that RLE Bmps have a valid number of totalBytes, and
                 // Icos skip the header that contains totalBytes.
                 SkASSERT(!inIco);
-                *codecOut = SkNEW_ARGS(SkBmpRLECodec, (
-                        imageInfo, stream, bitsPerPixel, numColors,
-                        bytesPerColor, offset - bytesRead, rowOrder, RLEBytes));
+                *codecOut =
+                        new SkBmpRLECodec(imageInfo, stream, bitsPerPixel, numColors, bytesPerColor,
+                                          offset - bytesRead, rowOrder, RLEBytes);
                 return true;
             default:
                 SkASSERT(false);
index 1c89ba1..90457b2 100644 (file)
@@ -58,7 +58,7 @@ SkCodec::Result SkBmpMaskCodec::onGetPixels(const SkImageInfo& dstInfo,
 bool SkBmpMaskCodec::initializeSwizzler(const SkImageInfo& dstInfo) {
     // Allocate space for a row buffer
     const size_t rowBytes = SkAlign4(compute_row_bytes(dstInfo.width(), this->bitsPerPixel()));
-    fSrcBuffer.reset(SkNEW_ARRAY(uint8_t, rowBytes));
+    fSrcBuffer.reset(new uint8_t[rowBytes]);
 
     // Create the swizzler
     fMaskSwizzler.reset(SkMaskSwizzler::CreateMaskSwizzler(
index 14a5b01..ed0617f 100644 (file)
  * Creates an instance of the decoder
  * Called only by NewFromStream
  */
-SkBmpRLECodec::SkBmpRLECodec(const SkImageInfo& info, SkStream* stream,
-                             uint16_t bitsPerPixel, uint32_t numColors,
-                             uint32_t bytesPerColor, uint32_t offset,
-                             SkBmpCodec::RowOrder rowOrder, size_t RLEBytes)
+SkBmpRLECodec::SkBmpRLECodec(const SkImageInfo& info,
+                             SkStream* stream,
+                             uint16_t bitsPerPixel,
+                             uint32_t numColors,
+                             uint32_t bytesPerColor,
+                             uint32_t offset,
+                             SkBmpCodec::RowOrder rowOrder,
+                             size_t RLEBytes)
     : INHERITED(info, stream, bitsPerPixel, rowOrder)
     , fColorTable(NULL)
     , fNumColors(this->computeNumColors(numColors))
     , fBytesPerColor(bytesPerColor)
     , fOffset(offset)
-    , fStreamBuffer(SkNEW_ARRAY(uint8_t, RLEBytes))
+    , fStreamBuffer(new uint8_t[RLEBytes])
     , fRLEBytes(RLEBytes)
-    , fCurrRLEByte(0)
-{}
+    , fCurrRLEByte(0) {}
 
 /*
  * Initiates the bitmap decode
@@ -92,7 +95,7 @@ SkCodec::Result SkBmpRLECodec::onGetPixels(const SkImageInfo& dstInfo,
 
         // Read the color table from the stream
         colorBytes = fNumColors * fBytesPerColor;
-        SkAutoTDeleteArray<uint8_t> cBuffer(SkNEW_ARRAY(uint8_t, colorBytes));
+        SkAutoTDeleteArray<uint8_t> cBuffer(new uint8_t[colorBytes]);
         if (stream()->read(cBuffer.get(), colorBytes) != colorBytes) {
             SkCodecPrintf("Error: unable to read color table.\n");
             return false;
@@ -115,7 +118,7 @@ SkCodec::Result SkBmpRLECodec::onGetPixels(const SkImageInfo& dstInfo,
         }
 
         // Set the color table
-        fColorTable.reset(SkNEW_ARGS(SkColorTable, (colorTable, maxColors)));
+        fColorTable.reset(new SkColorTable(colorTable, maxColors));
     }
 
     // Check that we have not read past the pixel array offset
index 27cea4e..8404aa6 100644 (file)
@@ -91,7 +91,7 @@ SkCodec::Result SkBmpStandardCodec::onGetPixels(const SkImageInfo& dstInfo,
 
         // Read the color table from the stream
         colorBytes = fNumColors * fBytesPerColor;
-        SkAutoTDeleteArray<uint8_t> cBuffer(SkNEW_ARRAY(uint8_t, colorBytes));
+        SkAutoTDeleteArray<uint8_t> cBuffer(new uint8_t[colorBytes]);
         if (stream()->read(cBuffer.get(), colorBytes) != colorBytes) {
             SkCodecPrintf("Error: unable to read color table.\n");
             return false;
@@ -139,7 +139,7 @@ SkCodec::Result SkBmpStandardCodec::onGetPixels(const SkImageInfo& dstInfo,
         }
 
         // Set the color table
-        fColorTable.reset(SkNEW_ARGS(SkColorTable, (colorTable, maxColors)));
+        fColorTable.reset(new SkColorTable(colorTable, maxColors));
     }
 
     // Bmp-in-Ico files do not use an offset to indicate where the pixel data
@@ -171,7 +171,7 @@ bool SkBmpStandardCodec::initializeSwizzler(const SkImageInfo& dstInfo,
                                             const Options& opts) {
     // Allocate space for a row buffer
     const size_t rowBytes = SkAlign4(compute_row_bytes(dstInfo.width(), this->bitsPerPixel()));
-    fSrcBuffer.reset(SkNEW_ARRAY(uint8_t, rowBytes));
+    fSrcBuffer.reset(new uint8_t[rowBytes]);
 
     // Get swizzler configuration
     SkSwizzler::SrcConfig config;
index 62eec27..76abcda 100644 (file)
@@ -72,7 +72,7 @@ SkCodec* SkCodec::NewFromData(SkData* data) {
     if (!data) {
         return NULL;
     }
-    return NewFromStream(SkNEW_ARGS(SkMemoryStream, (data)));
+    return NewFromStream(new SkMemoryStream(data));
 }
 
 SkCodec::SkCodec(const SkImageInfo& info, SkStream* stream)
index 1d6164e..40d159a 100644 (file)
@@ -170,7 +170,7 @@ bool SkGifCodec::ReadHeader(SkStream* stream, SkCodec** codecOut, GifFileType**
         // use kPremul directly even when kUnpremul is supported.
         const SkImageInfo& imageInfo = SkImageInfo::Make(width, height,
                 kIndex_8_SkColorType, kPremul_SkAlphaType);
-        *codecOut = SkNEW_ARGS(SkGifCodec, (imageInfo, streamDeleter.detach(), gif.detach()));
+        *codecOut = new SkGifCodec(imageInfo, streamDeleter.detach(), gif.detach());
     } else {
         SkASSERT(NULL != gifOut);
         streamDeleter.detach();
@@ -415,8 +415,7 @@ SkCodec::Result SkGifCodec::onGetPixels(const SkImageInfo& dstInfo,
                 }
 
                 // Stores output from dgiflib and input to the swizzler
-                SkAutoTDeleteArray<uint8_t>
-                        buffer(SkNEW_ARRAY(uint8_t, innerWidth));
+                SkAutoTDeleteArray<uint8_t> buffer(new uint8_t[innerWidth]);
 
                 // Check the interlace flag and iterate over rows of the input
                 if (fGif->Image.Interlace) {
index 2f1543e..e8e6531 100644 (file)
@@ -41,8 +41,7 @@ SkCodec* SkIcoCodec::NewFromStream(SkStream* stream) {
     static const uint32_t kIcoDirEntryBytes = 16;
 
     // Read the directory header
-    SkAutoTDeleteArray<uint8_t> dirBuffer(
-            SkNEW_ARRAY(uint8_t, kIcoDirectoryBytes));
+    SkAutoTDeleteArray<uint8_t> dirBuffer(new uint8_t[kIcoDirectoryBytes]);
     if (inputStream.get()->read(dirBuffer.get(), kIcoDirectoryBytes) !=
             kIcoDirectoryBytes) {
         SkCodecPrintf("Error: unable to read ico directory header.\n");
@@ -57,8 +56,7 @@ SkCodec* SkIcoCodec::NewFromStream(SkStream* stream) {
     }
 
     // Ensure that we can read all of indicated directory entries
-    SkAutoTDeleteArray<uint8_t> entryBuffer(
-            SkNEW_ARRAY(uint8_t, numImages*kIcoDirEntryBytes));
+    SkAutoTDeleteArray<uint8_t> entryBuffer(new uint8_t[numImages * kIcoDirEntryBytes]);
     if (inputStream.get()->read(entryBuffer.get(), numImages*kIcoDirEntryBytes) !=
             numImages*kIcoDirEntryBytes) {
         SkCodecPrintf("Error: unable to read ico directory entries.\n");
@@ -72,7 +70,7 @@ SkCodec* SkIcoCodec::NewFromStream(SkStream* stream) {
         uint32_t offset;
         uint32_t size;
     };
-    SkAutoTDeleteArray<Entry> directoryEntries(SkNEW_ARRAY(Entry, numImages));
+    SkAutoTDeleteArray<Entry> directoryEntries(new Entry[numImages]);
 
     // Iterate over directory entries
     for (uint32_t i = 0; i < numImages; i++) {
@@ -111,7 +109,7 @@ SkCodec* SkIcoCodec::NewFromStream(SkStream* stream) {
     // Now will construct a candidate codec for each of the embedded images
     uint32_t bytesRead = kIcoDirectoryBytes + numImages * kIcoDirEntryBytes;
     SkAutoTDelete<SkTArray<SkAutoTDelete<SkCodec>, true>> codecs(
-            SkNEW_ARGS((SkTArray<SkAutoTDelete<SkCodec>, true>), (numImages)));
+            new (SkTArray<SkAutoTDelete<SkCodec>, true>)(numImages));
     for (uint32_t i = 0; i < numImages; i++) {
         uint32_t offset = directoryEntries.get()[i].offset;
         uint32_t size = directoryEntries.get()[i].size;
@@ -137,8 +135,7 @@ SkCodec* SkIcoCodec::NewFromStream(SkStream* stream) {
             SkCodecPrintf("Warning: could not create embedded stream.\n");
             break;
         }
-        SkAutoTDelete<SkMemoryStream>
-                embeddedStream(SkNEW_ARGS(SkMemoryStream, (data.get())));
+        SkAutoTDelete<SkMemoryStream> embeddedStream(new SkMemoryStream(data.get()));
         bytesRead += size;
 
         // Check if the embedded codec is bmp or png and create the codec
@@ -189,7 +186,7 @@ SkCodec* SkIcoCodec::NewFromStream(SkStream* stream) {
 
     // Note that stream is owned by the embedded codec, the ico does not need
     // direct access to the stream.
-    return SkNEW_ARGS(SkIcoCodec, (info, codecs.detach()));
+    return new SkIcoCodec(info, codecs.detach());
 }
 
 /*
index 2fa3e68..31a4d2e 100644 (file)
@@ -189,7 +189,7 @@ bool SkPngCodec::decodePalette(bool premultiply, int* ctableCount) {
         *ctableCount = colorCount;
     }
 
-    fColorTable.reset(SkNEW_ARGS(SkColorTable, (colorStorage, colorCount)));
+    fColorTable.reset(new SkColorTable(colorStorage, colorCount));
     return true;
 }
 
@@ -356,8 +356,7 @@ SkCodec* SkPngCodec::NewFromStream(SkStream* stream) {
     SkImageInfo imageInfo;
     int bitDepth;
     if (read_header(stream, &png_ptr, &info_ptr, &imageInfo, &bitDepth)) {
-        return SkNEW_ARGS(SkPngCodec, (imageInfo, streamDeleter.detach(), 
-                png_ptr, info_ptr, bitDepth));
+        return new SkPngCodec(imageInfo, streamDeleter.detach(), png_ptr, info_ptr, bitDepth);
     }
     return NULL;
 }
@@ -781,9 +780,9 @@ SkScanlineDecoder* SkPngCodec::NewSDFromStream(SkStream* stream) {
     const SkImageInfo& srcInfo = codec->getInfo();
     if (codec->fNumberPasses > 1) {
         // interlaced image
-        return SkNEW_ARGS(SkPngInterlacedScanlineDecoder, (srcInfo, codec.detach()));
+        return new SkPngInterlacedScanlineDecoder(srcInfo, codec.detach());
     }
 
-    return SkNEW_ARGS(SkPngScanlineDecoder, (srcInfo, codec.detach()));
+    return new SkPngScanlineDecoder(srcInfo, codec.detach());
 }
 
index 9e38155..16cdbea 100644 (file)
@@ -160,7 +160,7 @@ SkCodec* SkWbmpCodec::NewFromStream(SkStream* stream) {
     }
     SkImageInfo info = SkImageInfo::Make(size.width(), size.height(),
             kGray_8_SkColorType, kOpaque_SkAlphaType);
-    return SkNEW_ARGS(SkWbmpCodec, (info, streamDeleter.detach()));
+    return new SkWbmpCodec(info, streamDeleter.detach());
 }
 
 class SkWbmpScanlineDecoder : public SkScanlineDecoder {
@@ -214,7 +214,7 @@ public:
 
         // Copy the color table to a pointer that can be owned by the scanline decoder
         if (kIndex_8_SkColorType == dstInfo.colorType()) {
-            fColorTable.reset(SkNEW_ARGS(SkColorTable, (inputColorTable, 2)));
+            fColorTable.reset(new SkColorTable(inputColorTable, 2));
         }
 
         // Initialize the swizzler
@@ -248,5 +248,5 @@ SkScanlineDecoder* SkWbmpCodec::NewSDFromStream(SkStream* stream) {
     }
 
     // Return the new scanline decoder
-    return SkNEW_ARGS(SkWbmpScanlineDecoder, (codec.detach()));
+    return new SkWbmpScanlineDecoder(codec.detach());
 }
index c094d50..4988dca 100644 (file)
@@ -101,7 +101,7 @@ bool SkJpegCodec::ReadHeader(SkStream* stream, SkCodec** codecOut,
         JpegDecoderMgr** decoderMgrOut) {
 
     // Create a JpegDecoderMgr to own all of the decompress information
-    SkAutoTDelete<JpegDecoderMgr> decoderMgr(SkNEW_ARGS(JpegDecoderMgr, (stream)));
+    SkAutoTDelete<JpegDecoderMgr> decoderMgr(new JpegDecoderMgr(stream));
 
     // libjpeg errors will be caught and reported here
     if (setjmp(decoderMgr->getJmpBuf())) {
@@ -123,7 +123,7 @@ bool SkJpegCodec::ReadHeader(SkStream* stream, SkCodec** codecOut,
         // Create image info object and the codec
         const SkImageInfo& imageInfo = SkImageInfo::Make(decoderMgr->dinfo()->image_width,
                 decoderMgr->dinfo()->image_height, colorType, kOpaque_SkAlphaType);
-        *codecOut = SkNEW_ARGS(SkJpegCodec, (imageInfo, stream, decoderMgr.detach()));
+        *codecOut = new SkJpegCodec(imageInfo, stream, decoderMgr.detach());
     } else {
         SkASSERT(NULL != decoderMgrOut);
         *decoderMgrOut = decoderMgr.detach();
@@ -586,5 +586,5 @@ SkScanlineDecoder* SkJpegCodec::NewSDFromStream(SkStream* stream) {
     const SkImageInfo& srcInfo = codec->getInfo();
 
     // Return the new scanline decoder
-    return SkNEW_ARGS(SkJpegScanlineDecoder, (srcInfo, codec.detach()));
+    return new SkJpegScanlineDecoder(srcInfo, codec.detach());
 }
index 31fd2cf..95f3627 100644 (file)
@@ -321,7 +321,7 @@ SkMaskSwizzler* SkMaskSwizzler::CreateMaskSwizzler(
             SkASSERT(false);
             return NULL;
     }
-    return SkNEW_ARGS(SkMaskSwizzler, (info, masks, proc));
+    return new SkMaskSwizzler(info, masks, proc);
 }
 
 /*
index 4b32c61..b136c59 100644 (file)
@@ -148,7 +148,7 @@ SkMasks* SkMasks::CreateMasks(InputMasks masks, uint32_t bitsPerPixel) {
     const MaskInfo blue = process_mask(masks.blue, bitsPerPixel);
     const MaskInfo alpha = process_mask(masks.alpha, bitsPerPixel);
 
-    return SkNEW_ARGS(SkMasks, (red, green, blue, alpha));
+    return new SkMasks(red, green, blue, alpha);
 }
 
 
index 0f0d129..bf09b4b 100644 (file)
@@ -27,14 +27,14 @@ SkCodec* SkScaledCodec::NewFromStream(SkStream* stream) {
     }
 
     // wrap in new SkScaledCodec
-    return SkNEW_ARGS(SkScaledCodec, (scanlineDecoder.detach()));
+    return new SkScaledCodec(scanlineDecoder.detach());
 }
 
 SkCodec* SkScaledCodec::NewFromData(SkData* data) {
     if (!data) {
         return NULL;
     }
-    return NewFromStream(SkNEW_ARGS(SkMemoryStream, (data)));
+    return NewFromStream(new SkMemoryStream(data));
 }
 
 SkScaledCodec::SkScaledCodec(SkScanlineDecoder* scanlineDecoder)
index 851e7e7..5c94a6d 100644 (file)
@@ -62,7 +62,7 @@ SkScanlineDecoder* SkScanlineDecoder::NewFromData(SkData* data) {
     if (!data) {
         return NULL;
     }
-    return NewFromStream(SkNEW_ARGS(SkMemoryStream, (data)));
+    return NewFromStream(new SkMemoryStream(data));
 }
 
 
index 8315cc7..db49fb1 100644 (file)
@@ -689,8 +689,8 @@ SkSwizzler* SkSwizzler::CreateSwizzler(SkSwizzler::SrcConfig sc,
     // get sampleX based on srcInfo and dstInfo dimensions
     int sampleX;
     SkScaledCodec::ComputeSampleSize(dstInfo, srcInfo, &sampleX, NULL);
-    
-    return SkNEW_ARGS(SkSwizzler, (proc, ctable, deltaSrc, dstInfo, sampleX));
+
+    return new SkSwizzler(proc, ctable, deltaSrc, dstInfo, sampleX);
 }
 
 SkSwizzler::SkSwizzler(RowProc proc, const SkPMColor* ctable,
index 1f69b4f..e17aa7e 100644 (file)
@@ -77,7 +77,7 @@ SkCodec* SkWebpCodec::NewFromStream(SkStream* stream) {
     SkAutoTDelete<SkStream> streamDeleter(stream);
     SkImageInfo info;
     if (webp_parse_header(stream, &info)) {
-        return SkNEW_ARGS(SkWebpCodec, (info, streamDeleter.detach()));
+        return new SkWebpCodec(info, streamDeleter.detach());
     }
     return NULL;
 }
index a4c7f4f..e8534ca 100644 (file)
@@ -12,5 +12,5 @@
 
 SkBBoxHierarchy* SkRTreeFactory::operator()(const SkRect& bounds) const {
     SkScalar aspectRatio = bounds.width() / bounds.height();
-    return SkNEW_ARGS(SkRTree, (aspectRatio));
+    return new SkRTree(aspectRatio);
 }
index bbe9882..f7d6bd4 100644 (file)
@@ -57,7 +57,7 @@ void SkBigPicture::partialPlayback(SkCanvas* canvas,
 }
 
 const SkBigPicture::Analysis& SkBigPicture::analysis() const {
-    auto create = [&]() { return SkNEW_ARGS(Analysis, (*fRecord)); };
+    auto create = [&]() { return new Analysis(*fRecord); };
     return *fAnalysis.get(create);
 }
 
index 97b0db6..03d1f42 100644 (file)
@@ -1145,7 +1145,7 @@ bool SkBitmap::ReadRawPixels(SkReadBuffer* buffer, SkBitmap* bitmap) {
 
     SkAutoTUnref<SkColorTable> ctable;
     if (buffer->readBool()) {
-        ctable.reset(SkNEW_ARGS(SkColorTable, (*buffer)));
+        ctable.reset(new SkColorTable(*buffer));
 
         unsigned char maxIndex = ctable->count() ? ctable->count()-1 : 0;
         for (uint64_t i = 0; i < ramSize; ++i) {
index 08e3fdc..66075d4 100644 (file)
@@ -115,8 +115,8 @@ void SkBitmapCache::Add(const SkBitmap& src, SkScalar invScaleX, SkScalar invSca
         return;
     }
     SkASSERT(result.isImmutable());
-    BitmapRec* rec = SkNEW_ARGS(BitmapRec, (src.getGenerationID(), invScaleX, invScaleY,
-                                            get_bounds_from_bitmap(src), result));
+    BitmapRec* rec = new BitmapRec(src.getGenerationID(), invScaleX, invScaleY,
+                                   get_bounds_from_bitmap(src), result);
     CHECK_LOCAL(localCache, add, Add, rec);
     src.pixelRef()->notifyAddedToCache();
 }
@@ -139,7 +139,7 @@ bool SkBitmapCache::Add(SkPixelRef* pr, const SkIRect& subset, const SkBitmap& r
         || result.height() != subset.height()) {
         return false;
     } else {
-        BitmapRec* rec = SkNEW_ARGS(BitmapRec, (pr->getGenerationID(), 1, 1, subset, result));
+        BitmapRec* rec = new BitmapRec(pr->getGenerationID(), 1, 1, subset, result);
 
         CHECK_LOCAL(localCache, add, Add, rec);
         pr->notifyAddedToCache();
@@ -156,7 +156,7 @@ bool SkBitmapCache::Find(uint32_t genID, SkBitmap* result, SkResourceCache* loca
 void SkBitmapCache::Add(uint32_t genID, const SkBitmap& result, SkResourceCache* localCache) {
     SkASSERT(result.isImmutable());
 
-    BitmapRec* rec = SkNEW_ARGS(BitmapRec, (genID, 1, 1, SkIRect::MakeEmpty(), result));
+    BitmapRec* rec = new BitmapRec(genID, 1, 1, SkIRect::MakeEmpty(), result);
 
     CHECK_LOCAL(localCache, add, Add, rec);
 }
@@ -235,7 +235,7 @@ static SkResourceCache::DiscardableFactory get_fact(SkResourceCache* localCache)
 const SkMipMap* SkMipMapCache::AddAndRef(const SkBitmap& src, SkResourceCache* localCache) {
     SkMipMap* mipmap = SkMipMap::Build(src, get_fact(localCache));
     if (mipmap) {
-        MipMapRec* rec = SkNEW_ARGS(MipMapRec, (src, mipmap));
+        MipMapRec* rec = new MipMapRec(src, mipmap);
         CHECK_LOCAL(localCache, add, Add, rec);
         src.pixelRef()->notifyAddedToCache();
     }
index dfe1756..d4445fa 100644 (file)
@@ -103,7 +103,7 @@ SkBitmapDevice* SkBitmapDevice::Create(const SkImageInfo& origInfo,
         }
     }
 
-    return SkNEW_ARGS(SkBitmapDevice, (bitmap, surfaceProps));
+    return new SkBitmapDevice(bitmap, surfaceProps);
 }
 
 SkImageInfo SkBitmapDevice::imageInfo() const {
index 8c44e9f..4c1e9c6 100644 (file)
@@ -20,17 +20,17 @@ SK_CONF_DECLARE(const char *, c_bitmapFilter, "bitmap.filter", "mitchell", "Whic
 
 SkBitmapFilter *SkBitmapFilter::Allocate() {
     if (!strcmp(c_bitmapFilter, "mitchell")) {
-        return SkNEW_ARGS(SkMitchellFilter,(1.f/3.f,1.f/3.f));
+        return new SkMitchellFilter(1.f / 3.f, 1.f / 3.f);
     } else if (!strcmp(c_bitmapFilter, "lanczos")) {
-        return SkNEW(SkLanczosFilter);
+        return new SkLanczosFilter;
     } else if (!strcmp(c_bitmapFilter, "hamming")) {
-        return SkNEW(SkHammingFilter);
+        return new SkHammingFilter;
     } else if (!strcmp(c_bitmapFilter, "gaussian")) {
-        return SkNEW_ARGS(SkGaussianFilter,(2));
+        return new SkGaussianFilter(2);
     } else if (!strcmp(c_bitmapFilter, "triangle")) {
-        return SkNEW(SkTriangleFilter);
+        return new SkTriangleFilter;
     } else if (!strcmp(c_bitmapFilter, "box")) {
-        return SkNEW(SkBoxFilter);
+        return new SkBoxFilter;
     } else {
         SkDEBUGFAIL("Unknown filter type");
     }
index e1d3cae..5b16d21 100644 (file)
@@ -227,7 +227,7 @@ int SkBitmapHeap::findInLookupTable(const LookupEntry& indexEntry, SkBitmapHeapE
     if (index < 0) {
         // insert ourselves into the bitmapIndex
         index = ~index;
-        *fLookupTable.insert(index) = SkNEW_ARGS(LookupEntry, (indexEntry));
+        *fLookupTable.insert(index) = new LookupEntry(indexEntry);
     } else if (entry != NULL) {
         // populate the entry if needed
         *entry = fStorage[fLookupTable[index]->fStorageSlot];
@@ -264,7 +264,7 @@ int SkBitmapHeap::removeEntryFromLookupTable(LookupEntry* entry) {
     // a new entry to the lookup table.
     SkASSERT(count == fLookupTable.count());
     fBytesAllocated -= fStorage[entry->fStorageSlot]->fBytesAllocated;
-    SkDELETE(fLookupTable[index]);
+    delete fLookupTable[index];
     fLookupTable.remove(index);
     return index;
 }
@@ -317,7 +317,7 @@ int32_t SkBitmapHeap::insert(const SkBitmap& originalBitmap) {
             fUnusedSlots.pop(&slot);
             entry = fStorage[slot];
         } else {
-            entry = SkNEW(SkBitmapHeapEntry);
+            entry = new SkBitmapHeapEntry;
             fStorage.append(1, &entry);
             entry->fSlot = fStorage.count() - 1;
             fBytesAllocated += sizeof(SkBitmapHeapEntry);
@@ -335,14 +335,14 @@ int32_t SkBitmapHeap::insert(const SkBitmap& originalBitmap) {
     // if the copy failed then we must abort
     if (!copySucceeded) {
         // delete the index
-        SkDELETE(fLookupTable[searchIndex]);
+        delete fLookupTable[searchIndex];
         fLookupTable.remove(searchIndex);
         // If entry is the last slot in storage, it is safe to delete it.
         if (fStorage.count() - 1 == entry->fSlot) {
             // free the slot
             fStorage.remove(entry->fSlot);
             fBytesAllocated -= sizeof(SkBitmapHeapEntry);
-            SkDELETE(entry);
+            delete entry;
         } else {
             fUnusedSlots.push(entry->fSlot);
         }
index 678a201..ef9cfd4 100644 (file)
@@ -79,7 +79,7 @@ SkShader::Context* SkBitmapProcShader::onCreateContext(const ContextRec& rec, vo
     }
 
     void* stateStorage = (char*)storage + sizeof(BitmapProcShaderContext);
-    SkBitmapProcState* state = SkNEW_PLACEMENT(stateStorage, SkBitmapProcState);
+    SkBitmapProcState* state = new (stateStorage) SkBitmapProcState;
 
     SkASSERT(state);
     state->fTileModeX = fTileModeX;
@@ -90,7 +90,7 @@ SkShader::Context* SkBitmapProcShader::onCreateContext(const ContextRec& rec, vo
         return NULL;
     }
 
-    return SkNEW_PLACEMENT_ARGS(storage, BitmapProcShaderContext, (*this, rec, state));
+    return new (storage) BitmapProcShaderContext(*this, rec, state);
 }
 
 size_t SkBitmapProcShader::contextSize() const {
@@ -302,19 +302,19 @@ SkShader* SkCreateBitmapShader(const SkBitmap& src, SkShader::TileMode tmx,
     SkColor color;
     if (src.isNull() || bitmap_is_too_big(src)) {
         if (NULL == allocator) {
-            shader = SkNEW(SkEmptyShader);
+            shader = new SkEmptyShader;
         } else {
             shader = allocator->createT<SkEmptyShader>();
         }
     } else if (can_use_color_shader(src, &color)) {
         if (NULL == allocator) {
-            shader = SkNEW_ARGS(SkColorShader, (color));
+            shader = new SkColorShader(color);
         } else {
             shader = allocator->createT<SkColorShader>(color);
         }
     } else {
         if (NULL == allocator) {
-            shader = SkNEW_ARGS(SkBitmapProcShader, (src, tmx, tmy, localMatrix));
+            shader = new SkBitmapProcShader(src, tmx, tmy, localMatrix);
         } else {
             shader = allocator->createT<SkBitmapProcShader>(src, tmx, tmy, localMatrix);
         }
index 6e25302..be79857 100644 (file)
@@ -25,9 +25,7 @@ public:
                    float destWidth, float destHeight,
                    const SkRect& destSubset,
                    const SkConvolutionProcs& convolveProcs);
-    ~SkResizeFilter() {
-        SkDELETE( fBitmapFilter );
-    }
+    ~SkResizeFilter() { delete fBitmapFilter; }
 
     // Returns the filled filter values.
     const SkConvolutionFilter1D& xFilter() { return fXFilter; }
@@ -70,23 +68,23 @@ SkResizeFilter::SkResizeFilter(SkBitmapScaler::ResizeMethod method,
 
     switch(method) {
         case SkBitmapScaler::RESIZE_BOX:
-            fBitmapFilter = SkNEW(SkBoxFilter);
+            fBitmapFilter = new SkBoxFilter;
             break;
         case SkBitmapScaler::RESIZE_TRIANGLE:
-            fBitmapFilter = SkNEW(SkTriangleFilter);
+            fBitmapFilter = new SkTriangleFilter;
             break;
         case SkBitmapScaler::RESIZE_MITCHELL:
-            fBitmapFilter = SkNEW_ARGS(SkMitchellFilter, (1.f/3.f, 1.f/3.f));
+            fBitmapFilter = new SkMitchellFilter(1.f / 3.f, 1.f / 3.f);
             break;
         case SkBitmapScaler::RESIZE_HAMMING:
-            fBitmapFilter = SkNEW(SkHammingFilter);
+            fBitmapFilter = new SkHammingFilter;
             break;
         case SkBitmapScaler::RESIZE_LANCZOS3:
-            fBitmapFilter = SkNEW(SkLanczosFilter);
+            fBitmapFilter = new SkLanczosFilter;
             break;
         default:
             // NOTREACHED:
-            fBitmapFilter = SkNEW_ARGS(SkMitchellFilter, (1.f/3.f, 1.f/3.f));
+            fBitmapFilter = new SkMitchellFilter(1.f / 3.f, 1.f / 3.f);
             break;
     }
 
index a932ba9..62cd73e 100644 (file)
@@ -597,7 +597,7 @@ public:
                 return NULL;
             }
         }
-        return SkNEW_PLACEMENT_ARGS(storage, Sk3DShaderContext, (*this, rec, proxyContext));
+        return new (storage) Sk3DShaderContext(*this, rec, proxyContext);
     }
 
     class Sk3DShaderContext : public SkShader::Context {
@@ -726,7 +726,7 @@ private:
 
 SkFlattenable* Sk3DShader::CreateProc(SkReadBuffer& buffer) {
     SkAutoTUnref<SkShader> shader(buffer.readShader());
-    return SkNEW_ARGS(Sk3DShader, (shader));
+    return new Sk3DShader(shader);
 }
 
 class Sk3DBlitter : public SkBlitter {
@@ -800,7 +800,7 @@ SkBlitter* SkBlitter::Choose(const SkPixmap& device,
 
     if (origPaint.getMaskFilter() != NULL &&
             origPaint.getMaskFilter()->getFormat() == SkMask::k3D_Format) {
-        shader3D = SkNEW_ARGS(Sk3DShader, (shader));
+        shader3D = new Sk3DShader(shader);
         // we know we haven't initialized lazyPaint yet, so just do it
         paint.writable()->setShader(shader3D)->unref();
         shader = shader3D;
@@ -837,7 +837,7 @@ SkBlitter* SkBlitter::Choose(const SkPixmap& device,
     if (NULL == shader) {
         if (mode) {
             // xfermodes (and filters) require shaders for our current blitters
-            shader = SkNEW_ARGS(SkColorShader, (paint->getColor()));
+            shader = new SkColorShader(paint->getColor());
             paint.writable()->setShader(shader)->unref();
             paint.writable()->setAlpha(0xFF);
         } else if (cf) {
@@ -852,7 +852,7 @@ SkBlitter* SkBlitter::Choose(const SkPixmap& device,
 
     if (cf) {
         SkASSERT(shader);
-        shader = SkNEW_ARGS(SkFilterShader, (shader, cf));
+        shader = new SkFilterShader(shader, cf);
         paint.writable()->setShader(shader)->unref();
         // blitters should ignore the presence/absence of a filter, since
         // if there is one, the shader will take care of it.
@@ -970,7 +970,7 @@ bool SkShaderBlitter::resetShaderContext(const SkShader::ContextRec& rec) {
     if (NULL == ctx) {
         // Need a valid context in fShaderContext's storage, so we can later (or our caller) call
         // the in-place destructor.
-        SkNEW_PLACEMENT_ARGS(fShaderContext, SkZeroShaderContext, (*fShader, rec));
+        new (fShaderContext) SkZeroShaderContext(*fShader, rec);
         return false;
     }
     return true;
index 16c4eea..439c2ff 100644 (file)
@@ -57,7 +57,7 @@ SkCachedData::~SkCachedData() {
             sk_free(fStorage.fMalloc);
             break;
         case kDiscardableMemory_StorageType:
-            SkDELETE(fStorage.fDM);
+            delete fStorage.fDM;
             break;
     }
     dec();
@@ -88,7 +88,7 @@ void SkCachedData::internalRef(bool fromCache) const {
 void SkCachedData::internalUnref(bool fromCache) const {
     if (AutoMutexWritable(this)->inMutexUnref(fromCache)) {
         // can't delete inside doInternalUnref, since it is locking a mutex (which we own)
-        SkDELETE(this);
+        delete this;
     }
 }
 
index daf8425..03c5173 100644 (file)
@@ -203,7 +203,7 @@ struct DeviceCM {
             device->onAttachToCanvas(canvas);
         }
         fDevice = device;
-        fPaint = paint ? SkNEW_ARGS(SkPaint, (*paint)) : NULL;
+        fPaint = paint ? new SkPaint(*paint) : NULL;
     }
 
     ~DeviceCM() {
@@ -211,7 +211,7 @@ struct DeviceCM {
             fDevice->onDetachFromCanvas();
             fDevice->unref();
         }
-        SkDELETE(fPaint);
+        delete fPaint;
     }
 
     void reset(const SkIRect& bounds) {
@@ -304,7 +304,7 @@ public:
     }
     ~MCRec() {
         SkSafeUnref(fFilter);
-        SkDELETE(fLayer);
+        delete fLayer;
         dec_rec();
     }
 
@@ -604,7 +604,7 @@ SkBaseDevice* SkCanvas::init(SkBaseDevice* device, InitFlags flags) {
     fSaveCount = 1;
     fMetaData = NULL;
 
-    fClipStack.reset(SkNEW(SkClipStack));
+    fClipStack.reset(new SkClipStack);
 
     fMCRec = (MCRec*)fMCStack.push_back();
     new (fMCRec) MCRec(fConservativeRasterClip);
@@ -664,8 +664,8 @@ SkCanvas::SkCanvas(int width, int height, const SkSurfaceProps* props)
 {
     inc_canvas();
 
-    this->init(SkNEW_ARGS(SkNoPixelsBitmapDevice,
-                          (SkIRect::MakeWH(width, height), fProps)), kDefault_InitFlags)->unref();
+    this->init(new SkNoPixelsBitmapDevice(SkIRect::MakeWH(width, height), fProps),
+               kDefault_InitFlags)->unref();
 }
 
 SkCanvas::SkCanvas(const SkIRect& bounds, InitFlags flags)
@@ -674,7 +674,7 @@ SkCanvas::SkCanvas(const SkIRect& bounds, InitFlags flags)
 {
     inc_canvas();
 
-    this->init(SkNEW_ARGS(SkNoPixelsBitmapDevice, (bounds, fProps)), flags)->unref();
+    this->init(new SkNoPixelsBitmapDevice(bounds, fProps), flags)->unref();
 }
 
 SkCanvas::SkCanvas(SkBaseDevice* device)
@@ -701,7 +701,7 @@ SkCanvas::SkCanvas(const SkBitmap& bitmap, const SkSurfaceProps& props)
 {
     inc_canvas();
 
-    SkAutoTUnref<SkBaseDevice> device(SkNEW_ARGS(SkBitmapDevice, (bitmap, fProps)));
+    SkAutoTUnref<SkBaseDevice> device(new SkBitmapDevice(bitmap, fProps));
     this->init(device, kDefault_InitFlags);
 }
 
@@ -711,7 +711,7 @@ SkCanvas::SkCanvas(const SkBitmap& bitmap)
 {
     inc_canvas();
 
-    SkAutoTUnref<SkBaseDevice> device(SkNEW_ARGS(SkBitmapDevice, (bitmap, fProps)));
+    SkAutoTUnref<SkBaseDevice> device(new SkBitmapDevice(bitmap, fProps));
     this->init(device, kDefault_InitFlags);
 }
 
@@ -721,7 +721,7 @@ SkCanvas::~SkCanvas() {
 
     this->internalRestore();    // restore the last, since we're going away
 
-    SkDELETE(fMetaData);
+    delete fMetaData;
 
     dec_canvas();
 }
@@ -1135,8 +1135,8 @@ void SkCanvas::internalSaveLayer(const SkRect* bounds, const SkPaint* paint, Sav
     }
 
     device->setOrigin(ir.fLeft, ir.fTop);
-    DeviceCM* layer = SkNEW_ARGS(DeviceCM, (device, paint, this, fConservativeRasterClip,
-                                            forceSpriteOnRestore));
+    DeviceCM* layer =
+            new DeviceCM(device, paint, this, fConservativeRasterClip, forceSpriteOnRestore);
     device->unref();
 
     layer->fNext = fMCRec->fTopLayer;
@@ -1188,7 +1188,7 @@ void SkCanvas::internalRestore() {
                                      layer->fPaint, layer->fDeviceIsBitmapDevice);
             // reset this, since internalDrawDevice will have set it to true
             fDeviceCMDirty = true;
-            SkDELETE(layer);
+            delete layer;
         } else {
             // we're at the root
             SkASSERT(layer == (void*)fDeviceCMStorage);
@@ -2876,7 +2876,7 @@ SkCanvas* SkCanvas::NewRasterDirect(const SkImageInfo& info, void* pixels, size_
     if (!bitmap.installPixels(info, pixels, rowBytes)) {
         return NULL;
     }
-    return SkNEW_ARGS(SkCanvas, (bitmap));
+    return new SkCanvas(bitmap);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
index c359e87..9541cc6 100644 (file)
@@ -711,7 +711,7 @@ void SkClipStack::pushElement(const Element& element) {
             prior = (Element*) fDeque.back();
         }
     }
-    Element* newElement = SkNEW_PLACEMENT_ARGS(fDeque.push_back(), Element, (element));
+    Element* newElement = new (fDeque.push_back()) Element(element);
     newElement->updateBoundAndGenID(prior);
 }
 
index 9cbcc64..e1670b8 100644 (file)
@@ -132,7 +132,7 @@ SkColorFilter* SkColorFilter::CreateComposeFilter(SkColorFilter* outer, SkColorF
     if (count > SK_MAX_COMPOSE_COLORFILTER_COUNT) {
         return NULL;
     }
-    return SkNEW_ARGS(SkComposeColorFilter, (outer, inner, count));
+    return new SkComposeColorFilter(outer, inner, count);
 }
 
 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkColorFilter)
index c16d7ff..094dfdb 100644 (file)
@@ -60,7 +60,7 @@ SkFlattenable* SkComposeShader::CreateProc(SkReadBuffer& buffer) {
     if (!shaderA.get() || !shaderB.get()) {
         return NULL;
     }
-    return SkNEW_ARGS(SkComposeShader, (shaderA, shaderB, mode));
+    return new SkComposeShader(shaderA, shaderB, mode);
 }
 
 void SkComposeShader::flatten(SkWriteBuffer& buffer) const {
@@ -102,7 +102,7 @@ SkShader::Context* SkComposeShader::onCreateContext(const ContextRec& rec, void*
         return NULL;
     }
 
-    return SkNEW_PLACEMENT_ARGS(storage, ComposeShaderContext, (*this, rec, contextA, contextB));
+    return new (storage) ComposeShaderContext(*this, rec, contextA, contextB);
 }
 
 SkComposeShader::ComposeShaderContext::ComposeShaderContext(
index e2644a0..20bc430 100644 (file)
@@ -79,7 +79,7 @@ const void* SkDataTable::at(int index, size_t* size) const {
 SkDataTable* SkDataTable::NewEmpty() {
     static SkDataTable* gEmpty;
     if (NULL == gEmpty) {
-        gEmpty = SkNEW(SkDataTable);
+        gEmpty = new SkDataTable;
     }
     gEmpty->ref();
     return gEmpty;
@@ -108,7 +108,7 @@ SkDataTable* SkDataTable::NewCopyArrays(const void * const * ptrs,
         elem += sizes[i];
     }
 
-    return SkNEW_ARGS(SkDataTable, (dir, count, malloc_freeproc, buffer));
+    return new SkDataTable(dir, count, malloc_freeproc, buffer);
 }
 
 SkDataTable* SkDataTable::NewCopyArray(const void* array, size_t elemSize,
@@ -121,8 +121,7 @@ SkDataTable* SkDataTable::NewCopyArray(const void* array, size_t elemSize,
     void* buffer = sk_malloc_throw(bufferSize);
     memcpy(buffer, array, bufferSize);
 
-    return SkNEW_ARGS(SkDataTable,
-                      (buffer, elemSize, count, malloc_freeproc, buffer));
+    return new SkDataTable(buffer, elemSize, count, malloc_freeproc, buffer);
 }
 
 SkDataTable* SkDataTable::NewArrayProc(const void* array, size_t elemSize,
@@ -130,14 +129,12 @@ SkDataTable* SkDataTable::NewArrayProc(const void* array, size_t elemSize,
     if (count <= 0) {
         return SkDataTable::NewEmpty();
     }
-    return SkNEW_ARGS(SkDataTable, (array, elemSize, count, proc, ctx));
+    return new SkDataTable(array, elemSize, count, proc, ctx);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 
-static void chunkalloc_freeproc(void* context) {
-    SkDELETE((SkChunkAlloc*)context);
-}
+static void chunkalloc_freeproc(void* context) { delete (SkChunkAlloc*)context; }
 
 SkDataTableBuilder::SkDataTableBuilder(size_t minChunkSize)
     : fHeap(NULL)
@@ -149,14 +146,14 @@ void SkDataTableBuilder::reset(size_t minChunkSize) {
     fMinChunkSize = minChunkSize;
     fDir.reset();
     if (fHeap) {
-        SkDELETE(fHeap);
+        delete fHeap;
         fHeap = NULL;
     }
 }
 
 void SkDataTableBuilder::append(const void* src, size_t size) {
     if (NULL == fHeap) {
-        fHeap = SkNEW_ARGS(SkChunkAlloc, (fMinChunkSize));
+        fHeap = new SkChunkAlloc(fMinChunkSize);
     }
 
     void* dst = fHeap->alloc(size, SkChunkAlloc::kThrow_AllocFailType);
@@ -178,9 +175,7 @@ SkDataTable* SkDataTableBuilder::detachDataTable() {
                              SkChunkAlloc::kThrow_AllocFailType);
     memcpy(dir, fDir.begin(), count * sizeof(SkDataTable::Dir));
 
-    SkDataTable* table = SkNEW_ARGS(SkDataTable,
-                                    ((SkDataTable::Dir*)dir, count,
-                                     chunkalloc_freeproc, fHeap));
+    SkDataTable* table = new SkDataTable((SkDataTable::Dir*)dir, count, chunkalloc_freeproc, fHeap);
     // we have to detach our fHeap, since we are giving that to the table
     fHeap = NULL;
     fDir.reset();
index b2cc0dd..f8275fa 100644 (file)
@@ -30,9 +30,7 @@ SkBaseDevice::SkBaseDevice(const SkSurfaceProps& surfaceProps)
     fMetaData = NULL;
 }
 
-SkBaseDevice::~SkBaseDevice() {
-    SkDELETE(fMetaData);
-}
+SkBaseDevice::~SkBaseDevice() { delete fMetaData; }
 
 SkMetaData& SkBaseDevice::getMetaData() {
     // metadata users are rare, so we lazily allocate it. If that changes we
index 188e12b..11d5c85 100644 (file)
@@ -41,7 +41,7 @@ SkDeviceProfile* SkDeviceProfile::Create(float gammaExp,
                                          float contrast,
                                          LCDConfig config,
                                          FontHintLevel level) {
-    return SkNEW_ARGS(SkDeviceProfile, (gammaExp, contrast, config, level));
+    return new SkDeviceProfile(gammaExp, contrast, config, level);
 }
 
 SK_DECLARE_STATIC_MUTEX(gMutex);
index 2bd9abb..6464d4a 100644 (file)
@@ -1919,7 +1919,7 @@ public:
 
 protected:
     Context* onCreateContext(const ContextRec& rec, void* storage) const override {
-        return SkNEW_PLACEMENT_ARGS(storage, TriColorShaderContext, (*this, rec));
+        return new (storage) TriColorShaderContext(*this, rec);
     }
 
 private:
@@ -2076,7 +2076,7 @@ void SkDraw::drawVertices(SkCanvas::VertexMode vmode, int count,
                 xmode = SkXfermode::Create(SkXfermode::kModulate_Mode);
                 releaseMode = true;
             }
-            composeShader.reset(SkNEW_ARGS(SkComposeShader, (&triShader, shader, xmode)));
+            composeShader.reset(new SkComposeShader(&triShader, shader, xmode));
             p.setShader(composeShader);
             if (releaseMode) {
                 xmode->unref();
index 9e8ff2d..23db8ac 100644 (file)
 #include <stdarg.h>
 
 namespace {
-    void *CreateThreadError() {
-        return SkNEW_ARGS(SkError, (kNoError_SkError));
-    }
-    void DeleteThreadError(void* v) {
-        SkDELETE(reinterpret_cast<SkError*>(v));
-    }
+void *CreateThreadError() { return new SkError(kNoError_SkError); }
+void DeleteThreadError(void *v) { delete reinterpret_cast<SkError *>(v); }
     #define THREAD_ERROR \
         (*reinterpret_cast<SkError*>(SkTLS::Get(CreateThreadError, DeleteThreadError)))
 
     void *CreateThreadErrorCallback() {
-        return SkNEW_ARGS(SkErrorCallbackFunction, (SkErrorInternals::DefaultErrorCallback));
+        return new SkErrorCallbackFunction(SkErrorInternals::DefaultErrorCallback);
     }
     void DeleteThreadErrorCallback(void* v) {
-        SkDELETE(reinterpret_cast<SkErrorCallbackFunction *>(v));
+        delete reinterpret_cast<SkErrorCallbackFunction *>(v);
     }
 
     #define THREAD_ERROR_CALLBACK                                                             \
         *(reinterpret_cast<SkErrorCallbackFunction *>(SkTLS::Get(CreateThreadErrorCallback,   \
                                                                  DeleteThreadErrorCallback)))
 
-    void *CreateThreadErrorContext() {
-        return SkNEW_ARGS(void **, (NULL));
-    }
-    void DeleteThreadErrorContext(void* v) {
-        SkDELETE(reinterpret_cast<void **>(v));
-    }
+    void *CreateThreadErrorContext() { return new void **(NULL); }
+    void DeleteThreadErrorContext(void *v) { delete reinterpret_cast<void **>(v); }
     #define THREAD_ERROR_CONTEXT \
         (*reinterpret_cast<void **>(SkTLS::Get(CreateThreadErrorContext, DeleteThreadErrorContext)))
 
     #define ERROR_STRING_LENGTH 2048
 
-    void *CreateThreadErrorString() {
-        return SkNEW_ARRAY(char, (ERROR_STRING_LENGTH));
-    }
-    void DeleteThreadErrorString(void* v) {
-        SkDELETE_ARRAY(reinterpret_cast<char *>(v));
-    }
+    void *CreateThreadErrorString() { return new char[(ERROR_STRING_LENGTH)]; }
+    void DeleteThreadErrorString(void *v) { delete[] reinterpret_cast<char *>(v); }
     #define THREAD_ERROR_STRING \
         (reinterpret_cast<char *>(SkTLS::Get(CreateThreadErrorString, DeleteThreadErrorString)))
 }
index a10a7c9..d972489 100644 (file)
@@ -32,7 +32,7 @@ SkFlattenable* SkFilterShader::CreateProc(SkReadBuffer& buffer) {
     if (!shader.get() || !filter.get()) {
         return NULL;
     }
-    return SkNEW_ARGS(SkFilterShader, (shader, filter));
+    return new SkFilterShader(shader, filter);
 }
 
 void SkFilterShader::flatten(SkWriteBuffer& buffer) const {
@@ -62,7 +62,7 @@ SkShader::Context* SkFilterShader::onCreateContext(const ContextRec& rec, void*
     if (NULL == shaderContext) {
         return NULL;
     }
-    return SkNEW_PLACEMENT_ARGS(storage, FilterShaderContext, (*this, shaderContext, rec));
+    return new (storage) FilterShaderContext(*this, shaderContext, rec);
 }
 
 size_t SkFilterShader::contextSize() const {
index dcc2f0b..d6895a4 100644 (file)
@@ -40,7 +40,7 @@ SkFont* SkFont::Create(SkTypeface* face, SkScalar size, SkScalar scaleX, SkScala
         return NULL;
     }
     flags &= kAllFlags;
-    return SkNEW_ARGS(SkFont, (face, size, scaleX, skewX, mt, flags));
+    return new SkFont(face, size, scaleX, skewX, mt, flags);
 }
 
 SkFont* SkFont::Create(SkTypeface* face, SkScalar size, MaskType mt, uint32_t flags) {
index cb149b9..8348d5f 100644 (file)
@@ -98,8 +98,7 @@ SkFontDescriptor::SkFontDescriptor(SkStream* stream) {
     if (length > 0) {
         SkAutoTUnref<SkData> data(SkData::NewUninitialized(length));
         if (stream->read(data->writable_data(), length) == length) {
-            fFontData.reset(new SkFontData(SkNEW_ARGS(SkMemoryStream, (data)), index,
-                                           axis, axisCount));
+            fFontData.reset(new SkFontData(new SkMemoryStream(data), index, axis, axisCount));
         }
     }
 }
index 33da1db..35ad6c3 100644 (file)
@@ -29,9 +29,7 @@ public:
     }
 };
 
-SkFontStyleSet* SkFontStyleSet::CreateEmpty() {
-    return SkNEW(SkEmptyFontStyleSet);
-}
+SkFontStyleSet* SkFontStyleSet::CreateEmpty() { return new SkEmptyFontStyleSet; }
 
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -70,7 +68,7 @@ protected:
         return NULL;
     }
     SkTypeface* onCreateFromStream(SkStreamAsset* stream, int) const override {
-        SkDELETE(stream);
+        delete stream;
         return NULL;
     }
     SkTypeface* onCreateFromFile(const char[], int) const override {
@@ -163,7 +161,7 @@ SkTypeface* SkFontMgr::legacyCreateTypeface(const char familyName[],
 // As a template argument this must have external linkage.
 SkFontMgr* sk_fontmgr_create_default() {
     SkFontMgr* fm = SkFontMgr::Factory();
-    return fm ? fm : SkNEW(SkEmptyFontMgr);
+    return fm ? fm : new SkEmptyFontMgr;
 }
 
 SK_DECLARE_STATIC_LAZY_PTR(SkFontMgr, singleton, sk_fontmgr_create_default);
old mode 100755 (executable)
new mode 100644 (file)
index e719c00..ff52004
@@ -17,9 +17,7 @@
 
 namespace {
 
-SkGlyphCache_Globals* create_globals() {
-    return SkNEW(SkGlyphCache_Globals);
-}
+SkGlyphCache_Globals* create_globals() { return new SkGlyphCache_Globals; }
 
 }  // namespace
 
@@ -55,13 +53,9 @@ SkGlyphCache::SkGlyphCache(SkTypeface* typeface, const SkDescriptor* desc, SkSca
 }
 
 SkGlyphCache::~SkGlyphCache() {
-    fGlyphMap.foreach(
-        [](SkGlyph* g) {
-            SkDELETE(g->fPath);
-        }
-    );
+    fGlyphMap.foreach ([](SkGlyph* g) { delete g->fPath; });
     SkDescriptor::Free(fDesc);
-    SkDELETE(fScalerContext);
+    delete fScalerContext;
     this->invokeAndRemoveAuxProcs();
 }
 
@@ -221,7 +215,7 @@ const void* SkGlyphCache::findImage(const SkGlyph& glyph) {
 const SkPath* SkGlyphCache::findPath(const SkGlyph& glyph) {
     if (glyph.fWidth) {
         if (glyph.fPath == NULL) {
-            const_cast<SkGlyph&>(glyph).fPath = SkNEW(SkPath);
+            const_cast<SkGlyph&>(glyph).fPath = new SkPath;
             fScalerContext->getPath(glyph, glyph.fPath);
             fMemoryUsed += sizeof(SkPath) +
                     glyph.fPath->countPoints() * sizeof(SkPoint);
@@ -279,7 +273,7 @@ void SkGlyphCache::setAuxProc(void (*proc)(void*), void* data) {
         rec = rec->fNext;
     }
     // not found, create a new rec
-    rec = SkNEW(AuxProcRec);
+    rec = new AuxProcRec;
     rec->fProc = proc;
     rec->fData = data;
     rec->fNext = fAuxProcList;
@@ -291,7 +285,7 @@ void SkGlyphCache::invokeAndRemoveAuxProcs() {
     while (rec) {
         rec->fProc(rec->fData);
         AuxProcRec* next = rec->fNext;
-        SkDELETE(rec);
+        delete rec;
         rec = next;
     }
 }
@@ -387,7 +381,7 @@ SkGlyphCache* SkGlyphCache::VisitCache(SkTypeface* typeface,
             ctx = typeface->createScalerContext(desc, false);
             SkASSERT(ctx);
         }
-        cache = SkNEW_ARGS(SkGlyphCache, (typeface, desc, ctx));
+        cache = new SkGlyphCache(typeface, desc, ctx);
     }
 
     AutoValidate av(cache);
@@ -502,7 +496,7 @@ size_t SkGlyphCache_Globals::internalPurge(size_t minBytesNeeded) {
         countFreed += 1;
 
         this->internalDetachCache(cache);
-        SkDELETE(cache);
+        delete cache;
         cache = prev;
     }
 
index 8e0ceb5..70d8020 100644 (file)
@@ -37,7 +37,7 @@ public:
         SkGlyphCache* cache = fHead;
         while (cache) {
             SkGlyphCache* next = cache->fNext;
-            SkDELETE(cache);
+            delete cache;
             cache = next;
         }
     }
index 863cc11..a65e8fc 100644 (file)
@@ -45,10 +45,8 @@ SkImageCacherator* SkImageCacherator::NewFromGenerator(SkImageGenerator* gen,
         subset = &bounds;
     }
 
-    return SkNEW_ARGS(SkImageCacherator, (gen,
-                                          gen->getInfo().makeWH(subset->width(), subset->height()),
-                                          SkIPoint::Make(subset->x(), subset->y()),
-                                          uniqueID));
+    return new SkImageCacherator(gen, gen->getInfo().makeWH(subset->width(), subset->height()),
+                                 SkIPoint::Make(subset->x(), subset->y()), uniqueID);
 }
 
 SkImageCacherator::SkImageCacherator(SkImageGenerator* gen, const SkImageInfo& info,
@@ -59,9 +57,7 @@ SkImageCacherator::SkImageCacherator(SkImageGenerator* gen, const SkImageInfo& i
     , fUniqueID(uniqueID)
 {}
 
-SkImageCacherator::~SkImageCacherator() {
-    SkDELETE(fGenerator);
-}
+SkImageCacherator::~SkImageCacherator() { delete fGenerator; }
 
 static bool check_output_bitmap(const SkBitmap& bitmap, uint32_t expectedID) {
     SkASSERT(bitmap.getGenerationID() == expectedID);
index 5157db2..0a46cb3 100644 (file)
@@ -204,7 +204,7 @@ SkImageFilter::SkImageFilter(int inputCount, SkReadBuffer& buffer)
     if (common.unflatten(buffer, inputCount)) {
         fCropRect = common.cropRect();
         fInputCount = common.inputCount();
-        fInputs = SkNEW_ARRAY(SkImageFilter*, fInputCount);
+        fInputs = new SkImageFilter* [fInputCount];
         common.detachInputs(fInputs);
         for (int i = 0; i < fInputCount; ++i) {
             if (NULL == fInputs[i] || fInputs[i]->usesSrcInput()) {
@@ -444,7 +444,7 @@ SkImageFilter* SkImageFilter::CreateMatrixFilter(const SkMatrix& matrix,
 void SkImageFilter::WrapTexture(GrTexture* texture, int width, int height, SkBitmap* result) {
     SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);
     result->setInfo(info);
-    result->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, texture)))->unref();
+    result->setPixelRef(new SkGrPixelRef(info, texture))->unref();
 }
 
 bool SkImageFilter::getInputResultGPU(SkImageFilter::Proxy* proxy,
@@ -465,7 +465,7 @@ bool SkImageFilter::getInputResultGPU(SkImageFilter::Proxy* proxy,
                     return false;
                 }
                 SkAutoTUnref<GrTexture> resultTex(GrRefCachedBitmapTexture(context, *result, NULL));
-                result->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, resultTex)))->unref();
+                result->setPixelRef(new SkGrPixelRef(info, resultTex))->unref();
             }
             return true;
         } else {
@@ -567,7 +567,7 @@ SkImageFilter::Cache* CreateCache() {
 } // namespace
 
 SkImageFilter::Cache* SkImageFilter::Cache::Create(size_t maxBytes) {
-    return SkNEW_ARGS(CacheImpl, (maxBytes));
+    return new CacheImpl(maxBytes);
 }
 
 SK_DECLARE_STATIC_LAZY_PTR(SkImageFilter::Cache, cache, CreateCache);
index e55f43d..5d018bc 100644 (file)
@@ -21,8 +21,8 @@
  *
  *  If this fails or when the SkDiscardablePixelRef that is
  *  installed into destination is destroyed, it will call
- *  SkDELETE() on the generator.  Therefore, generator should be
- *  allocated with SkNEW() or SkNEW_ARGS().
+ *  `delete` on the generator.  Therefore, generator should be
+ *  allocated with `new`.
  *
  *  @param destination Upon success, this bitmap will be
  *  configured and have a pixelref installed.
index 54c4f7b..5d598ef 100644 (file)
@@ -19,7 +19,11 @@ public:
     class BlockInfo {
     public:
         BlockInfo() : fPicture(NULL), fPaint(NULL), fKey(NULL), fKeySize(0) {}
-        ~BlockInfo() { SkSafeUnref(fPicture); SkDELETE(fPaint); SkDELETE_ARRAY(fKey); }
+        ~BlockInfo() {
+            SkSafeUnref(fPicture);
+            delete fPaint;
+            delete[] fKey;
+        }
 
         // The picture owning the layer. If the owning picture is the top-most
         // one (i.e., the picture for which this SkLayerInfo was created) then
index 3b2e062..0e20db4 100644 (file)
@@ -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);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
index 499e358..d286487 100644 (file)
@@ -25,11 +25,10 @@ public:
         class Builder {
         public:
             Builder(const SkLight lights[], int numLights)
-                : fLights(SkNEW_ARGS(Lights, (lights, numLights))) {
-            }
+                : fLights(new Lights(lights, numLights)) {}
+
+            Builder() : fLights(new Lights) {}
 
-            Builder() : fLights(SkNEW(Lights)) { }
-    
             // TODO: limit the number of lights here or just ignore those
             // above some maximum?
             void add(const SkLight& light) {
index 544ad2f..b9a0960 100644 (file)
@@ -66,5 +66,5 @@ SkShader* SkShader::CreateLocalMatrixShader(SkShader* proxy, const SkMatrix& loc
         proxy = otherProxy.get();
     }
 
-    return SkNEW_ARGS(SkLocalMatrixShader, (proxy, *lm));
+    return new SkLocalMatrixShader(proxy, *lm);
 }
index 12aa1f6..4916510 100644 (file)
@@ -44,8 +44,7 @@ SkMallocPixelRef* SkMallocPixelRef::NewDirect(const SkImageInfo& info,
     if (!is_valid(info, ctable)) {
         return NULL;
     }
-    return SkNEW_ARGS(SkMallocPixelRef,
-                      (info, addr, rowBytes, ctable, NULL, NULL));
+    return new SkMallocPixelRef(info, addr, rowBytes, ctable, NULL, NULL);
 }
 
 
@@ -84,9 +83,7 @@ SkMallocPixelRef* SkMallocPixelRef::NewAllocate(const SkImageInfo& info,
         return NULL;
     }
 
-    return SkNEW_ARGS(SkMallocPixelRef,
-                      (info, addr, rowBytes, ctable,
-                       sk_free_releaseproc, NULL));
+    return new SkMallocPixelRef(info, addr, rowBytes, ctable, sk_free_releaseproc, NULL);
 }
 
 SkMallocPixelRef* SkMallocPixelRef::NewWithProc(const SkImageInfo& info,
@@ -98,8 +95,7 @@ SkMallocPixelRef* SkMallocPixelRef::NewWithProc(const SkImageInfo& info,
     if (!is_valid(info, ctable)) {
         return NULL;
     }
-    return SkNEW_ARGS(SkMallocPixelRef,
-                      (info, addr, rowBytes, ctable, proc, context));
+    return new SkMallocPixelRef(info, addr, rowBytes, ctable, proc, context);
 }
 
 static void sk_data_releaseproc(void*, void* dataPtr) {
@@ -119,10 +115,9 @@ SkMallocPixelRef* SkMallocPixelRef::NewWithData(const SkImageInfo& info,
         return NULL;
     }
     data->ref();
-    SkMallocPixelRef* pr
-        = SkNEW_ARGS(SkMallocPixelRef,
-                     (info, const_cast<void*>(data->data()), rowBytes, ctable,
-                      sk_data_releaseproc, static_cast<void*>(data)));
+    SkMallocPixelRef* pr =
+            new SkMallocPixelRef(info, const_cast<void*>(data->data()), rowBytes, ctable,
+                                 sk_data_releaseproc, static_cast<void*>(data));
     SkASSERT(pr != NULL);
     // We rely on the immutability of the pixels to make the
     // const_cast okay.
index 7dc4e4e..cc729c3 100644 (file)
@@ -91,7 +91,7 @@ void SkMaskCache::Add(SkScalar sigma, SkBlurStyle style, SkBlurQuality quality,
                       const SkRRect& rrect, const SkMask& mask, SkCachedData* data,
                       SkResourceCache* localCache) {
     RRectBlurKey key(sigma, rrect, style, quality);
-    return CHECK_LOCAL(localCache, add, Add, SkNEW_ARGS(RRectBlurRec, (key, mask, data)));
+    return CHECK_LOCAL(localCache, add, Add, new RRectBlurRec(key, mask, data));
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////
@@ -187,5 +187,5 @@ void SkMaskCache::Add(SkScalar sigma, SkBlurStyle style, SkBlurQuality quality,
                       const SkRect rects[], int count, const SkMask& mask, SkCachedData* data,
                       SkResourceCache* localCache) {
     RectsBlurKey key(sigma, style, quality, rects, count);
-    return CHECK_LOCAL(localCache, add, Add, SkNEW_ARGS(RectsBlurRec, (key, mask, data)));
+    return CHECK_LOCAL(localCache, add, Add, new RectsBlurRec(key, mask, data));
 }
index a61867e..b6f6fc8 100644 (file)
@@ -26,7 +26,7 @@ SkMatrixImageFilter::SkMatrixImageFilter(const SkMatrix& transform,
 SkMatrixImageFilter* SkMatrixImageFilter::Create(const SkMatrix& transform,
                                                  SkFilterQuality filterQuality,
                                                  SkImageFilter* input) {
-    return SkNEW_ARGS(SkMatrixImageFilter, (transform, filterQuality, input));
+    return new SkMatrixImageFilter(transform, filterQuality, input);
 }
 
 SkFlattenable* SkMatrixImageFilter::CreateProc(SkReadBuffer& buffer) {
index df40fa4..5161c64 100644 (file)
@@ -62,7 +62,7 @@ SkMiniRecorder::~SkMiniRecorder() {
     if (fState != State::kEmpty) {
         // We have internal state pending.
         // Detaching then deleting a picture is an easy way to clean up.
-        SkDELETE(this->detachAsPicture(SkRect::MakeEmpty()));
+        delete this->detachAsPicture(SkRect::MakeEmpty());
     }
     SkASSERT(fState == State::kEmpty);
 }
@@ -102,10 +102,10 @@ bool SkMiniRecorder::drawTextBlob(const SkTextBlob* b, SkScalar x, SkScalar y, c
 
 
 SkPicture* SkMiniRecorder::detachAsPicture(const SkRect& cull) {
-#define CASE(Type)               \
-    case State::k##Type:         \
-        fState = State::kEmpty;  \
-        return SkNEW_ARGS(SkMiniPicture<Type>, (cull, reinterpret_cast<Type*>(fBuffer.get())))
+#define CASE(Type)              \
+    case State::k##Type:        \
+        fState = State::kEmpty; \
+        return new SkMiniPicture<Type>(cull, reinterpret_cast<Type*>(fBuffer.get()))
 
     switch (fState) {
         case State::kEmpty: return SkRef(gEmptyPicture.get());
index 032a60d..8a62f88 100644 (file)
@@ -250,9 +250,9 @@ SkMipMap* SkMipMap::Build(const SkBitmap& src, SkDiscardableFactoryProc fact) {
         if (NULL == dm) {
             return NULL;
         }
-        mipmap = SkNEW_ARGS(SkMipMap, (storageSize, dm));
+        mipmap = new SkMipMap(storageSize, dm);
     } else {
-        mipmap = SkNEW_ARGS(SkMipMap, (sk_malloc_throw(storageSize), storageSize));
+        mipmap = new SkMipMap(sk_malloc_throw(storageSize), storageSize);
     }
 
     // init
index 286d3b6..8cbb9ca 100644 (file)
@@ -35,7 +35,7 @@ void SkMultiPictureDraw::DrawData::init(SkCanvas* canvas, const SkPicture* pictu
         fMatrix.setIdentity();
     }
     if (paint) {
-        fPaint = SkNEW_ARGS(SkPaint, (*paint));
+        fPaint = new SkPaint(*paint);
     } else {
         fPaint = NULL;
     }
@@ -45,7 +45,7 @@ void SkMultiPictureDraw::DrawData::Reset(SkTDArray<DrawData>& data) {
     for (int i = 0; i < data.count(); ++i) {
         data[i].fPicture->unref();
         data[i].fCanvas->unref();
-        SkDELETE(data[i].fPaint);
+        delete data[i].fPaint;
     }
     data.rewind();
 }
index 4400994..7fd0b9d 100644 (file)
@@ -1511,13 +1511,13 @@ static const SkMaskGamma& cachedMaskGamma(SkScalar contrast, SkScalar paintGamma
     gMaskGammaCacheMutex.assertHeld();
     if (0 == contrast && SK_Scalar1 == paintGamma && SK_Scalar1 == deviceGamma) {
         if (NULL == gLinearMaskGamma) {
-            gLinearMaskGamma = SkNEW(SkMaskGamma);
+            gLinearMaskGamma = new SkMaskGamma;
         }
         return *gLinearMaskGamma;
     }
     if (gContrast != contrast || gPaintGamma != paintGamma || gDeviceGamma != deviceGamma) {
         SkSafeUnref(gMaskGamma);
-        gMaskGamma = SkNEW_ARGS(SkMaskGamma, (contrast, paintGamma, deviceGamma));
+        gMaskGamma = new SkMaskGamma(contrast, paintGamma, deviceGamma);
         gContrast = contrast;
         gPaintGamma = paintGamma;
         gDeviceGamma = deviceGamma;
index 38b4e71..e3317a6 100644 (file)
@@ -18,7 +18,7 @@ SkPathRef::Editor::Editor(SkAutoTUnref<SkPathRef>* pathRef,
     if ((*pathRef)->unique()) {
         (*pathRef)->incReserve(incReserveVerbs, incReservePoints);
     } else {
-        SkPathRef* copy = SkNEW(SkPathRef);
+        SkPathRef* copy = new SkPathRef;
         copy->copy(**pathRef, incReserveVerbs, incReservePoints);
         pathRef->reset(copy);
     }
@@ -46,7 +46,7 @@ SkPathRef::~SkPathRef() {
 
 // As a template argument, this must have external linkage.
 SkPathRef* sk_create_empty_pathref() {
-    SkPathRef* empty = SkNEW(SkPathRef);
+    SkPathRef* empty = new SkPathRef;
     empty->computeBounds();   // Avoids races later to be the first to do this.
     return empty;
 }
@@ -71,7 +71,7 @@ void SkPathRef::CreateTransformedCopy(SkAutoTUnref<SkPathRef>* dst,
     }
 
     if (!(*dst)->unique()) {
-        dst->reset(SkNEW(SkPathRef));
+        dst->reset(new SkPathRef);
     }
 
     if (*dst != &src) {
@@ -123,13 +123,13 @@ void SkPathRef::CreateTransformedCopy(SkAutoTUnref<SkPathRef>* dst,
 }
 
 SkPathRef* SkPathRef::CreateFromBuffer(SkRBuffer* buffer) {
-    SkPathRef* ref = SkNEW(SkPathRef);
+    SkPathRef* ref = new SkPathRef;
     bool isOval;
     uint8_t segmentMask;
 
     int32_t packed;
     if (!buffer->readS32(&packed)) {
-        SkDELETE(ref);
+        delete ref;
         return NULL;
     }
 
@@ -142,7 +142,7 @@ SkPathRef* SkPathRef::CreateFromBuffer(SkRBuffer* buffer) {
         !buffer->readS32(&verbCount) ||
         !buffer->readS32(&pointCount) ||
         !buffer->readS32(&conicCount)) {
-        SkDELETE(ref);
+        delete ref;
         return NULL;
     }
 
@@ -155,7 +155,7 @@ SkPathRef* SkPathRef::CreateFromBuffer(SkRBuffer* buffer) {
         !buffer->read(ref->fPoints, pointCount * sizeof(SkPoint)) ||
         !buffer->read(ref->fConicWeights.begin(), conicCount * sizeof(SkScalar)) ||
         !buffer->read(&ref->fBounds, sizeof(SkRect))) {
-        SkDELETE(ref);
+        delete ref;
         return NULL;
     }
     ref->fBoundsIsDirty = false;
@@ -182,7 +182,7 @@ void SkPathRef::Rewind(SkAutoTUnref<SkPathRef>* pathRef) {
     } else {
         int oldVCnt = (*pathRef)->countVerbs();
         int oldPCnt = (*pathRef)->countPoints();
-        pathRef->reset(SkNEW(SkPathRef));
+        pathRef->reset(new SkPathRef);
         (*pathRef)->resetToSize(0, 0, 0, oldVCnt, oldPCnt);
     }
 }
@@ -444,7 +444,7 @@ uint32_t SkPathRef::genID() const {
 
 void SkPathRef::addGenIDChangeListener(GenIDChangeListener* listener) {
     if (NULL == listener || this == empty.get()) {
-        SkDELETE(listener);
+        delete listener;
         return;
     }
     *fGenIDChangeListeners.append() = listener;
index 26ec761..8247336 100644 (file)
@@ -169,7 +169,7 @@ SkPictureData* SkPicture::backport() const {
     rec.beginRecording();
         this->playback(&rec);
     rec.endRecording();
-    return SkNEW_ARGS(SkPictureData, (rec, info, false/*deep copy ops?*/));
+    return new SkPictureData(rec, info, false /*deep copy ops?*/);
 }
 
 void SkPicture::serialize(SkWStream* stream, SkPixelSerializer* pixelSerializer) const {
index 6ae03a3..e70cd66 100644 (file)
@@ -52,7 +52,7 @@ SkPictureData::SkPictureData(const SkPictureRecord& record,
     const SkTDArray<const SkPicture* >& pictures = record.getPictureRefs();
     fPictureCount = pictures.count();
     if (fPictureCount > 0) {
-        fPictureRefs = SkNEW_ARRAY(const SkPicture*, fPictureCount);
+        fPictureRefs = new const SkPicture* [fPictureCount];
         for (int i = 0; i < fPictureCount; i++) {
             fPictureRefs[i] = pictures[i];
             fPictureRefs[i]->ref();
@@ -63,7 +63,7 @@ SkPictureData::SkPictureData(const SkPictureRecord& record,
     const SkTDArray<const SkTextBlob*>& blobs = record.getTextBlobRefs();
     fTextBlobCount = blobs.count();
     if (fTextBlobCount > 0) {
-        fTextBlobRefs = SkNEW_ARRAY(const SkTextBlob*, fTextBlobCount);
+        fTextBlobRefs = new const SkTextBlob* [fTextBlobCount];
         for (int i = 0; i < fTextBlobCount; ++i) {
             fTextBlobRefs[i] = SkRef(blobs[i]);
         }
@@ -72,7 +72,7 @@ SkPictureData::SkPictureData(const SkPictureRecord& record,
     const SkTDArray<const SkImage*>& imgs = record.getImageRefs();
     fImageCount = imgs.count();
     if (fImageCount > 0) {
-        fImageRefs = SkNEW_ARRAY(const SkImage*, fImageCount);
+        fImageRefs = new const SkImage* [fImageCount];
         for (int i = 0; i < fImageCount; ++i) {
             fImageRefs[i] = SkRef(imgs[i]);
         }
@@ -96,19 +96,19 @@ SkPictureData::~SkPictureData() {
     for (int i = 0; i < fPictureCount; i++) {
         fPictureRefs[i]->unref();
     }
-    SkDELETE_ARRAY(fPictureRefs);
+    delete[] fPictureRefs;
 
     for (int i = 0; i < fTextBlobCount; i++) {
         fTextBlobRefs[i]->unref();
     }
-    SkDELETE_ARRAY(fTextBlobRefs);
+    delete[] fTextBlobRefs;
 
     for (int i = 0; i < fImageCount; i++) {
         fImageRefs[i]->unref();
     }
-    SkDELETE_ARRAY(fImageRefs);
+    delete[] fImageRefs;
 
-    SkDELETE(fFactoryPlayback);
+    delete fFactoryPlayback;
 }
 
 bool SkPictureData::containsBitmaps() const {
@@ -364,7 +364,7 @@ bool SkPictureData::parseStreamTag(SkStream* stream,
         case SK_PICT_FACTORY_TAG: {
             SkASSERT(!haveBuffer);
             size = stream->readU32();
-            fFactoryPlayback = SkNEW_ARGS(SkFactoryPlayback, (size));
+            fFactoryPlayback = new SkFactoryPlayback(size);
             for (size_t i = 0; i < size; i++) {
                 SkString str;
                 const size_t len = stream->readPackedUInt();
@@ -391,7 +391,7 @@ bool SkPictureData::parseStreamTag(SkStream* stream,
         } break;
         case SK_PICT_PICTURE_TAG: {
             fPictureCount = 0;
-            fPictureRefs = SkNEW_ARRAY(const SkPicture*, size);
+            fPictureRefs = new const SkPicture* [size];
             for (uint32_t i = 0; i < size; i++) {
                 fPictureRefs[i] = SkPicture::CreateFromStream(stream, proc, topLevelTFPlayback);
                 if (!fPictureRefs[i]) {
@@ -474,7 +474,7 @@ bool new_array_from_buffer(SkReadBuffer& buffer, uint32_t inCount,
         return true;
     }
     *outCount = inCount;
-    *array = SkNEW_ARRAY(const T*, *outCount);
+    *array = new const T* [*outCount];
     bool success = true;
     int i = 0;
     for (; i < *outCount; i++) {
@@ -490,7 +490,7 @@ bool new_array_from_buffer(SkReadBuffer& buffer, uint32_t inCount,
             (*array)[j]->unref();
         }
         // Delete the array
-        SkDELETE_ARRAY(*array);
+        delete[] * array;
         *array = NULL;
         *outCount = 0;
         return false;
@@ -565,7 +565,7 @@ SkPictureData* SkPictureData::CreateFromStream(SkStream* stream,
                                                const SkPictInfo& info,
                                                SkPicture::InstallPixelRefProc proc,
                                                SkTypefacePlayback* topLevelTFPlayback) {
-    SkAutoTDelete<SkPictureData> data(SkNEW_ARGS(SkPictureData, (info)));
+    SkAutoTDelete<SkPictureData> data(new SkPictureData(info));
     if (!topLevelTFPlayback) {
         topLevelTFPlayback = &data->fTFPlayback;
     }
@@ -578,7 +578,7 @@ SkPictureData* SkPictureData::CreateFromStream(SkStream* stream,
 
 SkPictureData* SkPictureData::CreateFromBuffer(SkReadBuffer& buffer,
                                                const SkPictInfo& info) {
-    SkAutoTDelete<SkPictureData> data(SkNEW_ARGS(SkPictureData, (info)));
+    SkAutoTDelete<SkPictureData> data(new SkPictureData(info));
     buffer.setVersion(info.fVersion);
 
     if (!data->parseBuffer(buffer)) {
index 7b2e67f..3556004 100644 (file)
@@ -29,11 +29,11 @@ void SkTypefacePlayback::reset(const SkRefCntSet* rec) {
         SkASSERT(fArray[i]);
         fArray[i]->unref();
     }
-    SkDELETE_ARRAY(fArray);
+    delete[] fArray;
 
     if (rec!= NULL && rec->count() > 0) {
         fCount = rec->count();
-        fArray = SkNEW_ARRAY(SkRefCnt*, fCount);
+        fArray = new SkRefCnt* [fCount];
         rec->copyToArray(fArray);
         for (int i = 0; i < fCount; i++) {
             fArray[i]->ref();
@@ -48,7 +48,7 @@ void SkTypefacePlayback::setCount(int count) {
     this->reset(NULL);
 
     fCount = count;
-    fArray = SkNEW_ARRAY(SkRefCnt*, count);
+    fArray = new SkRefCnt* [count];
     sk_bzero(fArray, count * sizeof(SkRefCnt*));
 }
 
index 64e51b7..176f486 100644 (file)
@@ -135,13 +135,9 @@ protected:
 
 class SkFactoryPlayback {
 public:
-    SkFactoryPlayback(int count) : fCount(count) {
-        fArray = SkNEW_ARRAY(SkFlattenable::Factory, count);
-    }
+    SkFactoryPlayback(int count) : fCount(count) { fArray = new SkFlattenable::Factory[count]; }
 
-    ~SkFactoryPlayback() {
-        SkDELETE_ARRAY(fArray);
-    }
+    ~SkFactoryPlayback() { delete[] fArray; }
 
     SkFlattenable::Factory* base() const { return fArray; }
 
index acff84c..13d3cc8 100644 (file)
@@ -41,7 +41,7 @@ SkImageGenerator* SkPictureImageGenerator::Create(const SkISize& size, const SkP
         return nullptr;
     }
 
-    return SkNEW_ARGS(SkPictureImageGenerator, (size, picture, matrix, paint));
+    return new SkPictureImageGenerator(size, picture, matrix, paint);
 }
 
 SkPictureImageGenerator::SkPictureImageGenerator(const SkISize& size, const SkPicture* picture,
index 0c50dd9..8612aa7 100644 (file)
@@ -19,7 +19,7 @@
 
 SkPictureRecorder::SkPictureRecorder() {
     fActivelyRecording = false;
-    fRecorder.reset(SkNEW_ARGS(SkRecorder, (nullptr, SkRect::MakeWH(0,0), &fMiniRecorder)));
+    fRecorder.reset(new SkRecorder(nullptr, SkRect::MakeWH(0, 0), &fMiniRecorder));
 }
 
 SkPictureRecorder::~SkPictureRecorder() {}
@@ -36,7 +36,7 @@ SkCanvas* SkPictureRecorder::beginRecording(const SkRect& cullRect,
     }
 
     if (!fRecord) {
-        fRecord.reset(SkNEW(SkRecord));
+        fRecord.reset(new SkRecord);
     }
     SkRecorder::DrawPictureMode dpm = (recordFlags & kPlaybackDrawPicture_RecordFlag)
         ? SkRecorder::Playback_DrawPictureMode
@@ -64,7 +64,7 @@ SkPicture* SkPictureRecorder::endRecordingAsPicture() {
     SkAutoTUnref<SkLayerInfo> saveLayerData;
 
     if (fBBH && (fFlags & kComputeSaveLayerInfo_RecordFlag)) {
-        saveLayerData.reset(SkNEW(SkLayerInfo));
+        saveLayerData.reset(new SkLayerInfo);
     }
 
     SkDrawableList* drawableList = fRecorder->getDrawableList();
@@ -87,12 +87,8 @@ SkPicture* SkPictureRecorder::endRecordingAsPicture() {
     for (int i = 0; pictList && i < pictList->count(); i++) {
         subPictureBytes += SkPictureUtils::ApproximateBytesUsed(pictList->begin()[i]);
     }
-    return SkNEW_ARGS(SkBigPicture, (fCullRect,
-                                     fRecord.detach(),
-                                     pictList,
-                                     fBBH.detach(),
-                                     saveLayerData.detach(),
-                                     subPictureBytes));
+    return new SkBigPicture(fCullRect, fRecord.detach(), pictList, fBBH.detach(),
+                            saveLayerData.detach(), subPictureBytes);
 }
 
 SkPicture* SkPictureRecorder::endRecordingAsPicture(const SkRect& cullRect) {
@@ -159,7 +155,7 @@ protected:
         SkAutoTUnref<SkLayerInfo> saveLayerData;
 
         if (fBBH && fDoSaveLayerInfo) {
-            saveLayerData.reset(SkNEW(SkLayerInfo));
+            saveLayerData.reset(new SkLayerInfo);
 
             SkBBoxHierarchy* bbh = NULL;    // we've already computed fBBH (received in constructor)
             // TODO: update saveLayer info computation to reuse the already computed
@@ -173,12 +169,8 @@ protected:
         }
         // SkBigPicture will take ownership of a ref on both fRecord and fBBH.
         // We're not willing to give up our ownership, so we must ref them for SkPicture.
-        return SkNEW_ARGS(SkBigPicture, (fBounds,
-                                         SkRef(fRecord.get()),
-                                         pictList,
-                                         SkSafeRef(fBBH.get()),
-                                         saveLayerData.detach(),
-                                         subPictureBytes));
+        return new SkBigPicture(fBounds, SkRef(fRecord.get()), pictList, SkSafeRef(fBBH.get()),
+                                saveLayerData.detach(), subPictureBytes);
     }
 };
 
@@ -194,10 +186,9 @@ SkDrawable* SkPictureRecorder::endRecordingAsDrawable() {
         SkRecordFillBounds(fCullRect, *fRecord, fBBH.get());
     }
 
-    SkDrawable* drawable = SkNEW_ARGS(SkRecordedDrawable,
-                                        (fRecord, fBBH, fRecorder->detachDrawableList(),
-                                         fCullRect,
-                                         SkToBool(fFlags & kComputeSaveLayerInfo_RecordFlag)));
+    SkDrawable* drawable =
+            new SkRecordedDrawable(fRecord, fBBH, fRecorder->detachDrawableList(), fCullRect,
+                                   SkToBool(fFlags & kComputeSaveLayerInfo_RecordFlag));
 
     // release our refs now, so only the drawable will be the owner.
     fRecord.reset(NULL);
index b843339..569ef3d 100644 (file)
@@ -124,7 +124,7 @@ SkShader* SkPictureShader::Create(const SkPicture* picture, TileMode tmx, TileMo
     if (!picture || picture->cullRect().isEmpty() || (tile && tile->isEmpty())) {
         return SkShader::CreateEmptyShader();
     }
-    return SkNEW_ARGS(SkPictureShader, (picture, tmx, tmy, localMatrix, tile));
+    return new SkPictureShader(picture, tmx, tmy, localMatrix, tile);
 }
 
 SkFlattenable* SkPictureShader::CreateProc(SkReadBuffer& buffer) {
@@ -250,7 +250,7 @@ SkShader* SkPictureShader::refBitmapShader(const SkMatrix& matrix, const SkMatri
         shaderMatrix.preScale(1 / tileScale.width(), 1 / tileScale.height());
         tileShader.reset(CreateBitmapShader(bm, fTmx, fTmy, &shaderMatrix));
 
-        SkResourceCache::Add(SkNEW_ARGS(BitmapShaderRec, (key, tileShader.get(), bm.getSize())));
+        SkResourceCache::Add(new BitmapShaderRec(key, tileShader.get(), bm.getSize()));
     }
 
     return tileShader.detach();
@@ -272,8 +272,7 @@ SkShader::Context* SkPictureShader::onCreateContext(const ContextRec& rec, void*
 
 SkShader::Context* SkPictureShader::PictureShaderContext::Create(void* storage,
                    const SkPictureShader& shader, const ContextRec& rec, SkShader* bitmapShader) {
-    PictureShaderContext* ctx = SkNEW_PLACEMENT_ARGS(storage, PictureShaderContext,
-                                                     (shader, rec, bitmapShader));
+    PictureShaderContext* ctx = new (storage) PictureShaderContext(shader, rec, bitmapShader);
     if (NULL == ctx->fBitmapShaderContext) {
         ctx->~PictureShaderContext();
         ctx = NULL;
index 47f958d..7bcaffe 100644 (file)
@@ -243,7 +243,7 @@ uint32_t SkPixelRef::getGenerationID() const {
 void SkPixelRef::addGenIDChangeListener(GenIDChangeListener* listener) {
     if (NULL == listener || !this->genIDIsUnique()) {
         // No point in tracking this if we're not going to call it.
-        SkDELETE(listener);
+        delete listener;
         return;
     }
     *fGenIDChangeListeners.append() = listener;
index 6669471..7c77513 100644 (file)
@@ -229,9 +229,7 @@ void SkRWBuffer::validate() const {
 }
 #endif
 
-SkROBuffer* SkRWBuffer::newRBufferSnapshot() const {
-    return SkNEW_ARGS(SkROBuffer, (fHead, fTotalUsed));
-}
+SkROBuffer* SkRWBuffer::newRBufferSnapshot() const { return new SkROBuffer(fHead, fTotalUsed); }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -305,9 +303,7 @@ public:
         return fBuffer->size() == fGlobalOffset;
     }
 
-    SkStreamAsset* duplicate() const override {
-        return SkNEW_ARGS(SkROBufferStreamAsset, (fBuffer));
-    }
+    SkStreamAsset* duplicate() const override { return new SkROBufferStreamAsset(fBuffer); }
 
     size_t getPosition() const override {
         return fGlobalOffset;
@@ -349,5 +345,5 @@ private:
 
 SkStreamAsset* SkRWBuffer::newStreamSnapshot() const {
     SkAutoTUnref<SkROBuffer> buffer(this->newRBufferSnapshot());
-    return SkNEW_ARGS(SkROBufferStreamAsset, (buffer));
+    return new SkROBufferStreamAsset(buffer);
 }
index 890a0bf..fe8f5f4 100644 (file)
@@ -687,7 +687,7 @@ private:
             dst.fPreMat = src.fPreMat;
             dst.fPreMat.postConcat(fFillBounds.ctm());
             if (src.fPaint) {
-                dst.fPaint = SkNEW_ARGS(SkPaint, (*src.fPaint));
+                dst.fPaint = new SkPaint(*src.fPaint);
             }
             dst.fSaveLayerOpID = src.fSaveLayerOpID;
             dst.fRestoreOpID = src.fRestoreOpID;
@@ -696,7 +696,7 @@ private:
 
             // Store 'saveLayer ops from enclosing picture' + drawPict op + 'ops from sub-picture'
             dst.fKeySize = fSaveLayerOpStack.count() + src.fKeySize + 1;
-            dst.fKey = SkNEW_ARRAY(int, dst.fKeySize);
+            dst.fKey = new int[dst.fKeySize];
             memcpy(dst.fKey, fSaveLayerOpStack.begin(), fSaveLayerOpStack.count() * sizeof(int));
             dst.fKey[fSaveLayerOpStack.count()] = fFillBounds.currentOp();
             memcpy(&dst.fKey[fSaveLayerOpStack.count()+1], src.fKey, src.fKeySize * sizeof(int));
@@ -763,7 +763,7 @@ private:
         block.fLocalMat = fFillBounds.ctm();
         block.fPreMat = SkMatrix::I();
         if (sli.fPaint) {
-            block.fPaint = SkNEW_ARGS(SkPaint, (*sli.fPaint));
+            block.fPaint = new SkPaint(*sli.fPaint);
         }
 
         block.fSrcBounds = sli.fBounds;
@@ -773,7 +773,7 @@ private:
         block.fIsNested = fSaveLayersInStack > 0;
 
         block.fKeySize = fSaveLayerOpStack.count();
-        block.fKey = SkNEW_ARRAY(int, block.fKeySize);
+        block.fKey = new int[block.fKeySize];
         memcpy(block.fKey, fSaveLayerOpStack.begin(), block.fKeySize * sizeof(int));
 
         fSaveLayerOpStack.pop();
index b12b1eb..0fe9e28 100644 (file)
@@ -27,7 +27,7 @@ SkBigPicture::SnapshotArray* SkDrawableList::newDrawableSnapshot() {
     for (int i = 0; i < count; ++i) {
         pics[i] = fArray[i]->newPictureSnapshot();
     }
-    return SkNEW_ARGS(SkBigPicture::SnapshotArray, (pics.detach(), count));
+    return new SkBigPicture::SnapshotArray(pics.detach(), count);
 }
 
 void SkDrawableList::append(SkDrawable* drawable) {
@@ -66,9 +66,11 @@ void SkRecorder::forgetRecord() {
 }
 
 // To make appending to fRecord a little less verbose.
-#define APPEND(T, ...)                                    \
-        if (fMiniRecorder) { this->flushMiniRecorder(); } \
-        SkNEW_PLACEMENT_ARGS(fRecord->append<SkRecords::T>(), SkRecords::T, (__VA_ARGS__))
+#define APPEND(T, ...)             \
+    if (fMiniRecorder) {           \
+        this->flushMiniRecorder(); \
+    }                              \
+    new (fRecord->append<SkRecords::T>()) SkRecords::T(__VA_ARGS__)
 
 #define TRY_MINIRECORDER(method, ...)                       \
     if (fMiniRecorder && fMiniRecorder->method(__VA_ARGS__)) { return; }
@@ -83,7 +85,7 @@ T* SkRecorder::copy(const T* src) {
     if (NULL == src) {
         return NULL;
     }
-    return SkNEW_PLACEMENT_ARGS(fRecord->alloc<T>(), T, (*src));
+    return new (fRecord->alloc<T>()) T(*src);
 }
 
 // This copy() is for arrays.
@@ -95,7 +97,7 @@ T* SkRecorder::copy(const T src[], size_t count) {
     }
     T* dst = fRecord->alloc<T>(count);
     for (size_t i = 0; i < count; i++) {
-        SkNEW_PLACEMENT_ARGS(dst + i, T, (src[i]));
+        new (dst + i) T(src[i]);
     }
     return dst;
 }
@@ -157,7 +159,7 @@ void SkRecorder::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, const
 
 void SkRecorder::onDrawDrawable(SkDrawable* drawable, const SkMatrix* matrix) {
     if (!fDrawableList) {
-        fDrawableList.reset(SkNEW(SkDrawableList));
+        fDrawableList.reset(new SkDrawableList);
     }
     fDrawableList->append(drawable);
     APPEND(DrawDrawable, this->copy(matrix), drawable->getBounds(), fDrawableList->count() - 1);
index 922fc7e..911a090 100644 (file)
@@ -105,9 +105,7 @@ SkOneShotDiscardablePixelRef::SkOneShotDiscardablePixelRef(const SkImageInfo& in
     fFirstTime = true;
 }
 
-SkOneShotDiscardablePixelRef::~SkOneShotDiscardablePixelRef() {
-    SkDELETE(fDM);
-}
+SkOneShotDiscardablePixelRef::~SkOneShotDiscardablePixelRef() { delete fDM; }
 
 bool SkOneShotDiscardablePixelRef::onNewLockPixels(LockRec* rec) {
     if (fFirstTime) {
@@ -176,8 +174,7 @@ bool SkResourceCacheDiscardableAllocator::allocPixelRef(SkBitmap* bitmap, SkColo
     }
 
     SkImageInfo info = bitmap->info();
-    bitmap->setPixelRef(SkNEW_ARGS(SkOneShotDiscardablePixelRef,
-                                   (info, dm, bitmap->rowBytes())))->unref();
+    bitmap->setPixelRef(new SkOneShotDiscardablePixelRef(info, dm, bitmap->rowBytes()))->unref();
     bitmap->lockPixels();
     return bitmap->readyToDraw();
 }
@@ -186,7 +183,7 @@ SkResourceCache::SkResourceCache(DiscardableFactory factory) {
     this->init();
     fDiscardableFactory = factory;
 
-    fAllocator = SkNEW_ARGS(SkResourceCacheDiscardableAllocator, (factory));
+    fAllocator = new SkResourceCacheDiscardableAllocator(factory);
 }
 
 SkResourceCache::SkResourceCache(size_t byteLimit) {
@@ -200,7 +197,7 @@ SkResourceCache::~SkResourceCache() {
     Rec* rec = fHead;
     while (rec) {
         Rec* next = rec->fNext;
-        SkDELETE(rec);
+        delete rec;
         rec = next;
     }
     delete fHash;
@@ -243,7 +240,7 @@ void SkResourceCache::add(Rec* rec) {
     // See if we already have this key (racy inserts, etc.)
     Rec* existing = fHash->find(rec->getKey());
     if (existing) {
-        SkDELETE(rec);
+        delete rec;
         return;
     }
 
@@ -280,7 +277,7 @@ void SkResourceCache::remove(Rec* rec) {
                  bytesStr.c_str(), rec, rec->getHash(), totalStr.c_str(), fCount);
     }
 
-    SkDELETE(rec);
+    delete rec;
 }
 
 void SkResourceCache::purgeAsNeeded(bool forcePurge) {
@@ -374,9 +371,9 @@ SkCachedData* SkResourceCache::newCachedData(size_t bytes) {
 
     if (fDiscardableFactory) {
         SkDiscardableMemory* dm = fDiscardableFactory(bytes);
-        return dm ? SkNEW_ARGS(SkCachedData, (bytes, dm)) : NULL;
+        return dm ? new SkCachedData(bytes, dm) : NULL;
     } else {
-        return SkNEW_ARGS(SkCachedData, (sk_malloc_throw(bytes), bytes));
+        return new SkCachedData(sk_malloc_throw(bytes), bytes);
     }
 }
 
@@ -537,7 +534,7 @@ static void cleanup_gResourceCache() {
     // makes this unsafe to delete when the main process atexit()s.
     // SkLazyPtr does the same sort of thing.
 #if SK_DEVELOPER
-    SkDELETE(gResourceCache);
+    delete gResourceCache;
 #endif
 }
 
@@ -547,9 +544,9 @@ static SkResourceCache* get_cache() {
     gMutex.assertHeld();
     if (NULL == gResourceCache) {
 #ifdef SK_USE_DISCARDABLE_SCALEDIMAGECACHE
-        gResourceCache = SkNEW_ARGS(SkResourceCache, (SkDiscardableMemory::Create));
+        gResourceCache = new SkResourceCache(SkDiscardableMemory::Create);
 #else
-        gResourceCache = SkNEW_ARGS(SkResourceCache, (SK_DEFAULT_IMAGE_CACHE_LIMIT));
+        gResourceCache = new SkResourceCache(SK_DEFAULT_IMAGE_CACHE_LIMIT);
 #endif
         atexit(cleanup_gResourceCache);
     }
index b765aad..5f0f653 100644 (file)
@@ -870,8 +870,7 @@ SkScalerContext* SkTypeface::createScalerContext(const SkDescriptor* desc,
     SkScalerContext* c = this->onCreateScalerContext(desc);
 
     if (!c && !allowFailure) {
-        c = SkNEW_ARGS(SkScalerContext_Empty,
-                       (const_cast<SkTypeface*>(this), desc));
+        c = new SkScalerContext_Empty(const_cast<SkTypeface*>(this), desc);
     }
     return c;
 }
index ac62930..29d0e01 100644 (file)
@@ -55,8 +55,8 @@
     };
 #endif
 
-SkSemaphore::SkSemaphore() : fCount(0), fOSSemaphore(SkNEW(OSSemaphore)) {}
-SkSemaphore::~SkSemaphore() { SkDELETE(fOSSemaphore); }
+    SkSemaphore::SkSemaphore() : fCount(0), fOSSemaphore(new OSSemaphore) {}
+    SkSemaphore::~SkSemaphore() { delete fOSSemaphore; }
 
 void SkSemaphore::signal(int n) {
     SkASSERT(n >= 0);
index 41724d9..6da73fc 100644 (file)
@@ -224,13 +224,9 @@ SkShader* SkShader::refAsALocalMatrixShader(SkMatrix*) const {
     return NULL;
 }
 
-SkShader* SkShader::CreateEmptyShader() {
-    return SkNEW(SkEmptyShader);
-}
+SkShader* SkShader::CreateEmptyShader() { return new SkEmptyShader; }
 
-SkShader* SkShader::CreateColorShader(SkColor color) {
-    return SkNEW_ARGS(SkColorShader, (color));
-}
+SkShader* SkShader::CreateColorShader(SkColor color) { return new SkColorShader(color); }
 
 SkShader* SkShader::CreateBitmapShader(const SkBitmap& src, TileMode tmx, TileMode tmy,
                                        const SkMatrix* localMatrix) {
@@ -264,7 +260,7 @@ bool SkColorShader::isOpaque() const {
 }
 
 SkFlattenable* SkColorShader::CreateProc(SkReadBuffer& buffer) {
-    return SkNEW_ARGS(SkColorShader, (buffer.readColor()));
+    return new SkColorShader(buffer.readColor());
 }
 
 void SkColorShader::flatten(SkWriteBuffer& buffer) const {
@@ -280,7 +276,7 @@ uint8_t SkColorShader::ColorShaderContext::getSpan16Alpha() const {
 }
 
 SkShader::Context* SkColorShader::onCreateContext(const ContextRec& rec, void* storage) const {
-    return SkNEW_PLACEMENT_ARGS(storage, ColorShaderContext, (*this, rec));
+    return new (storage) ColorShaderContext(*this, rec);
 }
 
 SkColorShader::ColorShaderContext::ColorShaderContext(const SkColorShader& shader,
index 018705f..a2c132a 100644 (file)
@@ -63,7 +63,7 @@ public:
         if (NULL == buf) {
             return NULL;
         }
-        SkNEW_PLACEMENT(buf, T);
+        new (buf) T;
         return static_cast<T*>(buf);
     }
 
@@ -72,7 +72,7 @@ public:
         if (NULL == buf) {
             return NULL;
         }
-        SkNEW_PLACEMENT_ARGS(buf, T, (a1));
+        new (buf) T(a1);
         return static_cast<T*>(buf);
     }
 
@@ -82,7 +82,7 @@ public:
         if (NULL == buf) {
             return NULL;
         }
-        SkNEW_PLACEMENT_ARGS(buf, T, (a1, a2));
+        new (buf) T(a1, a2);
         return static_cast<T*>(buf);
     }
 
@@ -92,7 +92,7 @@ public:
         if (NULL == buf) {
             return NULL;
         }
-        SkNEW_PLACEMENT_ARGS(buf, T, (a1, a2, a3));
+        new (buf) T(a1, a2, a3);
         return static_cast<T*>(buf);
     }
 
@@ -102,7 +102,7 @@ public:
         if (NULL == buf) {
             return NULL;
         }
-        SkNEW_PLACEMENT_ARGS(buf, T, (a1, a2, a3, a4));
+        new (buf) T(a1, a2, a3, a4);
         return static_cast<T*>(buf);
     }
 
index f32f68a..8b2e8ab 100644 (file)
@@ -390,9 +390,7 @@ bool SkMemoryStream::rewind() {
     return true;
 }
 
-SkMemoryStream* SkMemoryStream::duplicate() const {
-    return SkNEW_ARGS(SkMemoryStream, (fData));
-}
+SkMemoryStream* SkMemoryStream::duplicate() const { return new SkMemoryStream(fData); }
 
 size_t SkMemoryStream::getPosition() const {
     return fOffset;
@@ -687,8 +685,11 @@ public:
 class SkBlockMemoryStream : public SkStreamAsset {
 public:
     SkBlockMemoryStream(SkDynamicMemoryWStream::Block* head, size_t size)
-        : fBlockMemory(SkNEW_ARGS(SkBlockMemoryRefCnt, (head))), fCurrent(head)
-        , fSize(size) , fOffset(0), fCurrentOffset(0) { }
+        : fBlockMemory(new SkBlockMemoryRefCnt(head))
+        , fCurrent(head)
+        , fSize(size)
+        , fOffset(0)
+        , fCurrentOffset(0) {}
 
     SkBlockMemoryStream(SkBlockMemoryRefCnt* headRef, size_t size)
         : fBlockMemory(SkRef(headRef)), fCurrent(fBlockMemory->fHead)
@@ -753,7 +754,7 @@ public:
     }
 
     SkBlockMemoryStream* duplicate() const override {
-        return SkNEW_ARGS(SkBlockMemoryStream, (fBlockMemory.get(), fSize));
+        return new SkBlockMemoryStream(fBlockMemory.get(), fSize);
     }
 
     size_t getPosition() const override {
@@ -810,11 +811,11 @@ private:
 
 SkStreamAsset* SkDynamicMemoryWStream::detachAsStream() {
     if (fCopy) {
-        SkMemoryStream* stream = SkNEW_ARGS(SkMemoryStream, (fCopy));
+        SkMemoryStream* stream = new SkMemoryStream(fCopy);
         this->reset();
         return stream;
     }
-    SkBlockMemoryStream* stream = SkNEW_ARGS(SkBlockMemoryStream, (fHead, fBytesWritten));
+    SkBlockMemoryStream* stream = new SkBlockMemoryStream(fHead, fBytesWritten);
     fHead = 0;
     this->reset();
     return stream;
@@ -861,14 +862,14 @@ static SkData* mmap_filename(const char path[]) {
 SkStreamAsset* SkStream::NewFromFile(const char path[]) {
     SkAutoTUnref<SkData> data(mmap_filename(path));
     if (data.get()) {
-        return SkNEW_ARGS(SkMemoryStream, (data.get()));
+        return new SkMemoryStream(data.get());
     }
 
     // If we get here, then our attempt at using mmap failed, so try normal
     // file access.
-    SkFILEStream* stream = SkNEW_ARGS(SkFILEStream, (path));
+    SkFILEStream* stream = new SkFILEStream(path);
     if (!stream->isValid()) {
-        SkDELETE(stream);
+        delete stream;
         stream = NULL;
     }
     return stream;
@@ -938,7 +939,7 @@ SkStreamRewindable* SkStreamRewindableFromSkStream(SkStream* stream) {
             length -= stream->getPosition();
         }
         SkAutoTUnref<SkData> data(SkData::NewFromStream(stream, length));
-        return SkNEW_ARGS(SkMemoryStream, (data.get()));
+        return new SkMemoryStream(data.get());
     }
     SkDynamicMemoryWStream tempStream;
     const size_t bufferSize = 4096;
index 3543529..3a91efe 100644 (file)
@@ -70,7 +70,7 @@ public:
         this->validate();
         Node* node = this->createNode();
         fList.addToHead(node);
-        SkNEW_PLACEMENT_ARGS(node->fObj, T, (t));
+        new (node->fObj) T(t);
         this->validate();
         return reinterpret_cast<T*>(node->fObj);
     }
@@ -79,7 +79,7 @@ public:
         this->validate();
         Node* node = this->createNode();
         fList.addToHead(node);
-        SkNEW_PLACEMENT(node->fObj, T);
+        new (node->fObj) T;
         this->validate();
         return reinterpret_cast<T*>(node->fObj);
     }
@@ -88,7 +88,7 @@ public:
         this->validate();
         Node* node = this->createNode();
         fList.addToTail(node);
-        SkNEW_PLACEMENT_ARGS(node->fObj, T, (t));
+        new (node->fObj) T(t);
         this->validate();
         return reinterpret_cast<T*>(node->fObj);
     }
@@ -97,7 +97,7 @@ public:
         this->validate();
         Node* node = this->createNode();
         fList.addToTail(node);
-        SkNEW_PLACEMENT(node->fObj, T);
+        new (node->fObj) T;
         this->validate();
         return reinterpret_cast<T*>(node->fObj);
     }
@@ -105,13 +105,13 @@ public:
     /** Adds a new element to the list before the location indicated by the iterator. If the
         iterator refers to a NULL location then the new element is added at the tail */
     T* addBefore(const T& t, const Iter& location) {
-        return SkNEW_PLACEMENT_ARGS(this->internalAddBefore(location), T, (t));
+        return new (this->internalAddBefore(location)) T(t);
     }
 
     /** Adds a new element to the list after the location indicated by the iterator. If the
         iterator refers to a NULL location then the new element is added at the head */
     T* addAfter(const T& t, const Iter& location) {
-        return SkNEW_PLACEMENT_ARGS(this->internalAddAfter(location), T, (t));
+        return new (this->internalAddAfter(location)) T(t);
     }
 
     /** Convenience methods for getting an iterator initialized to the head/tail of the list. */
@@ -249,11 +249,11 @@ private:
         } else {
             Block* block = reinterpret_cast<Block*>(sk_malloc_flags(this->blockSize(), 0));
             node = &block->fNodes[0];
-            SkNEW_PLACEMENT(node, Node);
+            new (node) Node;
             node->fBlock = block;
             block->fNodesInUse = 1;
             for (int i = 1; i < fAllocCnt; ++i) {
-                SkNEW_PLACEMENT(block->fNodes + i, Node);
+                new (block->fNodes + i) Node;
                 fFreeList.addToHead(block->fNodes + i);
                 block->fNodes[i].fBlock = block;
             }
index 346fed8..b22446b 100755 (executable)
@@ -50,7 +50,7 @@ void SkTLS::Destructor(void* ptr) {
     SkTLSRec* rec = (SkTLSRec*)ptr;
     do {
         SkTLSRec* next = rec->fNext;
-        SkDELETE(rec);
+        delete rec;
         rec = next;
     } while (rec);
 }
@@ -121,7 +121,7 @@ void SkTLS::Delete(CreateProc createProc) {
                 // we have a new head of our chain
                 SkTLS::PlatformSetSpecific(next);
             }
-            SkDELETE(curr);
+            delete curr;
             break;
         }
         prev = curr;
index 1168ed6..5f8589d 100644 (file)
@@ -40,14 +40,14 @@ public:
         if (list) {
             // The new ValueList entry is inserted as the second element in the
             // linked list, and it will contain the value of the first element.
-            ValueList* newEntry = SkNEW_ARGS(ValueList, (list->fValue));
+            ValueList* newEntry = new ValueList(list->fValue);
             newEntry->fNext = list->fNext;
             // The existing first ValueList entry is updated to contain the
             // inserted value.
             list->fNext = newEntry;
             list->fValue = value;
         } else {
-            fHash.add(SkNEW_ARGS(ValueList, (value)));
+            fHash.add(new ValueList(value));
         }
 
         ++fCount;
@@ -68,13 +68,13 @@ public:
             ValueList* next = list->fNext;
             list->fValue = next->fValue;
             list->fNext = next->fNext;
-            SkDELETE(next);
+            delete next;
         } else if (prev) {
             prev->fNext = NULL;
-            SkDELETE(list);
+            delete list;
         } else {
             fHash.remove(key);
-            SkDELETE(list);
+            delete list;
         }
 
         --fCount;
index e809f57..9462903 100644 (file)
@@ -111,7 +111,7 @@ private:
             threads = sk_num_cores();
         }
         for (int i = 0; i < threads; i++) {
-            fThreads.push(SkNEW_ARGS(SkThread, (&ThreadPool::Loop, this)));
+            fThreads.push(new SkThread(&ThreadPool::Loop, this));
             fThreads.top()->start();
         }
     }
@@ -204,13 +204,11 @@ ThreadPool* ThreadPool::gGlobal = NULL;
 SkTaskGroup::Enabler::Enabler(int threads) {
     SkASSERT(ThreadPool::gGlobal == NULL);
     if (threads != 0) {
-        ThreadPool::gGlobal = SkNEW_ARGS(ThreadPool, (threads));
+        ThreadPool::gGlobal = new ThreadPool(threads);
     }
 }
 
-SkTaskGroup::Enabler::~Enabler() {
-    SkDELETE(ThreadPool::gGlobal);
-}
+SkTaskGroup::Enabler::~Enabler() { delete ThreadPool::gGlobal; }
 
 SkTaskGroup::SkTaskGroup() : fPending(0) {}
 
index c94e22f..7da1118 100644 (file)
@@ -27,9 +27,7 @@ SkTypeface* (*gCreateTypefaceDelegate)(const char [], SkTypeface::Style ) = NULL
 
 class SkEmptyTypeface : public SkTypeface {
 public:
-    static SkEmptyTypeface* Create() {
-        return SkNEW(SkEmptyTypeface);
-    }
+    static SkEmptyTypeface* Create() { return new SkEmptyTypeface; }
 protected:
     SkEmptyTypeface() : SkTypeface(SkFontStyle(), 0, true) { }
 
@@ -59,7 +57,7 @@ protected:
         familyName->reset();
     }
     SkTypeface::LocalizedStrings* onCreateFamilyNameIterator() const override {
-        return SkNEW(EmptyLocalizedStrings);
+        return new EmptyLocalizedStrings;
     };
     int onGetTableTags(SkFontTableTag tags[]) const override { return 0; }
     size_t onGetTableData(SkFontTableTag, size_t, size_t, void*) const override {
@@ -330,7 +328,7 @@ struct SkTypeface::BoundsComputer {
     BoundsComputer(const SkTypeface& tf) : fTypeface(tf) {}
 
     SkRect* operator()() const {
-        SkRect* rect = SkNEW(SkRect);
+        SkRect* rect = new SkRect;
         if (!fTypeface.onComputeBounds(rect)) {
             rect->setEmpty();
         }
index c9a8122..17ce215 100644 (file)
@@ -1006,7 +1006,7 @@ SkXfermode* create_mode(int iMode) {
     if (auto xfermode = SkOpts::create_xfermode(rec, mode)) {
         return xfermode;
     }
-    return SkNEW_ARGS(SkProcCoeffXfermode, (rec, mode));
+    return new SkProcCoeffXfermode(rec, mode);
 }
 }  // namespace
 
index b113c07..f013599 100644 (file)
@@ -85,5 +85,5 @@ SkCachedData* SkYUVPlanesCache::FindAndRef(uint32_t genID, Info* info,
 void SkYUVPlanesCache::Add(uint32_t genID, SkCachedData* data, Info* info,
                            SkResourceCache* localCache) {
     YUVPlanesKey key(genID);
-    return CHECK_LOCAL(localCache, add, Add, SkNEW_ARGS(YUVPlanesRec, (key, data, info)));
+    return CHECK_LOCAL(localCache, add, Add, new YUVPlanesRec(key, data, info));
 }
index c1d5f0f..1741239 100644 (file)
@@ -63,11 +63,11 @@ static void perform_font_subsetting(
 
 static SkPDFObject* create_pdf_page_content(const SkPDFDevice* pageDevice) {
     SkAutoTDelete<SkStreamAsset> content(pageDevice->content());
-    return SkNEW_ARGS(SkPDFStream, (content.get()));
+    return new SkPDFStream(content.get());
 }
 
 static SkPDFDict* create_pdf_page(const SkPDFDevice* pageDevice) {
-    SkAutoTUnref<SkPDFDict> page(SkNEW_ARGS(SkPDFDict, ("Page")));
+    SkAutoTUnref<SkPDFDict> page(new SkPDFDict("Page"));
     page->insertObject("Resources", pageDevice->createResourceDict());
     page->insertObject("MediaBox", pageDevice->copyMediaBox());
     if (SkPDFArray* annots = pageDevice->getAnnotations()) {
@@ -162,7 +162,7 @@ static bool emit_pdf_document(const SkTDArray<const SkPDFDevice*>& pageDevices,
     }
 
     SkTDArray<SkPDFDict*> pages;
-    SkAutoTUnref<SkPDFDict> dests(SkNEW(SkPDFDict));
+    SkAutoTUnref<SkPDFDict> dests(new SkPDFDict);
 
     for (int i = 0; i < pageDevices.count(); i++) {
         SkASSERT(pageDevices[i]);
@@ -174,7 +174,7 @@ static bool emit_pdf_document(const SkTDArray<const SkPDFDevice*>& pageDevices,
     }
 
     SkTDArray<SkPDFDict*> pageTree;
-    SkAutoTUnref<SkPDFDict> docCatalog(SkNEW_ARGS(SkPDFDict, ("Catalog")));
+    SkAutoTUnref<SkPDFDict> docCatalog(new SkPDFDict("Catalog"));
 
     SkPDFDict* pageTreeRoot;
     generate_page_tree(pages, &pageTree, &pageTreeRoot);
@@ -308,7 +308,7 @@ protected:
                 SkScalarRoundToInt(width), SkScalarRoundToInt(height));
         SkAutoTUnref<SkPDFDevice> device(
                 SkPDFDevice::Create(pageSize, fRasterDpi, &fCanon));
-        fCanvas.reset(SkNEW_ARGS(SkCanvas, (device.get())));
+        fCanvas.reset(new SkCanvas(device.get()));
         fPageDevices.push(device.detach());
         fCanvas->clipRect(trimBox);
         fCanvas->translate(trimBox.x(), trimBox.y());
@@ -345,15 +345,15 @@ private:
 ///////////////////////////////////////////////////////////////////////////////
 
 SkDocument* SkDocument::CreatePDF(SkWStream* stream, SkScalar dpi) {
-    return stream ? SkNEW_ARGS(SkDocument_PDF, (stream, NULL, dpi)) : NULL;
+    return stream ? new SkDocument_PDF(stream, NULL, dpi) : NULL;
 }
 
 SkDocument* SkDocument::CreatePDF(const char path[], SkScalar dpi) {
-    SkFILEWStream* stream = SkNEW_ARGS(SkFILEWStream, (path));
+    SkFILEWStream* stream = new SkFILEWStream(path);
     if (!stream->isValid()) {
-        SkDELETE(stream);
+        delete stream;
         return NULL;
     }
-    auto delete_wstream = [](SkWStream* stream, bool) { SkDELETE(stream); };
-    return SkNEW_ARGS(SkDocument_PDF, (stream, delete_wstream, dpi));
+    auto delete_wstream = [](SkWStream* stream, bool) { delete stream; };
+    return new SkDocument_PDF(stream, delete_wstream, dpi);
 }
index 884d9a5..943d0a8 100644 (file)
@@ -33,7 +33,7 @@ protected:
                           const SkRect& trimBox) override {
         fDevice.beginSheet(fUnitsPerMeter, fPixelsPerMeter,
                            SkSize::Make(width, height));
-        fCanvas.reset(SkNEW_ARGS(SkCanvas, (&fDevice)));
+        fCanvas.reset(new SkCanvas(&fDevice));
         fCanvas->clipRect(trimBox);
         fCanvas->translate(trimBox.x(), trimBox.y());
         return fCanvas.get();
@@ -63,17 +63,15 @@ private:
 ///////////////////////////////////////////////////////////////////////////////
 
 SkDocument* SkDocument::CreateXPS(SkWStream* stream, SkScalar dpi) {
-    return stream ? SkNEW_ARGS(SkDocument_XPS, (stream, NULL, dpi)) : NULL;
+    return stream ? new SkDocument_XPS(stream, NULL, dpi) : NULL;
 }
 
-static void delete_wstream(SkWStream* stream, bool aborted) {
-    SkDELETE(stream);
-}
+static void delete_wstream(SkWStream* stream, bool aborted) { delete stream; }
 
 SkDocument* SkDocument::CreateXPS(const char path[], SkScalar dpi) {
-    SkAutoTDelete<SkFILEWStream> stream(SkNEW_ARGS(SkFILEWStream, (path)));
+    SkAutoTDelete<SkFILEWStream> stream(new SkFILEWStream(path));
     if (!stream->isValid()) {
         return NULL;
     }
-    return SkNEW_ARGS(SkDocument_XPS, (stream.detach(), delete_wstream, dpi));
+    return new SkDocument_XPS(stream.detach(), delete_wstream, dpi);
 }
index e55376d..f6d1461 100644 (file)
@@ -43,7 +43,7 @@ SkImageFilter* SkAlphaThresholdFilter::Create(const SkRegion& region,
                                               SkScalar innerThreshold,
                                               SkScalar outerThreshold,
                                               SkImageFilter* input) {
-    return SkNEW_ARGS(SkAlphaThresholdFilterImpl, (region, innerThreshold, outerThreshold, input));
+    return new SkAlphaThresholdFilterImpl(region, innerThreshold, outerThreshold, input);
 }
 
 #if SK_SUPPORT_GPU
@@ -67,11 +67,8 @@ public:
                                        GrTexture* maskTexture,
                                        float innerThreshold,
                                        float outerThreshold) {
-        return SkNEW_ARGS(AlphaThresholdEffect, (procDataManager,
-                                                 texture,
-                                                 maskTexture,
-                                                 innerThreshold,
-                                                 outerThreshold));
+        return new AlphaThresholdEffect(procDataManager, texture, maskTexture, innerThreshold,
+                                        outerThreshold);
     }
 
     virtual ~AlphaThresholdEffect() {};
@@ -215,7 +212,7 @@ void AlphaThresholdEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLFragmentProcessor* AlphaThresholdEffect::onCreateGLInstance() const {
-    return SkNEW_ARGS(GrGLAlphaThresholdEffect, (*this));
+    return new GrGLAlphaThresholdEffect(*this);
 }
 
 bool AlphaThresholdEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
index bd5bf46..b8959dd 100644 (file)
@@ -21,7 +21,7 @@ class SkArithmeticMode_scalar : public SkXfermode {
 public:
     static SkArithmeticMode_scalar* Create(SkScalar k1, SkScalar k2, SkScalar k3, SkScalar k4,
                                            bool enforcePMColor) {
-        return SkNEW_ARGS(SkArithmeticMode_scalar, (k1, k2, k3, k4, enforcePMColor));
+        return new SkArithmeticMode_scalar(k1, k2, k3, k4, enforcePMColor);
     }
 
     virtual void xfer32(SkPMColor dst[], const SkPMColor src[], int count,
@@ -217,15 +217,15 @@ SkXfermode* SkArithmeticMode::Create(SkScalar k1, SkScalar k2,
         int32_t i3 = toDot8(k3);
         int32_t i4 = toDot8(k4);
         if (i1) {
-            return SkNEW_ARGS(SkArithmeticMode_quad, (i1, i2, i3, i4));
+            return new SkArithmeticMode_quad  (i1, i2, i3, i4);
         }
         if (0 == i2) {
-            return SkNEW_ARGS(SkArithmeticMode_dst, (i3, i4));
+            return new SkArithmeticMode_dst  (i3, i4);
         }
         if (0 == i3) {
-            return SkNEW_ARGS(SkArithmeticMode_src, (i2, i4));
+            return new SkArithmeticMode_src  (i2, i4);
         }
-        return SkNEW_ARGS(SkArithmeticMode_linear, (i2, i3, i4));
+        return new SkArithmeticMode_linear  (i2, i3, i4);
 #endif
     }
     return SkArithmeticMode_scalar::Create(k1, k2, k3, k4, enforcePMColor);
index 39814e2..279e36d 100644 (file)
@@ -118,7 +118,7 @@ void GrArithmeticFP::onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyB
 }
 
 GrGLFragmentProcessor* GrArithmeticFP::onCreateGLInstance() const {
-    return SkNEW_ARGS(GLArithmeticFP, (*this));
+    return new GLArithmeticFP(*this);
 }
 
 bool GrArithmeticFP::onIsEqual(const GrFragmentProcessor& fpBase) const {
@@ -144,8 +144,7 @@ GrFragmentProcessor* GrArithmeticFP::TestCreate(GrProcessorTestData* d) {
     float k4 = d->fRandom->nextF();
     bool enforcePMColor = d->fRandom->nextBool();
 
-    return SkNEW_ARGS(GrArithmeticFP, (d->fProcDataManager, k1, k2, k3, k4, enforcePMColor,
-                                       d->fTextures[0]));
+    return new GrArithmeticFP(d->fProcDataManager, k1, k2, k3, k4, enforcePMColor, d->fTextures[0]);
 }
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrArithmeticFP);
@@ -256,9 +255,7 @@ void ArithmeticXP::onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBui
     GLArithmeticXP::GenKey(*this, caps, b);
 }
 
-GrGLXferProcessor* ArithmeticXP::createGLInstance() const {
-    return SkNEW_ARGS(GLArithmeticXP, (*this));
-}
+GrGLXferProcessor* ArithmeticXP::createGLInstance() const { return new GLArithmeticXP(*this); }
 
 GrXferProcessor::OptFlags ArithmeticXP::onGetOptimizations(const GrProcOptInfo& colorPOI,
                                                            const GrProcOptInfo& coveragePOI,
@@ -282,8 +279,7 @@ GrArithmeticXPFactory::onCreateXferProcessor(const GrCaps& caps,
                                              const GrProcOptInfo& coveragePOI,
                                              bool hasMixedSamples,
                                              const DstTexture* dstTexture) const {
-    return SkNEW_ARGS(ArithmeticXP, (dstTexture, hasMixedSamples, fK1, fK2, fK3, fK4,
-                                     fEnforcePMColor));
+    return new ArithmeticXP(dstTexture, hasMixedSamples, fK1, fK2, fK3, fK4, fEnforcePMColor);
 }
 
 
index 4f780cf..7b343ee 100644 (file)
@@ -34,8 +34,7 @@ public:
     static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, float k1, float k2,
                                        float k3, float k4, bool enforcePMColor,
                                        GrTexture* background) {
-        return SkNEW_ARGS(GrArithmeticFP, (procDataManager, k1, k2, k3, k4, enforcePMColor,
-                                           background));
+        return new GrArithmeticFP(procDataManager, k1, k2, k3, k4, enforcePMColor, background);
     }
 
     ~GrArithmeticFP() override {};
@@ -76,7 +75,7 @@ private:
 class GrArithmeticXPFactory : public GrXPFactory {
 public:
     static GrXPFactory* Create(float k1, float k2, float k3, float k4, bool enforcePMColor) {
-        return SkNEW_ARGS(GrArithmeticXPFactory, (k1, k2, k3, k4, enforcePMColor));
+        return new GrArithmeticXPFactory(k1, k2, k3, k4, enforcePMColor);
     }
 
     bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlags) const override {
index b3094d6..ceb210d 100644 (file)
@@ -103,7 +103,7 @@ bool SkBlurDrawLooper::asABlurShadow(BlurShadowRec* rec) const {
 ////////////////////////////////////////////////////////////////////////////////////////
 
 SkDrawLooper::Context* SkBlurDrawLooper::createContext(SkCanvas*, void* storage) const {
-    return SkNEW_PLACEMENT_ARGS(storage, BlurDrawLooperContext, (this));
+    return new (storage) BlurDrawLooperContext(this);
 }
 
 SkBlurDrawLooper::BlurDrawLooperContext::BlurDrawLooperContext(
index bf50845..4d366fe 100644 (file)
@@ -682,7 +682,7 @@ void SkBlurMask::ComputeBlurProfile(SkScalar sigma, uint8_t **profile_out) {
     int size = SkScalarCeilToInt(6*sigma);
 
     int center = size >> 1;
-    uint8_t *profile = SkNEW_ARRAY(uint8_t, size);
+    uint8_t* profile = new uint8_t[size];
 
     float invr = 1.f/(2*sigma);
 
index 96789c2..852d29b 100644 (file)
@@ -133,7 +133,7 @@ SkMaskFilter* SkBlurMaskFilter::Create(SkBlurStyle style, SkScalar sigma, uint32
     if (flags > SkBlurMaskFilter::kAll_BlurFlag) {
         return NULL;
     }
-    return SkNEW_ARGS(SkBlurMaskFilterImpl, (sigma, style, flags));
+    return new SkBlurMaskFilterImpl(sigma, style, flags);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -632,7 +632,7 @@ public:
         if (!createdBlurProfileTexture) {
            return NULL;
         }
-        return SkNEW_ARGS(GrRectBlurEffect, (rect, sigma, blurProfileTexture));
+        return new GrRectBlurEffect(rect, sigma, blurProfileTexture);
     }
 
     const SkRect& getRect() const { return fRect; }
@@ -802,7 +802,7 @@ void GrRectBlurEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLFragmentProcessor* GrRectBlurEffect::onCreateGLInstance() const {
-    return SkNEW_ARGS(GrGLRectBlurEffect, (*this));
+    return new GrGLRectBlurEffect(*this);
 }
 
 bool GrRectBlurEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
@@ -972,7 +972,7 @@ GrFragmentProcessor* GrRRectBlurEffect::Create(GrTextureProvider* texProvider, f
         }
         texProvider->assignUniqueKeyToTexture(key, blurNinePatchTexture);
     }
-    return SkNEW_ARGS(GrRRectBlurEffect, (sigma, rrect, blurNinePatchTexture));
+    return new GrRRectBlurEffect(sigma, rrect, blurNinePatchTexture);
 }
 
 void GrRRectBlurEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const {
@@ -1102,7 +1102,7 @@ void GrRRectBlurEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorK
 }
 
 GrGLFragmentProcessor* GrRRectBlurEffect::onCreateGLInstance() const {
-    return SkNEW_ARGS(GrGLRRectBlurEffect, (*this));
+    return new GrGLRRectBlurEffect(*this);
 }
 
 bool SkBlurMaskFilterImpl::directFilterRRectMaskGPU(GrTextureProvider* texProvider,
index 5e9dfde..d1857f9 100644 (file)
@@ -51,7 +51,7 @@ SkColorFilter* SkColorCubeFilter::Create(SkData* cubeData, int cubeDimension) {
         return NULL;
     }
 
-    return SkNEW_ARGS(SkColorCubeFilter, (cubeData, cubeDimension));
+    return new SkColorCubeFilter(cubeData, cubeDimension);
 }
 
 SkColorCubeFilter::SkColorCubeFilter(SkData* cubeData, int cubeDimension)
@@ -161,7 +161,7 @@ void SkColorCubeFilter::toString(SkString* str) const {
 class GrColorCubeEffect : public GrFragmentProcessor {
 public:
     static GrFragmentProcessor* Create(GrTexture* colorCube) {
-        return (NULL != colorCube) ? SkNEW_ARGS(GrColorCubeEffect, (colorCube)) : NULL;
+        return (NULL != colorCube) ? new GrColorCubeEffect(colorCube) : NULL;
     }
 
     virtual ~GrColorCubeEffect();
@@ -223,7 +223,7 @@ void GrColorCubeEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorK
 }
 
 GrGLFragmentProcessor* GrColorCubeEffect::onCreateGLInstance() const {
-    return SkNEW_ARGS(GLProcessor, (*this));
+    return new GLProcessor(*this);
 }
 
 void GrColorCubeEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const {
old mode 100755 (executable)
new mode 100644 (file)
index 94b530d..20dee8e
@@ -28,11 +28,11 @@ SkColorFilterImageFilter* SkColorFilterImageFilter::Create(SkColorFilter* cf,
         SkAutoUnref autoUnref(inputCF);
         SkAutoTUnref<SkColorFilter> newCF(SkColorFilter::CreateComposeFilter(cf, inputCF));
         if (newCF) {
-            return SkNEW_ARGS(SkColorFilterImageFilter, (newCF, input->getInput(0), cropRect));
+            return new SkColorFilterImageFilter(newCF, input->getInput(0), cropRect);
         }
     }
 
-    return SkNEW_ARGS(SkColorFilterImageFilter, (cf, input, cropRect));
+    return new SkColorFilterImageFilter(cf, input, cropRect);
 }
 
 SkColorFilterImageFilter::SkColorFilterImageFilter(SkColorFilter* cf,
index af3e38b..5560183 100644 (file)
@@ -134,7 +134,7 @@ public:
 //            SkDebugf("Failing to create color filter for mode %d\n", mode);
             return NULL;
         }
-        return SkNEW_ARGS(ModeColorFilterEffect, (c, mode));
+        return new ModeColorFilterEffect(c, mode);
     }
 
     bool willUseFilterColor() const {
@@ -212,9 +212,7 @@ private:
         this->initClassID<ModeColorFilterEffect>();
     }
 
-    GrGLFragmentProcessor* onCreateGLInstance() const override {
-        return SkNEW_ARGS(GLProcessor, (*this));
-    }
+    GrGLFragmentProcessor* onCreateGLInstance() const override { return new GLProcessor(*this); }
 
     virtual void onGetGLProcessorKey(const GrGLSLCaps& caps,
                                      GrProcessorKeyBuilder* b) const override {
@@ -438,11 +436,11 @@ SkColorFilter* SkColorFilter::CreateModeFilter(SkColor color, SkXfermode::Mode m
 
     switch (mode) {
         case SkXfermode::kSrc_Mode:
-            return SkNEW_ARGS(Src_SkModeColorFilter, (color));
+            return new Src_SkModeColorFilter(color);
         case SkXfermode::kSrcOver_Mode:
-            return SkNEW_ARGS(SrcOver_SkModeColorFilter, (color));
+            return new SrcOver_SkModeColorFilter(color);
         default:
-            return SkNEW_ARGS(SkModeColorFilter, (color, mode));
+            return new SkModeColorFilter(color, mode);
     }
 }
 
index 5845bc9..46c9b26 100644 (file)
@@ -389,7 +389,7 @@ SkColorFilter* SkColorMatrixFilter::newComposed(const SkColorFilter* innerFilter
 class ColorMatrixEffect : public GrFragmentProcessor {
 public:
     static GrFragmentProcessor* Create(const SkColorMatrix& matrix) {
-        return SkNEW_ARGS(ColorMatrixEffect, (matrix));
+        return new ColorMatrixEffect(matrix);
     }
 
     const char* name() const override { return "Color Matrix"; }
@@ -462,9 +462,7 @@ private:
         this->initClassID<ColorMatrixEffect>();
     }
 
-    GrGLFragmentProcessor* onCreateGLInstance() const override {
-        return SkNEW_ARGS(GLProcessor, (*this));
-    }
+    GrGLFragmentProcessor* onCreateGLInstance() const override { return new GLProcessor(*this); }
 
     virtual void onGetGLProcessorKey(const GrGLSLCaps& caps,
                                      GrProcessorKeyBuilder* b) const override {
index f360fe1..0c2cb8a 100644 (file)
@@ -173,8 +173,7 @@ SkDisplacementMapEffect* SkDisplacementMapEffect::Create(ChannelSelectorType xCh
     }
 
     SkImageFilter* inputs[2] = { displacement, color };
-    return SkNEW_ARGS(SkDisplacementMapEffect, (xChannelSelector, yChannelSelector, scale,
-                                                inputs, cropRect));
+    return new SkDisplacementMapEffect(xChannelSelector, yChannelSelector, scale, inputs, cropRect);
 }
 
 SkDisplacementMapEffect::SkDisplacementMapEffect(ChannelSelectorType xChannelSelector,
@@ -334,14 +333,9 @@ public:
             SkDisplacementMapEffect::ChannelSelectorType yChannelSelector, SkVector scale,
             GrTexture* displacement, const SkMatrix& offsetMatrix, GrTexture* color,
             const SkISize& colorDimensions) {
-        return SkNEW_ARGS(GrDisplacementMapEffect, (procDataManager,
-                                                    xChannelSelector,
-                                                    yChannelSelector,
-                                                    scale,
-                                                    displacement,
-                                                    offsetMatrix,
-                                                    color,
-                                                    colorDimensions));
+        return new GrDisplacementMapEffect(procDataManager, xChannelSelector, yChannelSelector,
+                                           scale, displacement, offsetMatrix, color,
+                                           colorDimensions);
     }
 
     virtual ~GrDisplacementMapEffect();
@@ -357,7 +351,7 @@ public:
 
 private:
     GrGLFragmentProcessor* onCreateGLInstance() const override {
-        return SkNEW_ARGS(GrGLDisplacementMapEffect, (*this));
+        return new GrGLDisplacementMapEffect(*this);
     }
 
     virtual void onGetGLProcessorKey(const GrGLSLCaps& caps,
index 59d2978..fcb6a2a 100644 (file)
@@ -14,7 +14,7 @@
 #include "SkString.h"
 
 SkEmbossMaskFilter* SkEmbossMaskFilter::Create(SkScalar blurSigma, const Light& light) {
-    return SkNEW_ARGS(SkEmbossMaskFilter, (blurSigma, light));
+    return new SkEmbossMaskFilter(blurSigma, light);
 }
 
 static inline int pin2byte(int n) {
index 30709c4..622088f 100644 (file)
@@ -31,14 +31,14 @@ SkLayerDrawLooper::~SkLayerDrawLooper() {
     Rec* rec = fRecs;
     while (rec) {
         Rec* next = rec->fNext;
-        SkDELETE(rec);
+        delete rec;
         rec = next;
     }
 }
 
 SkLayerDrawLooper::Context* SkLayerDrawLooper::createContext(SkCanvas* canvas, void* storage) const {
     canvas->save();
-    return SkNEW_PLACEMENT_ARGS(storage, LayerDrawLooperContext, (this));
+    return new (storage) LayerDrawLooperContext(this);
 }
 
 static SkColor xferColor(SkColor src, SkColor dst, SkXfermode::Mode mode) {
@@ -302,7 +302,7 @@ SkLayerDrawLooper::Builder::~Builder() {
     Rec* rec = fRecs;
     while (rec) {
         Rec* next = rec->fNext;
-        SkDELETE(rec);
+        delete rec;
         rec = next;
     }
 }
@@ -310,7 +310,7 @@ SkLayerDrawLooper::Builder::~Builder() {
 SkPaint* SkLayerDrawLooper::Builder::addLayer(const LayerInfo& info) {
     fCount += 1;
 
-    Rec* rec = SkNEW(Rec);
+    Rec* rec = new Rec;
     rec->fNext = fRecs;
     rec->fInfo = info;
     fRecs = rec;
@@ -331,7 +331,7 @@ void SkLayerDrawLooper::Builder::addLayer(SkScalar dx, SkScalar dy) {
 SkPaint* SkLayerDrawLooper::Builder::addLayerOnTop(const LayerInfo& info) {
     fCount += 1;
 
-    Rec* rec = SkNEW(Rec);
+    Rec* rec = new Rec;
     rec->fNext = NULL;
     rec->fInfo = info;
     if (NULL == fRecs) {
@@ -346,7 +346,7 @@ SkPaint* SkLayerDrawLooper::Builder::addLayerOnTop(const LayerInfo& info) {
 }
 
 SkLayerDrawLooper* SkLayerDrawLooper::Builder::detachLooper() {
-    SkLayerDrawLooper* looper = SkNEW(SkLayerDrawLooper);
+    SkLayerDrawLooper* looper = new SkLayerDrawLooper;
     looper->fCount = fCount;
     looper->fRecs = fRecs;
 
index 8403d06..d5ebb24 100644 (file)
@@ -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;
 }
index 76c97ef..a9b0d9e 100644 (file)
@@ -18,7 +18,7 @@ SkXfermode* SkLerpXfermode::Create(SkScalar scale) {
     } else if (scale256 <= 0) {
         return SkXfermode::Create(SkXfermode::kDst_Mode);
     }
-    return SkNEW_ARGS(SkLerpXfermode, (scale256));
+    return new SkLerpXfermode(scale256);
 }
 
 SkLerpXfermode::SkLerpXfermode(unsigned scale256) : fScale256(scale256) {}
@@ -28,7 +28,7 @@ void SkLerpXfermode::flatten(SkWriteBuffer& buffer) const {
 }
 
 SkFlattenable* SkLerpXfermode::CreateProc(SkReadBuffer& buffer) {
-    return SkNEW_ARGS(SkLerpXfermode, (buffer.readUInt()));
+    return new SkLerpXfermode(buffer.readUInt());
 }
 
 void SkLerpXfermode::xfer32(SkPMColor dst[], const SkPMColor src[], int count,
index c63b2eb..2e25cbf 100644 (file)
@@ -527,13 +527,8 @@ public:
                                        const SkMatrix& matrix,
                                        SkScalar kd,
                                        BoundaryMode boundaryMode) {
-        return SkNEW_ARGS(GrDiffuseLightingEffect, (procDataManager,
-                                                    texture,
-                                                    light,
-                                                    surfaceScale,
-                                                    matrix,
-                                                    kd,
-                                                    boundaryMode));
+        return new GrDiffuseLightingEffect(procDataManager, texture, light, surfaceScale, matrix,
+                                           kd, boundaryMode);
     }
 
     const char* name() const override { return "DiffuseLighting"; }
@@ -570,14 +565,8 @@ public:
                                        SkScalar ks,
                                        SkScalar shininess,
                                        BoundaryMode boundaryMode) {
-        return SkNEW_ARGS(GrSpecularLightingEffect, (procDataManager,
-                                                     texture,
-                                                     light,
-                                                     surfaceScale,
-                                                     matrix,
-                                                     ks,
-                                                     shininess,
-                                                     boundaryMode));
+        return new GrSpecularLightingEffect(procDataManager, texture, light, surfaceScale, matrix,
+                                            ks, shininess, boundaryMode);
     }
 
     const char* name() const override { return "SpecularLighting"; }
@@ -762,7 +751,7 @@ public:
     const SkPoint3& direction() const { return fDirection; }
     GrGLLight* createGLLight() const override {
 #if SK_SUPPORT_GPU
-        return SkNEW(GrGLDistantLight);
+        return new GrGLDistantLight;
 #else
         SkDEBUGFAIL("Should not call in GPU-less build");
         return NULL;
@@ -821,7 +810,7 @@ public:
     const SkPoint3& location() const { return fLocation; }
     GrGLLight* createGLLight() const override {
 #if SK_SUPPORT_GPU
-        return SkNEW(GrGLPointLight);
+        return new GrGLPointLight;
 #else
         SkDEBUGFAIL("Should not call in GPU-less build");
         return NULL;
@@ -935,7 +924,7 @@ public:
     }
     GrGLLight* createGLLight() const override {
 #if SK_SUPPORT_GPU
-        return SkNEW(GrGLSpotLight);
+        return new GrGLSpotLight;
 #else
         SkDEBUGFAIL("Should not call in GPU-less build");
         return NULL;
@@ -1041,9 +1030,12 @@ void SkImageFilterLight::flattenLight(SkWriteBuffer& buffer) const {
     switch (type) {
         // Each of these constructors must first call SkLight's, so we'll read the baseclass
         // then subclass, same order as flattenLight.
-        case SkImageFilterLight::kDistant_LightType: return SkNEW_ARGS(SkDistantLight, (buffer));
-        case SkImageFilterLight::kPoint_LightType:   return SkNEW_ARGS(SkPointLight, (buffer));
-        case SkImageFilterLight::kSpot_LightType:    return SkNEW_ARGS(SkSpotLight, (buffer));
+        case SkImageFilterLight::kDistant_LightType:
+            return new SkDistantLight(buffer);
+        case SkImageFilterLight::kPoint_LightType:
+            return new SkPointLight(buffer);
+        case SkImageFilterLight::kSpot_LightType:
+            return new SkSpotLight(buffer);
         default:
             SkDEBUGFAIL("Unknown LightType.");
             buffer.validate(false);
@@ -1065,7 +1057,7 @@ SkImageFilter* SkLightingImageFilter::CreateDistantLitDiffuse(const SkPoint3& di
                                                               SkScalar kd,
                                                               SkImageFilter* input,
                                                               const CropRect* cropRect) {
-    SkAutoTUnref<SkImageFilterLight> light(SkNEW_ARGS(SkDistantLight, (direction, lightColor)));
+    SkAutoTUnref<SkImageFilterLight> light(new SkDistantLight(direction, lightColor));
     return SkDiffuseLightingImageFilter::Create(light, surfaceScale, kd, input, cropRect);
 }
 
@@ -1075,7 +1067,7 @@ SkImageFilter* SkLightingImageFilter::CreatePointLitDiffuse(const SkPoint3& loca
                                                             SkScalar kd,
                                                             SkImageFilter* input,
                                                             const CropRect* cropRect) {
-    SkAutoTUnref<SkImageFilterLight> light(SkNEW_ARGS(SkPointLight, (location, lightColor)));
+    SkAutoTUnref<SkImageFilterLight> light(new SkPointLight(location, lightColor));
     return SkDiffuseLightingImageFilter::Create(light, surfaceScale, kd, input, cropRect);
 }
 
@@ -1088,9 +1080,8 @@ SkImageFilter* SkLightingImageFilter::CreateSpotLitDiffuse(const SkPoint3& locat
                                                            SkScalar kd,
                                                            SkImageFilter* input,
                                                            const CropRect* cropRect) {
-    SkAutoTUnref<SkImageFilterLight> light(SkNEW_ARGS(SkSpotLight, (location, target,
-                                                                    specularExponent,
-                                                                    cutoffAngle, lightColor)));
+    SkAutoTUnref<SkImageFilterLight> light(
+            new SkSpotLight(location, target, specularExponent, cutoffAngle, lightColor));
     return SkDiffuseLightingImageFilter::Create(light, surfaceScale, kd, input, cropRect);
 }
 
@@ -1101,7 +1092,7 @@ SkImageFilter* SkLightingImageFilter::CreateDistantLitSpecular(const SkPoint3& d
                                                                SkScalar shine,
                                                                SkImageFilter* input,
                                                                const CropRect* cropRect) {
-    SkAutoTUnref<SkImageFilterLight> light(SkNEW_ARGS(SkDistantLight, (direction, lightColor)));
+    SkAutoTUnref<SkImageFilterLight> light(new SkDistantLight(direction, lightColor));
     return SkSpecularLightingImageFilter::Create(light, surfaceScale, ks, shine, input, cropRect);
 }
 
@@ -1112,7 +1103,7 @@ SkImageFilter* SkLightingImageFilter::CreatePointLitSpecular(const SkPoint3& loc
                                                              SkScalar shine,
                                                              SkImageFilter* input,
                                                              const CropRect* cropRect) {
-    SkAutoTUnref<SkImageFilterLight> light(SkNEW_ARGS(SkPointLight, (location, lightColor)));
+    SkAutoTUnref<SkImageFilterLight> light(new SkPointLight(location, lightColor));
     return SkSpecularLightingImageFilter::Create(light, surfaceScale, ks, shine, input, cropRect);
 }
 
@@ -1126,9 +1117,8 @@ SkImageFilter* SkLightingImageFilter::CreateSpotLitSpecular(const SkPoint3& loca
                                                             SkScalar shine,
                                                             SkImageFilter* input,
                                                             const CropRect* cropRect) {
-    SkAutoTUnref<SkImageFilterLight> light(SkNEW_ARGS(SkSpotLight, (location, target,
-                                                                    specularExponent,
-                                                                    cutoffAngle, lightColor)));
+    SkAutoTUnref<SkImageFilterLight> light(
+            new SkSpotLight(location, target, specularExponent, cutoffAngle, lightColor));
     return SkSpecularLightingImageFilter::Create(light, surfaceScale, ks, shine, input, cropRect);
 }
 
@@ -1158,7 +1148,7 @@ SkImageFilter* SkDiffuseLightingImageFilter::Create(SkImageFilterLight* light,
     if (kd < 0) {
         return NULL;
     }
-    return SkNEW_ARGS(SkDiffuseLightingImageFilter, (light, surfaceScale, kd, input, cropRect));
+    return new SkDiffuseLightingImageFilter(light, surfaceScale, kd, input, cropRect);
 }
 
 SkDiffuseLightingImageFilter::SkDiffuseLightingImageFilter(SkImageFilterLight* light,
@@ -1294,8 +1284,7 @@ SkImageFilter* SkSpecularLightingImageFilter::Create(SkImageFilterLight* light,
     if (ks < 0) {
         return NULL;
     }
-    return SkNEW_ARGS(SkSpecularLightingImageFilter,
-                      (light, surfaceScale, ks, shininess, input, cropRect));
+    return new SkSpecularLightingImageFilter(light, surfaceScale, ks, shininess, input, cropRect);
 }
 
 SkSpecularLightingImageFilter::SkSpecularLightingImageFilter(SkImageFilterLight* light,
@@ -1429,17 +1418,14 @@ SkImageFilterLight* create_random_light(SkRandom* random) {
     int type = random->nextULessThan(3);
     switch (type) {
         case 0: {
-            return SkNEW_ARGS(SkDistantLight, (random_point3(random), random->nextU()));
+            return new SkDistantLight(random_point3(random), random->nextU());
         }
         case 1: {
-            return SkNEW_ARGS(SkPointLight, (random_point3(random), random->nextU()));
+            return new SkPointLight(random_point3(random), random->nextU());
         }
         case 2: {
-            return SkNEW_ARGS(SkSpotLight, (random_point3(random),
-                                            random_point3(random),
-                                            random->nextUScalar1(),
-                                            random->nextUScalar1(),
-                                            random->nextU()));
+            return new SkSpotLight(random_point3(random), random_point3(random),
+                                   random->nextUScalar1(), random->nextUScalar1(), random->nextU());
         }
         default:
             SkFAIL("Unexpected value.");
@@ -1638,7 +1624,7 @@ void GrDiffuseLightingEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLFragmentProcessor* GrDiffuseLightingEffect::onCreateGLInstance() const {
-    return SkNEW_ARGS(GrGLDiffuseLightingEffect, (*this));
+    return new GrGLDiffuseLightingEffect(*this);
 }
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrDiffuseLightingEffect);
@@ -1841,7 +1827,7 @@ void GrSpecularLightingEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLFragmentProcessor* GrSpecularLightingEffect::onCreateGLInstance() const {
-    return SkNEW_ARGS(GrGLSpecularLightingEffect, (*this));
+    return new GrGLSpecularLightingEffect(*this);
 }
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrSpecularLightingEffect);
index 8d5181a..caa2a20 100644 (file)
@@ -37,15 +37,11 @@ void SkLumaColorFilter::filterSpan(const SkPMColor src[], int count,
     }
 }
 
-SkColorFilter* SkLumaColorFilter::Create() {
-    return SkNEW(SkLumaColorFilter);
-}
+SkColorFilter* SkLumaColorFilter::Create() { return new SkLumaColorFilter; }
 
 SkLumaColorFilter::SkLumaColorFilter() : INHERITED() {}
 
-SkFlattenable* SkLumaColorFilter::CreateProc(SkReadBuffer&) {
-    return SkNEW(SkLumaColorFilter);
-}
+SkFlattenable* SkLumaColorFilter::CreateProc(SkReadBuffer&) { return new SkLumaColorFilter; }
 
 void SkLumaColorFilter::flatten(SkWriteBuffer&) const {}
 
@@ -96,9 +92,7 @@ private:
         this->initClassID<LumaColorFilterEffect>();
     }
 
-    GrGLFragmentProcessor* onCreateGLInstance() const override {
-        return SkNEW_ARGS(GLProcessor, (*this));
-    }
+    GrGLFragmentProcessor* onCreateGLInstance() const override { return new GLProcessor(*this); }
 
     virtual void onGetGLProcessorKey(const GrGLSLCaps& caps,
                                      GrProcessorKeyBuilder* b) const override {
index baa1926..8bebd20 100644 (file)
@@ -32,15 +32,8 @@ public:
                                        float yInvZoom,
                                        float xInvInset,
                                        float yInvInset) {
-        return SkNEW_ARGS(GrMagnifierEffect, (procDataManager,
-                                              texture,
-                                              bounds,
-                                              xOffset,
-                                              yOffset,
-                                              xInvZoom,
-                                              yInvZoom,
-                                              xInvInset,
-                                              yInvInset));
+        return new GrMagnifierEffect(procDataManager, texture, bounds, xOffset, yOffset, xInvZoom,
+                                     yInvZoom, xInvInset, yInvInset);
     }
 
     virtual ~GrMagnifierEffect() {};
@@ -197,7 +190,7 @@ void GrMagnifierEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLFragmentProcessor* GrMagnifierEffect::onCreateGLInstance() const {
-    return SkNEW_ARGS(GrGLMagnifierEffect, (*this));
+    return new GrGLMagnifierEffect(*this);
 }
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrMagnifierEffect);
@@ -258,7 +251,7 @@ SkImageFilter* SkMagnifierImageFilter::Create(const SkRect& srcRect, SkScalar in
     if (srcRect.fLeft < 0 || srcRect.fTop < 0) {
         return NULL;
     }
-    return SkNEW_ARGS(SkMagnifierImageFilter, (srcRect, inset, input));
+    return new SkMagnifierImageFilter(srcRect, inset, input);
 }
 
 
index 92ac934..1c44fed 100644 (file)
@@ -39,7 +39,7 @@ SkMatrixConvolutionImageFilter::SkMatrixConvolutionImageFilter(
     fTileMode(tileMode),
     fConvolveAlpha(convolveAlpha) {
     size_t size = (size_t) sk_64_mul(fKernelSize.width(), fKernelSize.height());
-    fKernel = SkNEW_ARRAY(SkScalar, size);
+    fKernel = new SkScalar[size];
     memcpy(fKernel, kernel, size * sizeof(SkScalar));
     SkASSERT(kernelSize.fWidth >= 1 && kernelSize.fHeight >= 1);
     SkASSERT(kernelOffset.fX >= 0 && kernelOffset.fX < kernelSize.fWidth);
@@ -69,9 +69,8 @@ SkMatrixConvolutionImageFilter* SkMatrixConvolutionImageFilter::Create(
         (kernelOffset.fY < 0) || (kernelOffset.fY >= kernelSize.fHeight)) {
         return NULL;
     }
-    return SkNEW_ARGS(SkMatrixConvolutionImageFilter, (kernelSize, kernel, gain, bias,
-                                                       kernelOffset, tileMode, convolveAlpha,
-                                                       input, cropRect));
+    return new SkMatrixConvolutionImageFilter(kernelSize, kernel, gain, bias, kernelOffset,
+                                              tileMode, convolveAlpha, input, cropRect);
 }
 
 SkFlattenable* SkMatrixConvolutionImageFilter::CreateProc(SkReadBuffer& buffer) {
index 01e978e..7d6bfff 100644 (file)
@@ -207,13 +207,13 @@ public:
 
     static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, GrTexture* tex,
                                        Direction dir, int radius, MorphologyType type) {
-        return SkNEW_ARGS(GrMorphologyEffect, (procDataManager, tex, dir, radius, type));
+        return new GrMorphologyEffect(procDataManager, tex, dir, radius, type);
     }
 
     static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, GrTexture* tex,
                                        Direction dir, int radius, MorphologyType type,
                                        float bounds[2]) {
-        return SkNEW_ARGS(GrMorphologyEffect, (procDataManager, tex, dir, radius, type, bounds));
+        return new GrMorphologyEffect(procDataManager, tex, dir, radius, type, bounds);
     }
 
     virtual ~GrMorphologyEffect();
@@ -425,7 +425,7 @@ void GrMorphologyEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessor
 }
 
 GrGLFragmentProcessor* GrMorphologyEffect::onCreateGLInstance() const {
-    return SkNEW_ARGS(GrGLMorphologyEffect, (*this));
+    return new GrGLMorphologyEffect(*this);
 }
 bool GrMorphologyEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
     const GrMorphologyEffect& s = sBase.cast<GrMorphologyEffect>();
index 501e636..2ca86c7 100644 (file)
@@ -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;
index 4596253..6309d35 100644 (file)
@@ -20,12 +20,12 @@ SkRectShaderImageFilter* SkRectShaderImageFilter::Create(SkShader* s, const SkRe
         flags = 0x0;
     }
     CropRect cropRect(rect, flags);
-    return s ? SkNEW_ARGS(SkRectShaderImageFilter, (s, &cropRect)) : NULL;
+    return s ? new SkRectShaderImageFilter(s, &cropRect) : NULL;
 }
 
 SkRectShaderImageFilter* SkRectShaderImageFilter::Create(SkShader* s, const CropRect* cropRect) {
     SkASSERT(s);
-    return s ? SkNEW_ARGS(SkRectShaderImageFilter, (s, cropRect)) : NULL;
+    return s ? new SkRectShaderImageFilter(s, cropRect) : NULL;
 }
 
 SkRectShaderImageFilter::SkRectShaderImageFilter(SkShader* s, const CropRect* cropRect)
index f39e88a..e20f922 100644 (file)
@@ -42,9 +42,7 @@ public:
         }
     }
 
-    virtual ~SkTable_ColorFilter() {
-        SkDELETE(fBitmap);
-    }
+    virtual ~SkTable_ColorFilter() { delete fBitmap; }
 
     bool asComponentTable(SkBitmap* table) const override;
     SkColorFilter* newComposed(const SkColorFilter* inner) const override;
@@ -259,7 +257,7 @@ SkFlattenable* SkTable_ColorFilter::CreateProc(SkReadBuffer& buffer) {
 bool SkTable_ColorFilter::asComponentTable(SkBitmap* table) const {
     if (table) {
         if (NULL == fBitmap) {
-            SkBitmap* bmp = SkNEW(SkBitmap);
+            SkBitmap* bmp = new SkBitmap;
             bmp->allocPixels(SkImageInfo::MakeA8(256, 4));
             uint8_t* bitmapPixels = bmp->getAddr8(0, 0);
             int offset = 0;
@@ -482,7 +480,7 @@ GrFragmentProcessor* ColorTableEffect::Create(GrContext* context, SkBitmap bitma
         texture.reset(SkRef(atlas->getTexture()));
     }
 
-    return SkNEW_ARGS(ColorTableEffect, (texture, atlas, row, flags));
+    return new ColorTableEffect(texture, atlas, row, flags);
 }
 
 ColorTableEffect::ColorTableEffect(GrTexture* texture, GrTextureStripAtlas* atlas, int row,
@@ -507,7 +505,7 @@ void ColorTableEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLFragmentProcessor* ColorTableEffect::onCreateGLInstance() const {
-    return SkNEW_ARGS(GLColorTableEffect, (*this));
+    return new GLColorTableEffect(*this);
 }
 
 bool ColorTableEffect::onIsEqual(const GrFragmentProcessor& other) const {
@@ -607,14 +605,14 @@ bool SkTable_ColorFilter::asFragmentProcessors(GrContext* context,
 ///////////////////////////////////////////////////////////////////////////////
 
 SkColorFilter* SkTableColorFilter::Create(const uint8_t table[256]) {
-    return SkNEW_ARGS(SkTable_ColorFilter, (table, table, table, table));
+    return new SkTable_ColorFilter(table, table, table, table);
 }
 
 SkColorFilter* SkTableColorFilter::CreateARGB(const uint8_t tableA[256],
                                               const uint8_t tableR[256],
                                               const uint8_t tableG[256],
                                               const uint8_t tableB[256]) {
-    return SkNEW_ARGS(SkTable_ColorFilter, (tableA, tableR, tableG, tableB));
+    return new SkTable_ColorFilter(tableA, tableR, tableG, tableB);
 }
 
 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkTableColorFilter)
index 2b7ed94..9292b26 100644 (file)
@@ -21,7 +21,7 @@ SkTileImageFilter* SkTileImageFilter::Create(const SkRect& srcRect, const SkRect
     if (!SkIsValidRect(srcRect) || !SkIsValidRect(dstRect)) {
         return NULL;
     }
-    return SkNEW_ARGS(SkTileImageFilter, (srcRect, dstRect, input));
+    return new SkTileImageFilter(srcRect, dstRect, input);
 }
 
 bool SkTileImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src,
index 63d708b..90fa3d5 100644 (file)
@@ -108,7 +108,7 @@ void SkGradientBitmapCache::add(const void* buffer, size_t len, const SkBitmap&
         fEntryCount -= 1;
     }
 
-    Entry* entry = SkNEW_ARGS(Entry, (buffer, len, bm));
+    Entry* entry = new Entry(buffer, len, bm);
     this->attachToHead(entry);
     fEntryCount += 1;
 }
index ebfa75f..8bef3e3 100644 (file)
@@ -597,7 +597,7 @@ void SkGradientShaderBase::GradientShaderCache::initCache32(GradientShaderCache*
 SkGradientShaderBase::GradientShaderCache* SkGradientShaderBase::refCache(U8CPU alpha) const {
     SkAutoMutexAcquire ama(fCacheMutex);
     if (!fCache || fCache->getAlpha() != alpha) {
-        fCache.reset(SkNEW_ARGS(GradientShaderCache, (alpha, *this)));
+        fCache.reset(new GradientShaderCache(alpha, *this));
     }
     // Increment the ref counter inside the mutex to ensure the returned pointer is still valid.
     // Otherwise, the pointer may have been overwritten on a different thread before the object's
@@ -648,7 +648,7 @@ void SkGradientShaderBase::getGradientTableBitmap(SkBitmap* bitmap) const {
     SkAutoMutexAcquire ama(gGradientCacheMutex);
 
     if (NULL == gCache) {
-        gCache = SkNEW_ARGS(SkGradientBitmapCache, (MAX_NUM_CACHED_GRADIENT_BITMAPS));
+        gCache = new SkGradientBitmapCache(MAX_NUM_CACHED_GRADIENT_BITMAPS);
     }
     size_t size = count * sizeof(int32_t);
 
@@ -779,7 +779,7 @@ SkShader* SkGradientShader::CreateLinear(const SkPoint pts[2],
 
     SkGradientShaderBase::Descriptor desc;
     desc_init(&desc, colors, pos, colorCount, mode, flags, localMatrix);
-    return SkNEW_ARGS(SkLinearGradient, (pts, desc));
+    return new SkLinearGradient(pts, desc);
 }
 
 SkShader* SkGradientShader::CreateRadial(const SkPoint& center, SkScalar radius,
@@ -798,7 +798,7 @@ SkShader* SkGradientShader::CreateRadial(const SkPoint& center, SkScalar radius,
 
     SkGradientShaderBase::Descriptor desc;
     desc_init(&desc, colors, pos, colorCount, mode, flags, localMatrix);
-    return SkNEW_ARGS(SkRadialGradient, (center, radius, desc));
+    return new SkRadialGradient(center, radius, desc);
 }
 
 SkShader* SkGradientShader::CreateTwoPointConical(const SkPoint& start,
@@ -829,8 +829,8 @@ SkShader* SkGradientShader::CreateTwoPointConical(const SkPoint& start,
 
     if (!flipGradient) {
         desc_init(&desc, colors, pos, colorCount, mode, flags, localMatrix);
-        return SkNEW_ARGS(SkTwoPointConicalGradient,
-                          (start, startRadius, end, endRadius, flipGradient, desc));
+        return new SkTwoPointConicalGradient(start, startRadius, end, endRadius, flipGradient,
+                                             desc);
     } else {
         SkAutoSTArray<8, SkColor> colorsNew(colorCount);
         SkAutoSTArray<8, SkScalar> posNew(colorCount);
@@ -847,8 +847,8 @@ SkShader* SkGradientShader::CreateTwoPointConical(const SkPoint& start,
             desc_init(&desc, colorsNew.get(), NULL, colorCount, mode, flags, localMatrix);
         }
 
-        return SkNEW_ARGS(SkTwoPointConicalGradient,
-                          (end, endRadius, start, startRadius, flipGradient, desc));
+        return new SkTwoPointConicalGradient(end, endRadius, start, startRadius, flipGradient,
+                                             desc);
     }
 }
 
@@ -865,7 +865,7 @@ SkShader* SkGradientShader::CreateSweep(SkScalar cx, SkScalar cy,
 
     SkGradientShaderBase::Descriptor desc;
     desc_init(&desc, colors, pos, colorCount, SkShader::kClamp_TileMode, flags, localMatrix);
-    return SkNEW_ARGS(SkSweepGradient, (cx, cy, desc));
+    return new SkSweepGradient(cx, cy, desc);
 }
 
 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkGradientShader)
index d9b4a5c..a5be417 100644 (file)
@@ -83,7 +83,7 @@ size_t SkLinearGradient::contextSize() const {
 }
 
 SkShader::Context* SkLinearGradient::onCreateContext(const ContextRec& rec, void* storage) const {
-    return SkNEW_PLACEMENT_ARGS(storage, LinearGradientContext, (*this, rec));
+    return new (storage) LinearGradientContext(*this, rec);
 }
 
 SkLinearGradient::LinearGradientContext::LinearGradientContext(
@@ -472,7 +472,7 @@ public:
                                        const SkLinearGradient& shader,
                                        const SkMatrix& matrix,
                                        SkShader::TileMode tm) {
-        return SkNEW_ARGS(GrLinearGradient, (ctx, procDataManager, shader, matrix, tm));
+        return new GrLinearGradient(ctx, procDataManager, shader, matrix, tm);
     }
 
     virtual ~GrLinearGradient() { }
@@ -490,7 +490,7 @@ private:
     }
 
     GrGLFragmentProcessor* onCreateGLInstance() const override {
-        return SkNEW_ARGS(GrGLLinearGradient, (*this));
+        return new GrGLLinearGradient(*this);
     }
 
     virtual void onGetGLProcessorKey(const GrGLSLCaps& caps,
index 1b995cb..7e24949 100644 (file)
@@ -160,7 +160,7 @@ size_t SkRadialGradient::contextSize() const {
 }
 
 SkShader::Context* SkRadialGradient::onCreateContext(const ContextRec& rec, void* storage) const {
-    return SkNEW_PLACEMENT_ARGS(storage, RadialGradientContext, (*this, rec));
+    return new (storage) RadialGradientContext(*this, rec);
 }
 
 SkRadialGradient::RadialGradientContext::RadialGradientContext(
@@ -444,7 +444,7 @@ public:
                                        const SkRadialGradient& shader,
                                        const SkMatrix& matrix,
                                        SkShader::TileMode tm) {
-        return SkNEW_ARGS(GrRadialGradient, (ctx, procDataManager, shader, matrix, tm));
+        return new GrRadialGradient(ctx, procDataManager, shader, matrix, tm);
     }
 
     virtual ~GrRadialGradient() { }
@@ -462,7 +462,7 @@ private:
     }
 
     GrGLFragmentProcessor* onCreateGLInstance() const override {
-        return SkNEW_ARGS(GrGLRadialGradient, (*this));
+        return new GrGLRadialGradient(*this);
     }
 
     virtual void onGetGLProcessorKey(const GrGLSLCaps& caps,
index 22bf68e..9e44b70 100644 (file)
@@ -50,7 +50,7 @@ size_t SkSweepGradient::contextSize() const {
 }
 
 SkShader::Context* SkSweepGradient::onCreateContext(const ContextRec& rec, void* storage) const {
-    return SkNEW_PLACEMENT_ARGS(storage, SweepGradientContext, (*this, rec));
+    return new (storage) SweepGradientContext(*this, rec);
 }
 
 SkSweepGradient::SweepGradientContext::SweepGradientContext(
@@ -193,7 +193,7 @@ class GrSweepGradient : public GrGradientEffect {
 public:
     static GrFragmentProcessor* Create(GrContext* ctx, GrProcessorDataManager* procDataManager,
                                        const SkSweepGradient& shader, const SkMatrix& m) {
-        return SkNEW_ARGS(GrSweepGradient, (ctx, procDataManager, shader, m));
+        return new GrSweepGradient(ctx, procDataManager, shader, m);
     }
     virtual ~GrSweepGradient() { }
 
@@ -209,7 +209,7 @@ private:
     }
 
     GrGLFragmentProcessor* onCreateGLInstance() const override {
-        return SkNEW_ARGS(GrGLSweepGradient, (*this));
+        return new GrGLSweepGradient(*this);
     }
 
     virtual void onGetGLProcessorKey(const GrGLSLCaps& caps,
index 1cdb19e..7e5edf2 100644 (file)
@@ -217,7 +217,7 @@ size_t SkTwoPointConicalGradient::contextSize() const {
 
 SkShader::Context* SkTwoPointConicalGradient::onCreateContext(const ContextRec& rec,
                                                               void* storage) const {
-    return SkNEW_PLACEMENT_ARGS(storage, TwoPointConicalGradientContext, (*this, rec));
+    return new (storage) TwoPointConicalGradientContext(*this, rec);
 }
 
 SkTwoPointConicalGradient::TwoPointConicalGradientContext::TwoPointConicalGradientContext(
index 6f60482..cdc1862 100644 (file)
@@ -63,7 +63,7 @@ public:
                                        const SkTwoPointConicalGradient& shader,
                                        const SkMatrix& matrix,
                                        SkShader::TileMode tm) {
-        return SkNEW_ARGS(Edge2PtConicalEffect, (ctx, procDataManager, shader, matrix, tm));
+        return new Edge2PtConicalEffect(ctx, procDataManager, shader, matrix, tm);
     }
 
     virtual ~Edge2PtConicalEffect() {}
@@ -175,7 +175,7 @@ void Edge2PtConicalEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLFragmentProcessor* Edge2PtConicalEffect::onCreateGLInstance() const {
-    return SkNEW_ARGS(GLEdge2PtConicalEffect, (*this));
+    return new GLEdge2PtConicalEffect(*this);
 }
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(Edge2PtConicalEffect);
@@ -376,8 +376,7 @@ public:
                                        const SkMatrix& matrix,
                                        SkShader::TileMode tm,
                                        SkScalar focalX) {
-        return SkNEW_ARGS(FocalOutside2PtConicalEffect, (ctx, procDataManager, shader, matrix, tm,
-                                                         focalX));
+        return new FocalOutside2PtConicalEffect(ctx, procDataManager, shader, matrix, tm, focalX);
     }
 
     virtual ~FocalOutside2PtConicalEffect() { }
@@ -458,7 +457,7 @@ void FocalOutside2PtConicalEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLFragmentProcessor* FocalOutside2PtConicalEffect::onCreateGLInstance() const {
-    return SkNEW_ARGS(GLFocalOutside2PtConicalEffect, (*this));
+    return new GLFocalOutside2PtConicalEffect(*this);
 }
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(FocalOutside2PtConicalEffect);
@@ -593,8 +592,7 @@ public:
                                        const SkMatrix& matrix,
                                        SkShader::TileMode tm,
                                        SkScalar focalX) {
-        return SkNEW_ARGS(FocalInside2PtConicalEffect, (ctx, procDataManager, shader, matrix, tm,
-                                                        focalX));
+        return new FocalInside2PtConicalEffect(ctx, procDataManager, shader, matrix, tm, focalX);
     }
 
     virtual ~FocalInside2PtConicalEffect() {}
@@ -670,7 +668,7 @@ void FocalInside2PtConicalEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLFragmentProcessor* FocalInside2PtConicalEffect::onCreateGLInstance() const {
-    return SkNEW_ARGS(GLFocalInside2PtConicalEffect, (*this));
+    return new GLFocalInside2PtConicalEffect(*this);
 }
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(FocalInside2PtConicalEffect);
@@ -832,8 +830,7 @@ public:
                                        const SkMatrix& matrix,
                                        SkShader::TileMode tm,
                                        const CircleConicalInfo& info) {
-        return SkNEW_ARGS(CircleInside2PtConicalEffect, (ctx, procDataManager, shader, matrix, tm,
-                                                         info));
+        return new CircleInside2PtConicalEffect(ctx, procDataManager, shader, matrix, tm, info);
     }
 
     virtual ~CircleInside2PtConicalEffect() {}
@@ -918,7 +915,7 @@ void CircleInside2PtConicalEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLFragmentProcessor* CircleInside2PtConicalEffect::onCreateGLInstance() const {
-    return SkNEW_ARGS(GLCircleInside2PtConicalEffect, (*this));
+    return new GLCircleInside2PtConicalEffect(*this);
 }
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(CircleInside2PtConicalEffect);
@@ -1049,8 +1046,7 @@ public:
                                        const SkMatrix& matrix,
                                        SkShader::TileMode tm,
                                        const CircleConicalInfo& info) {
-        return SkNEW_ARGS(CircleOutside2PtConicalEffect, (ctx, procDataManager, shader, matrix,
-                                                          tm, info));
+        return new CircleOutside2PtConicalEffect(ctx, procDataManager, shader, matrix, tm, info);
     }
 
     virtual ~CircleOutside2PtConicalEffect() {}
@@ -1150,7 +1146,7 @@ void CircleOutside2PtConicalEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLFragmentProcessor* CircleOutside2PtConicalEffect::onCreateGLInstance() const {
-    return SkNEW_ARGS(GLCircleOutside2PtConicalEffect, (*this));
+    return new GLCircleOutside2PtConicalEffect(*this);
 }
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(CircleOutside2PtConicalEffect);
index 0873aa1..72a5a61 100644 (file)
@@ -180,7 +180,7 @@ static SkFontStyle make_fontconfig_style(FcPattern* match) {
 
 SkFontStyleSet_FC::SkFontStyleSet_FC(FcPattern** matches, int count) {
     fRecCount = count;
-    fRecs = SkNEW_ARRAY(Rec, count);
+    fRecs = new Rec[count];
     for (int i = 0; i < count; ++i) {
         fRecs[i].fStyleName.set(get_name(matches[i], FC_STYLE));
         fRecs[i].fFileName.set(get_name(matches[i], FC_FILE));
@@ -188,9 +188,7 @@ SkFontStyleSet_FC::SkFontStyleSet_FC(FcPattern** matches, int count) {
     }
 }
 
-SkFontStyleSet_FC::~SkFontStyleSet_FC() {
-    SkDELETE_ARRAY(fRecs);
-}
+SkFontStyleSet_FC::~SkFontStyleSet_FC() { delete[] fRecs; }
 
 void SkFontStyleSet_FC::getStyle(int index, SkFontStyle* style,
                                  SkString* styleName) {
@@ -277,9 +275,8 @@ protected:
             }
         }
 
-        SkFontStyleSet_FC* sset = SkNEW_ARGS(SkFontStyleSet_FC,
-                                             (trimmedMatches.begin(),
-                                              trimmedMatches.count()));
+        SkFontStyleSet_FC* sset =
+                new SkFontStyleSet_FC(trimmedMatches.begin(), trimmedMatches.count());
         return sset;
     }
 
@@ -330,5 +327,5 @@ protected:
 
 SkFontMgr* SkFontMgr::Factory() {
     SkFontConfigInterface* fci = RefFCI();
-    return fci ? SkNEW_ARGS(SkFontMgr_fontconfig, (fci)) : NULL;
+    return fci ? new SkFontMgr_fontconfig(fci) : NULL;
 }
index 6ad8bfb..33c79c8 100644 (file)
@@ -178,11 +178,11 @@ SkFontStyleSet* SkFontMgr_Indirect::onCreateStyleSet(int index) const {
     if (NULL == set) {
         return NULL;
     }
-    return SkNEW_ARGS(SkStyleSet_Indirect, (this, index, set));
+    return new SkStyleSet_Indirect(this, index, set);
 }
 
 SkFontStyleSet* SkFontMgr_Indirect::onMatchFamily(const char familyName[]) const {
-    return SkNEW_ARGS(SkStyleSet_Indirect, (this, -1, fProxy->matchName(familyName)));
+    return new SkStyleSet_Indirect(this, -1, fProxy->matchName(familyName));
 }
 
 SkTypeface* SkFontMgr_Indirect::createTypefaceFromFontId(const SkFontIdentity& id) const {
index 5787478..d2d0cac 100644 (file)
@@ -63,9 +63,7 @@ SkGScalerContext::SkGScalerContext(SkGTypeface* face, const SkDescriptor* desc)
     fMatrix.preScale(SK_Scalar1 / STD_SIZE, SK_Scalar1 / STD_SIZE);
 }
 
-SkGScalerContext::~SkGScalerContext() {
-    SkDELETE(fProxy);
-}
+SkGScalerContext::~SkGScalerContext() { delete fProxy; }
 
 unsigned SkGScalerContext::generateGlyphCount() {
     return fProxy->getGlyphCount();
@@ -168,7 +166,7 @@ SkGTypeface::~SkGTypeface() {
 
 SkScalerContext* SkGTypeface::onCreateScalerContext(
                                             const SkDescriptor* desc) const {
-    return SkNEW_ARGS(SkGScalerContext, (const_cast<SkGTypeface*>(this), desc));
+    return new SkGScalerContext(const_cast<SkGTypeface*>(this), desc);
 }
 
 void SkGTypeface::onFilterRec(SkScalerContextRec* rec) const {
index 799e51d..1f6fbe0 100644 (file)
@@ -43,9 +43,7 @@ SkRandomScalerContext::SkRandomScalerContext(SkRandomTypeface* face, const SkDes
     fProxy = face->proxy()->createScalerContext(desc);
 }
 
-SkRandomScalerContext::~SkRandomScalerContext() {
-    SkDELETE(fProxy);
-}
+SkRandomScalerContext::~SkRandomScalerContext() { delete fProxy; }
 
 unsigned SkRandomScalerContext::generateGlyphCount() {
     return fProxy->getGlyphCount();
@@ -201,7 +199,7 @@ SkRandomTypeface::~SkRandomTypeface() {
 
 SkScalerContext* SkRandomTypeface::onCreateScalerContext(
                                             const SkDescriptor* desc) const {
-    return SkNEW_ARGS(SkRandomScalerContext, (const_cast<SkRandomTypeface*>(this), desc, fFakeIt));
+    return new SkRandomScalerContext(const_cast<SkRandomTypeface*>(this), desc, fFakeIt);
 }
 
 void SkRandomTypeface::onFilterRec(SkScalerContextRec* rec) const {
index 3681f2c..5299fad 100644 (file)
@@ -18,7 +18,7 @@ SkRemotableFontIdentitySet::SkRemotableFontIdentitySet(int count, SkFontIdentity
 
 // As a template argument, this must have external linkage.
 SkRemotableFontIdentitySet* sk_remotable_font_identity_set_new() {
-    return SkNEW(SkRemotableFontIdentitySet);
+    return new SkRemotableFontIdentitySet;
 }
 
 SK_DECLARE_STATIC_LAZY_PTR(SkRemotableFontIdentitySet, empty, sk_remotable_font_identity_set_new);
index 8038b03..ee78381 100644 (file)
@@ -35,9 +35,9 @@ SkTestFont::SkTestFont(const SkTestFontData& fontData)
 
 SkTestFont::~SkTestFont() {
     for (unsigned index = 0; index < fCharCodesCount; ++index) {
-        SkDELETE(fPaths[index]);
+        delete fPaths[index];
     }
-    SkDELETE_ARRAY(fPaths);
+    delete[] fPaths;
 }
 
 #ifdef SK_DEBUG
@@ -78,9 +78,9 @@ int SkTestFont::codeToIndex(SkUnichar charCode) const {
 }
 
 void SkTestFont::init(const SkScalar* pts, const unsigned char* verbs) {
-    fPaths = SkNEW_ARRAY(SkPath*, fCharCodesCount);
+    fPaths = new SkPath* [fCharCodesCount];
     for (unsigned index = 0; index < fCharCodesCount; ++index) {
-        SkPath* path = SkNEW(SkPath);
+        SkPath* path = new SkPath;
         SkPath::Verb verb;
         while ((verb = (SkPath::Verb) *verbs++) != SkPath::kDone_Verb) {
             switch (verb) {
@@ -280,5 +280,5 @@ private:
 };
 
 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc) const {
-    return SkNEW_ARGS(SkTestScalerContext, (const_cast<SkTestTypeface*>(this), desc));
+    return new SkTestScalerContext(const_cast<SkTestTypeface*>(this), desc);
 }
index 0eabe66..668a09a 100644 (file)
@@ -528,7 +528,7 @@ public:
 
     static GrGeometryProcessor* Create(GrColor color, const SkMatrix& localMatrix,
                                        bool usesLocalCoords) {
-        return SkNEW_ARGS(QuadEdgeEffect, (color, localMatrix, usesLocalCoords));
+        return new QuadEdgeEffect(color, localMatrix, usesLocalCoords);
     }
 
     virtual ~QuadEdgeEffect() {}
@@ -642,7 +642,7 @@ public:
 
     virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
                                                      const GrGLSLCaps&) const override {
-        return SkNEW_ARGS(GLProcessor, (*this, bt));
+        return new GLProcessor(*this, bt);
     }
 
 private:
@@ -747,9 +747,7 @@ public:
         SkPath fPath;
     };
 
-    static GrDrawBatch* Create(const Geometry& geometry) {
-        return SkNEW_ARGS(AAConvexPathBatch, (geometry));
-    }
+    static GrDrawBatch* Create(const Geometry& geometry) { return new AAConvexPathBatch(geometry); }
 
     const char* name() const override { return "AAConvexBatch"; }
 
index db10086..c111b8b 100644 (file)
@@ -408,7 +408,7 @@ bool GrAAConvexTessellator::extractFromPath(const SkMatrix& m, const SkPath& pat
 
 GrAAConvexTessellator::Ring* GrAAConvexTessellator::getNextRing(Ring* lastRing) {
 #if GR_AA_CONVEX_TESSELLATOR_VIZ
-    Ring* ring = *fRings.push() = SkNEW(Ring);
+    Ring* ring = *fRings.push() = new Ring;
     ring->setReserve(fInitialRing.numPts());
     ring->rewind();
     return ring;
old mode 100755 (executable)
new mode 100644 (file)
index 905bde9..7a51149
@@ -53,7 +53,7 @@ void GrAADistanceFieldPathRenderer::HandleEviction(GrBatchAtlas::AtlasID id, voi
         if (id == pathData->fID) {
             dfpr->fPathCache.remove(pathData->fKey);
             dfpr->fPathList.remove(pathData);
-            SkDELETE(pathData);
+            delete pathData;
 #ifdef DF_PATH_TRACKING
             ++g_NumFreedPaths;
 #endif
@@ -71,9 +71,9 @@ GrAADistanceFieldPathRenderer::~GrAADistanceFieldPathRenderer() {
     while ((pathData = iter.get())) {
         iter.next();
         fPathList.remove(pathData);
-        SkDELETE(pathData);
+        delete pathData;
     }
-    SkDELETE(fAtlas);
+    delete fAtlas;
 
 #ifdef DF_PATH_TRACKING
     SkDebugf("Cached paths: %d, freed paths: %d\n", g_NumCachedPaths, g_NumFreedPaths);
@@ -125,8 +125,8 @@ public:
 
     static GrDrawBatch* Create(const Geometry& geometry, GrColor color, const SkMatrix& viewMatrix,
                                GrBatchAtlas* atlas, PathCache* pathCache, PathDataList* pathList) {
-        return SkNEW_ARGS(AADistanceFieldPathBatch, (geometry, color, viewMatrix,
-                                                     atlas, pathCache, pathList));
+        return new AADistanceFieldPathBatch(geometry, color, viewMatrix, atlas, pathCache,
+                                            pathList);
     }
 
     const char* name() const override { return "AADistanceFieldPathBatch"; }
@@ -231,10 +231,10 @@ private:
                 if (args.fPathData) {
                     fPathCache->remove(args.fPathData->fKey);
                     fPathList->remove(args.fPathData);
-                    SkDELETE(args.fPathData);
+                    delete args.fPathData;
                 }
                 SkScalar scale = desiredDimension/maxDim;
-                args.fPathData = SkNEW(PathData);
+                args.fPathData = new PathData;
                 if (!this->addPathToAtlas(target,
                                           dfProcessor,
                                           this->pipeline(),
@@ -568,9 +568,9 @@ struct PathTestStruct {
         while ((pathData = iter.get())) {
             iter.next();
             fPathList.remove(pathData);
-            SkDELETE(pathData);
+            delete pathData;
         }
-        SkDELETE(fAtlas);
+        delete fAtlas;
         fPathCache.reset();
     }
 
@@ -585,7 +585,7 @@ struct PathTestStruct {
             if (id == pathData->fID) {
                 dfpr->fPathCache.remove(pathData->fKey);
                 dfpr->fPathList.remove(pathData);
-                SkDELETE(pathData);
+                delete pathData;
             }
         }
     }
index 02ff48e..f2f9563 100644 (file)
@@ -680,9 +680,7 @@ public:
         SkIRect fDevClipBounds;
     };
 
-    static GrDrawBatch* Create(const Geometry& geometry) {
-        return SkNEW_ARGS(AAHairlineBatch, (geometry));
-    }
+    static GrDrawBatch* Create(const Geometry& geometry) { return new AAHairlineBatch(geometry); }
 
     const char* name() const override { return "AAHairlineBatch"; }
 
index f9fa920..61c0606 100644 (file)
@@ -13,7 +13,7 @@
 
 class GrAAHairLinePathRenderer : public GrPathRenderer {
 public:
-    static GrPathRenderer* Create()  { return SkNEW(GrAAHairLinePathRenderer); }
+    static GrPathRenderer* Create() { return new GrAAHairLinePathRenderer; }
 
     typedef SkTArray<SkPoint, true> PtArray;
     typedef SkTArray<int, true> IntArray;
index db9e91c..d05fe4e 100644 (file)
@@ -129,7 +129,7 @@ public:
     };
 
     static GrDrawBatch* Create(const Geometry& geometry) {
-        return SkNEW_ARGS(AAFlatteningConvexPathBatch, (geometry));
+        return new AAFlatteningConvexPathBatch(geometry);
     }
 
     const char* name() const override { return "AAConvexBatch"; }
index 77a26d3..9ba6256 100644 (file)
 #include "GrTessellatingPathRenderer.h"
 
 void GrPathRenderer::AddPathRenderers(GrContext* ctx, GrPathRendererChain* chain) {
-    chain->addPathRenderer(SkNEW(GrDashLinePathRenderer))->unref();
+    chain->addPathRenderer(new GrDashLinePathRenderer)->unref();
 
     if (GrPathRenderer* pr = GrStencilAndCoverPathRenderer::Create(ctx->resourceProvider(),
                                                                    *ctx->caps())) {
         chain->addPathRenderer(pr)->unref();
     }
-    chain->addPathRenderer(SkNEW(GrTessellatingPathRenderer))->unref();
+    chain->addPathRenderer(new GrTessellatingPathRenderer)->unref();
     if (GrPathRenderer* pr = GrAAHairLinePathRenderer::Create()) {
         chain->addPathRenderer(pr)->unref();
     }
-    chain->addPathRenderer(SkNEW(GrAAConvexPathRenderer))->unref();
-    chain->addPathRenderer(SkNEW(GrAALinearizingConvexPathRenderer))->unref();
-    chain->addPathRenderer(SkNEW(GrAADistanceFieldPathRenderer))->unref();
+    chain->addPathRenderer(new GrAAConvexPathRenderer)->unref();
+    chain->addPathRenderer(new GrAALinearizingConvexPathRenderer)->unref();
+    chain->addPathRenderer(new GrAADistanceFieldPathRenderer)->unref();
 }
index 861c3cb..64f6533 100644 (file)
@@ -247,14 +247,14 @@ public:
     T& push_back() {
         void* item = fAllocator.push_back();
         SkASSERT(item);
-        SkNEW_PLACEMENT(item, T);
+        new (item) T;
         return *(T*)item;
     }
 
     T& push_back(const T& t) {
         void* item = fAllocator.push_back();
         SkASSERT(item);
-        SkNEW_PLACEMENT_ARGS(item, T, (t));
+        new (item) T(t);
         return *(T*)item;
     }
 
index 0322f70..e280302 100644 (file)
@@ -33,7 +33,7 @@ GrPlot::GrPlot()
 }
 
 GrPlot::~GrPlot() {
-    SkDELETE_ARRAY(fPlotData);
+    delete[] fPlotData;
     fPlotData = NULL;
     delete fRects;
 }
@@ -67,7 +67,7 @@ bool GrPlot::addSubImage(int width, int height, const void* image, SkIPoint16* l
     int plotWidth = fRects->width();
     int plotHeight = fRects->height();
     if (fBatchUploads && NULL == fPlotData && 0.0f == percentFull) {
-        fPlotData = SkNEW_ARRAY(unsigned char, fBytesPerPixel*plotWidth*plotHeight);
+        fPlotData = new unsigned char[fBytesPerPixel * plotWidth * plotHeight];
         memset(fPlotData, 0, fBytesPerPixel*plotWidth*plotHeight);
     }
 
@@ -138,7 +138,7 @@ GrAtlas::GrAtlas(GrGpu* gpu, GrPixelConfig config, GrSurfaceFlags flags,
 
     // set up allocated plots
     size_t bpp = GrBytesPerPixel(fPixelConfig);
-    fPlotArray = SkNEW_ARRAY(GrPlot, (fNumPlotsX*fNumPlotsY));
+    fPlotArray = new GrPlot[(fNumPlotsX * fNumPlotsY)];
 
     GrPlot* currPlot = fPlotArray;
     for (int y = numPlotsY-1; y >= 0; --y) {
@@ -154,7 +154,7 @@ GrAtlas::GrAtlas(GrGpu* gpu, GrPixelConfig config, GrSurfaceFlags flags,
 
 GrAtlas::~GrAtlas() {
     SkSafeUnref(fTexture);
-    SkDELETE_ARRAY(fPlotArray);
+    delete[] fPlotArray;
 
     fGpu->unref();
 #if FONT_CACHE_STATS
index cbcfd65..61cd2a1 100644 (file)
@@ -99,8 +99,7 @@ static inline GrColor skcolor_to_grcolor_nopremultiply(SkColor c) {
 GrAtlasTextContext::GrAtlasTextContext(GrContext* context,
                                        GrDrawContext* drawContext,
                                        const SkSurfaceProps& surfaceProps)
-    : INHERITED(context, drawContext, surfaceProps)
-    , fDistanceAdjustTable(SkNEW(DistanceAdjustTable)) {
+    : INHERITED(context, drawContext, surfaceProps), fDistanceAdjustTable(new DistanceAdjustTable) {
     // We overallocate vertices in our textblobs based on the assumption that A8 has the greatest
     // vertexStride
     static_assert(kGrayTextVASize >= kColorTextVASize && kGrayTextVASize >= kLCDTextVASize,
@@ -161,7 +160,7 @@ void GrAtlasTextContext::DistanceAdjustTable::buildDistanceAdjustTable() {
         &width, &height);
 
     SkASSERT(kExpectedDistanceAdjustTableSize == height);
-    fTable = SkNEW_ARRAY(SkScalar, height);
+    fTable = new SkScalar[height];
 
     SkAutoTArray<uint8_t> data((int)size);
     SkScalerContext::GetGammaLUTData(contrast, paintGamma, deviceGamma, data.get());
@@ -194,7 +193,7 @@ void GrAtlasTextContext::DistanceAdjustTable::buildDistanceAdjustTable() {
 GrAtlasTextContext* GrAtlasTextContext::Create(GrContext* context,
                                                GrDrawContext* drawContext,
                                                const SkSurfaceProps& surfaceProps) {
-    return SkNEW_ARGS(GrAtlasTextContext, (context, drawContext, surfaceProps));
+    return new GrAtlasTextContext(context, drawContext, surfaceProps);
 }
 
 bool GrAtlasTextContext::canDraw(const GrRenderTarget*,
@@ -680,7 +679,7 @@ inline void GrAtlasTextContext::fallbackDrawPosText(GrAtlasTextBlob* blob,
     Run& run = blob->fRuns[runIndex];
     // Push back a new subrun to fill and set the override descriptor
     run.push_back();
-    run.fOverrideDescriptor.reset(SkNEW(SkAutoDescriptor));
+    run.fOverrideDescriptor.reset(new SkAutoDescriptor);
     skPaint.getScalerContextDescriptor(run.fOverrideDescriptor,
                                        fSurfaceProps, &viewMatrix, false);
     SkGlyphCache* cache = SkGlyphCache::DetachCache(run.fTypeface,
@@ -1371,7 +1370,7 @@ inline void GrAtlasTextContext::appendGlyphPath(GrAtlasTextBlob* blob, GrGlyph*
             return;
         }
 
-        glyph->fPath = SkNEW_ARGS(SkPath, (*glyphPath));
+        glyph->fPath = new SkPath(*glyphPath);
     }
     blob->fBigGlyphs.push_back(GrAtlasTextBlob::BigGlyph(*glyph->fPath, x, y, scale, applyVM));
 }
@@ -1456,7 +1455,7 @@ public:
 
     static TextBatch* CreateBitmap(GrMaskFormat maskFormat, int glyphCount,
                                    GrBatchFontCache* fontCache) {
-        TextBatch* batch = SkNEW(TextBatch);
+        TextBatch* batch = new TextBatch;
 
         batch->initClassID<TextBatch>();
         batch->fFontCache = fontCache;
@@ -1483,7 +1482,7 @@ public:
                                           DistanceAdjustTable* distanceAdjustTable,
                                           SkColor filteredColor, bool isLCD,
                                           bool useBGR) {
-        TextBatch* batch = SkNEW(TextBatch);
+        TextBatch* batch = new TextBatch;
         batch->initClassID<TextBatch>();
         batch->fFontCache = fontCache;
         batch->fMaskType = isLCD ? kLCDDistanceField_MaskType : kGrayscaleDistanceField_MaskType;
@@ -2237,7 +2236,7 @@ DRAW_BATCH_TEST_DEFINE(TextBlobBatch) {
 
     if (context->uniqueID() != gContextID) {
         gContextID = context->uniqueID();
-        SkDELETE(gTextContext);
+        delete gTextContext;
 
         // We don't yet test the fall back to paths in the GrTextContext base class.  This is mostly
         // because we don't really want to have a gpu device here.
index 4eeb42c..3bb75b8 100644 (file)
@@ -167,7 +167,7 @@ private:
     // refcnted and malloced
     struct DistanceAdjustTable : public SkNVRefCnt<DistanceAdjustTable> {
         DistanceAdjustTable() { this->buildDistanceAdjustTable(); }
-        ~DistanceAdjustTable() { SkDELETE_ARRAY(fTable); }
+        ~DistanceAdjustTable() { delete[] fTable; }
 
         const SkScalar& operator[] (int i) const {
             return fTable[i];
index f75df8b..1607ed1 100644 (file)
@@ -234,13 +234,13 @@ GrBatchAtlas::GrBatchAtlas(GrTexture* texture, int numPlotsX, int numPlotsY)
 
     // set up allocated plots
     fBPP = GrBytesPerPixel(texture->desc().fConfig);
-    fPlotArray = SkNEW_ARRAY(SkAutoTUnref<BatchPlot>, (fNumPlotsX * fNumPlotsY));
+    fPlotArray = new SkAutoTUnref<BatchPlot>[(fNumPlotsX * fNumPlotsY)];
 
     SkAutoTUnref<BatchPlot>* currPlot = fPlotArray;
     for (int y = fNumPlotsY - 1, r = 0; y >= 0; --y, ++r) {
         for (int x = fNumPlotsX - 1, c = 0; x >= 0; --x, ++c) {
             uint32_t id = r * fNumPlotsX + c;
-            currPlot->reset(SkNEW(BatchPlot));
+            currPlot->reset(new BatchPlot);
             (*currPlot)->init(this, texture, id, 1, x, y, fPlotWidth, fPlotHeight, fBPP);
 
             // build LRU list
@@ -252,7 +252,7 @@ GrBatchAtlas::GrBatchAtlas(GrTexture* texture, int numPlotsX, int numPlotsY)
 
 GrBatchAtlas::~GrBatchAtlas() {
     SkSafeUnref(fTexture);
-    SkDELETE_ARRAY(fPlotArray);
+    delete[] fPlotArray;
 }
 
 void GrBatchAtlas::processEviction(AtlasID id) {
@@ -278,7 +278,7 @@ inline void GrBatchAtlas::updatePlot(GrDrawBatch::Target* target, AtlasID* id, B
     // This new update will piggy back on that previously scheduled update.
     if (target->hasTokenBeenFlushed(plot->lastUploadToken())) {
         plot->setLastUploadToken(target->asapToken());
-        SkAutoTUnref<GrPlotUploader> uploader(SkNEW_ARGS(GrPlotUploader, (plot)));
+        SkAutoTUnref<GrPlotUploader> uploader(new GrPlotUploader(plot));
         target->upload(uploader);
     }
     *id = plot->id();
@@ -338,14 +338,14 @@ bool GrBatchAtlas::addToAtlas(AtlasID* id, GrDrawBatch::Target* batchTarget,
     this->processEviction(plot->id());
     fPlotList.remove(plot);
     SkAutoTUnref<BatchPlot>& newPlot = fPlotArray[plot->index()];
-    newPlot.reset(SkNEW(BatchPlot));
+    newPlot.reset(new BatchPlot);
     newPlot->init(this, fTexture, index, ++generation, x, y, fPlotWidth, fPlotHeight, fBPP);
 
     fPlotList.addToHead(newPlot.get());
     SkDEBUGCODE(bool verify = )newPlot->addSubImage(width, height, image, loc, fBPP * width);
     SkASSERT(verify);
     newPlot->setLastUploadToken(batchTarget->currentToken());
-    SkAutoTUnref<GrPlotUploader> uploader(SkNEW_ARGS(GrPlotUploader, (newPlot)));
+    SkAutoTUnref<GrPlotUploader> uploader(new GrPlotUploader(newPlot));
     batchTarget->upload(uploader);
     *id = newPlot->id();
     plot->unref();
index 30dd0b6..e8c2183 100644 (file)
@@ -70,7 +70,7 @@ GrBatchFontCache::~GrBatchFontCache() {
         ++iter;
     }
     for (int i = 0; i < kMaskFormatCount; ++i) {
-        SkDELETE(fAtlases[i]);
+        delete fAtlases[i];
     }
 }
 
@@ -83,7 +83,7 @@ void GrBatchFontCache::freeAll() {
     }
     fCache.rewind();
     for (int i = 0; i < kMaskFormatCount; ++i) {
-        SkDELETE(fAtlases[i]);
+        delete fAtlases[i];
         fAtlases[i] = NULL;
     }
 }
@@ -130,7 +130,7 @@ void GrBatchFontCache::setAtlasSizes_ForTesting(const GrBatchAtlasConfig configs
     // flush
     for (int i = 0; i < kMaskFormatCount; i++) {
         if (fAtlases[i]) {
-            SkDELETE(fAtlases[i]);
+            delete fAtlases[i];
             fAtlases[i] = NULL;
         }
     }
index 32c3281..5d57221 100644 (file)
@@ -200,7 +200,7 @@ private:
     bool initAtlas(GrMaskFormat);
 
     GrBatchTextStrike* generateStrike(GrFontScaler* scaler) {
-        GrBatchTextStrike* strike = SkNEW_ARGS(GrBatchTextStrike, (this, scaler->getKey()));
+        GrBatchTextStrike* strike = new GrBatchTextStrike(this, scaler->getKey());
         fCache.add(strike);
         return strike;
     }
index f11a9d8..82421ab 100644 (file)
@@ -62,7 +62,7 @@ private:
     StateForPathDraw* allocState(const GrPrimitiveProcessor* primProc = NULL) {
         void* allocation = fPipelineBuffer.alloc(sizeof(StateForPathDraw),
                                                  SkChunkAlloc::kThrow_AllocFailType);
-        return SkNEW_PLACEMENT_ARGS(allocation, StateForPathDraw, (primProc));
+        return new (allocation) StateForPathDraw(primProc);
     }
 
     void unallocState(StateForPathDraw* state) {
index a21eab7..42a5d46 100644 (file)
@@ -13,9 +13,7 @@ GrClipMaskCache::GrClipMaskCache(GrResourceProvider* resourceProvider)
     , fResourceProvider(resourceProvider) {
     // We need an initial frame to capture the clip state prior to
     // any pushes
-    SkNEW_PLACEMENT(fStack.push_back(), GrClipStackFrame);
+    new (fStack.push_back()) GrClipStackFrame;
 }
 
-void GrClipMaskCache::push() {
-    SkNEW_PLACEMENT(fStack.push_back(), GrClipStackFrame);
-}
+void GrClipMaskCache::push() { new (fStack.push_back()) GrClipStackFrame; }
index 3a88ceb..abc6954 100644 (file)
@@ -12,8 +12,8 @@
 
 GrCommandBuilder* GrCommandBuilder::Create(GrGpu* gpu, bool reorder) {
     if (reorder) {
-        return SkNEW(GrReorderCommandBuilder);
+        return new GrReorderCommandBuilder;
     } else {
-        return SkNEW(GrInOrderCommandBuilder);
+        return new GrInOrderCommandBuilder;
     }
 }
old mode 100755 (executable)
new mode 100644 (file)
index 2f334c6..3a1ca13
@@ -64,9 +64,9 @@ void GrContext::DrawingMgr::init(GrContext* context) {
     fContext = context;
 
 #ifdef IMMEDIATE_MODE
-    fDrawTarget = SkNEW_ARGS(GrImmediateDrawTarget, (context));
+    fDrawTarget = new GrImmediateDrawTarget(context);
 #else
-    fDrawTarget = SkNEW_ARGS(GrBufferedDrawTarget, (context));
+    fDrawTarget = new GrBufferedDrawTarget(context);
 #endif    
 }
 
@@ -122,7 +122,7 @@ GrDrawContext* GrContext::DrawingMgr::drawContext(const SkSurfaceProps* surfaceP
     SkASSERT(props.pixelGeometry() < kNumPixelGeometries);
     if (!fDrawContext[props.pixelGeometry()][props.isUseDistanceFieldFonts()]) {
         fDrawContext[props.pixelGeometry()][props.isUseDistanceFieldFonts()] =
-                SkNEW_ARGS(GrDrawContext, (fContext, fDrawTarget, props));
+                new GrDrawContext(fContext, fDrawTarget, props);
     }
 
     return fDrawContext[props.pixelGeometry()][props.isUseDistanceFieldFonts()]; 
@@ -138,7 +138,7 @@ GrContext* GrContext::Create(GrBackend backend, GrBackendContext backendContext)
 
 GrContext* GrContext::Create(GrBackend backend, GrBackendContext backendContext,
                              const GrContextOptions& options) {
-    GrContext* context = SkNEW(GrContext);
+    GrContext* context = new GrContext;
 
     if (context->init(backend, backendContext, options)) {
         return context;
@@ -182,20 +182,20 @@ bool GrContext::init(GrBackend backend, GrBackendContext backendContext,
 
 void GrContext::initCommon() {
     fCaps = SkRef(fGpu->caps());
-    fResourceCache = SkNEW_ARGS(GrResourceCache, (fCaps));
+    fResourceCache = new GrResourceCache(fCaps);
     fResourceCache->setOverBudgetCallback(OverBudgetCB, this);
-    fResourceProvider = SkNEW_ARGS(GrResourceProvider, (fGpu, fResourceCache));
+    fResourceProvider = new GrResourceProvider(fGpu, fResourceCache);
 
-    fLayerCache.reset(SkNEW_ARGS(GrLayerCache, (this)));
+    fLayerCache.reset(new GrLayerCache(this));
 
     fDidTestPMConversions = false;
 
     fDrawingMgr.init(this);
 
     // GrBatchFontCache will eventually replace GrFontCache
-    fBatchFontCache = SkNEW_ARGS(GrBatchFontCache, (this));
+    fBatchFontCache = new GrBatchFontCache(this);
 
-    fTextBlobCache.reset(SkNEW_ARGS(GrTextBlobCache, (TextBlobCacheOverBudgetCB, this)));
+    fTextBlobCache.reset(new GrTextBlobCache(TextBlobCacheOverBudgetCB, this));
 }
 
 GrContext::~GrContext() {
@@ -212,9 +212,9 @@ GrContext::~GrContext() {
         (*fCleanUpData[i].fFunc)(this, fCleanUpData[i].fInfo);
     }
 
-    SkDELETE(fResourceProvider);
-    SkDELETE(fResourceCache);
-    SkDELETE(fBatchFontCache);
+    delete fResourceProvider;
+    delete fResourceCache;
+    delete fBatchFontCache;
 
     fGpu->unref();
     fCaps->unref();
@@ -645,7 +645,7 @@ GrPathRenderer* GrContext::getPathRenderer(const GrDrawTarget* target,
                                            GrPathRendererChain::StencilSupport* stencilSupport) {
 
     if (!fPathRendererChain) {
-        fPathRendererChain = SkNEW_ARGS(GrPathRendererChain, (this));
+        fPathRendererChain = new GrPathRendererChain(this);
     }
 
     GrPathRenderer* pr = fPathRendererChain->getPathRenderer(target,
@@ -658,7 +658,7 @@ GrPathRenderer* GrContext::getPathRenderer(const GrDrawTarget* target,
 
     if (!pr && allowSW) {
         if (!fSoftwarePathRenderer) {
-            fSoftwarePathRenderer = SkNEW_ARGS(GrSoftwarePathRenderer, (this));
+            fSoftwarePathRenderer = new GrSoftwarePathRenderer(this);
         }
         pr = fSoftwarePathRenderer;
     }
index f8d30f8..d3363ef 100644 (file)
@@ -33,13 +33,8 @@ public:
                                        bool localCoordsWillBeRead,
                                        bool coverageWillBeIgnored,
                                        uint8_t coverage) {
-        return SkNEW_ARGS(DefaultGeoProc, (gpTypeFlags,
-                                           color,
-                                           viewMatrix,
-                                           localMatrix,
-                                           coverage,
-                                           localCoordsWillBeRead,
-                                           coverageWillBeIgnored));
+        return new DefaultGeoProc(gpTypeFlags, color, viewMatrix, localMatrix, coverage,
+                                  localCoordsWillBeRead, coverageWillBeIgnored);
     }
 
     const char* name() const override { return "DefaultGeometryProcessor"; }
@@ -188,7 +183,7 @@ public:
 
     virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
                                                      const GrGLSLCaps&) const override {
-        return SkNEW_ARGS(GLProcessor, (*this, bt));
+        return new GLProcessor(*this, bt);
     }
 
 private:
index 8112232..cf3f0d3 100644 (file)
@@ -220,8 +220,7 @@ public:
     static GrDrawBatch* Create(const Geometry& geometry, uint8_t coverage,
                                const SkMatrix& viewMatrix, bool isHairline,
                                const SkRect& devBounds) {
-        return SkNEW_ARGS(DefaultPathBatch, (geometry, coverage, viewMatrix, isHairline,
-                                             devBounds));
+        return new DefaultPathBatch(geometry, coverage, viewMatrix, isHairline, devBounds);
     }
 
     const char* name() const override { return "DefaultPathBatch"; }
index 445a661..7a508c7 100644 (file)
@@ -46,7 +46,7 @@ GrDrawContext::GrDrawContext(GrContext* context,
 
 GrDrawContext::~GrDrawContext() {
     SkSafeUnref(fDrawTarget);
-    SkDELETE(fTextContext);
+    delete fTextContext;
 }
 
 void GrDrawContext::copySurface(GrRenderTarget* dst, GrSurface* src,
index 98c7587..805cfaf 100644 (file)
@@ -380,7 +380,7 @@ void GrDrawTarget::clear(const SkIRect* rect,
 
         this->drawNonAARect(pipelineBuilder, color, SkMatrix::I(), *rect);
     } else {
-        GrBatch* batch = SkNEW_ARGS(GrClearBatch, (*rect, color, renderTarget));
+        GrBatch* batch = new GrClearBatch(*rect, color, renderTarget);
         this->onDrawBatch(batch);
         batch->unref();
     }
@@ -388,7 +388,7 @@ void GrDrawTarget::clear(const SkIRect* rect,
 
 void GrDrawTarget::discard(GrRenderTarget* renderTarget) {
     if (this->caps()->discardRenderTargetSupport()) {
-        GrBatch* batch = SkNEW_ARGS(GrDiscardBatch, (renderTarget));
+        GrBatch* batch = new GrDiscardBatch(renderTarget);
         this->onDrawBatch(batch);
         batch->unref();
     }
@@ -484,7 +484,7 @@ GrDrawTarget::PipelineInfo::PipelineInfo(const GrPipelineBuilder* pipelineBuilde
 GrClipTarget::GrClipTarget(GrContext* context)
     : INHERITED(context->getGpu(), context->resourceProvider())
     , fContext(context) {
-    fClipMaskManager.reset(SkNEW_ARGS(GrClipMaskManager, (this)));
+    fClipMaskManager.reset(new GrClipMaskManager(this));
 }
 
 
@@ -507,7 +507,7 @@ void GrClipTarget::purgeResources() {
 };
 
 void GrClipTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRenderTarget* rt) {
-    GrBatch* batch = SkNEW_ARGS(GrClearStencilClipBatch, (rect, insideClip, rt));
+    GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt);
     this->onDrawBatch(batch);
     batch->unref();
 }
index 8c0e0e6..d923c7d 100644 (file)
@@ -41,7 +41,7 @@ GrMaskFormat GrFontScaler::getMaskFormat() const {
 
 const GrFontDescKey* GrFontScaler::getKey() {
     if (NULL == fKey) {
-        fKey = SkNEW_ARGS(GrFontDescKey, (fStrike->getDescriptor()));
+        fKey = new GrFontDescKey(fStrike->getDescriptor());
     }
     return fKey;
 }
index 49212df..53782a7 100644 (file)
@@ -109,7 +109,7 @@ void GrGpuResource::setUniqueKey(const GrUniqueKey& key) {
 void GrGpuResource::notifyAllCntsAreZero(CntType lastCntTypeToReachZero) const {
     if (this->wasDestroyed()) {
         // We've already been removed from the cache. Goodbye cruel world!
-        SkDELETE(this);
+        delete this;
         return;
     }
 
index 611d43b..8c27242 100644 (file)
@@ -52,8 +52,8 @@ private:
      */
     void release() {
         fResource->release();
-        if (fResource->isPurgeable()) {            
-            SkDELETE(fResource);
+        if (fResource->isPurgeable()) {
+            delete fResource;
         }
     }
 
@@ -62,8 +62,8 @@ private:
      */
     void abandon() {
         fResource->abandon();
-        if (fResource->isPurgeable()) {            
-            SkDELETE(fResource);
+        if (fResource->isPurgeable()) {
+            delete fResource;
         }
     }
 
index 4a20607..e894c30 100644 (file)
@@ -90,7 +90,7 @@ GrLayerCache::~GrLayerCache() {
         GrCachedLayer* layer = &(*iter);
         SkASSERT(0 == layer->uses());
         this->unlock(layer);
-        SkDELETE(layer);
+        delete layer;
     }
 
     SkASSERT(0 == fPictureHash.count());
@@ -104,9 +104,9 @@ void GrLayerCache::initAtlas() {
     GR_STATIC_ASSERT(kNumPlotsX*kNumPlotsX == GrPictureInfo::kNumPlots);
 
     SkISize textureSize = SkISize::Make(kAtlasTextureWidth, kAtlasTextureHeight);
-    fAtlas.reset(SkNEW_ARGS(GrAtlas, (fContext->getGpu(), kSkia8888_GrPixelConfig,
-                                      kRenderTarget_GrSurfaceFlag,
-                                      textureSize, kNumPlotsX, kNumPlotsY, false)));
+    fAtlas.reset(new GrAtlas(fContext->getGpu(), kSkia8888_GrPixelConfig,
+                             kRenderTarget_GrSurfaceFlag, textureSize, kNumPlotsX, kNumPlotsY,
+                             false));
 }
 
 void GrLayerCache::freeAll() {
@@ -115,7 +115,7 @@ void GrLayerCache::freeAll() {
     for (; !iter.done(); ++iter) {
         GrCachedLayer* layer = &(*iter);
         this->unlock(layer);
-        SkDELETE(layer);
+        delete layer;
     }
     fLayerHash.rewind();
 
@@ -133,9 +133,8 @@ GrCachedLayer* GrLayerCache::createLayer(uint32_t pictureID,
                                          const SkPaint* paint) {
     SkASSERT(pictureID != SK_InvalidGenID && start >= 0 && stop > 0);
 
-    GrCachedLayer* layer = SkNEW_ARGS(GrCachedLayer, (pictureID, start, stop,
-                                                      srcIR, dstIR, initialMat,
-                                                      key, keySize, paint));
+    GrCachedLayer* layer = new GrCachedLayer(pictureID, start, stop, srcIR, dstIR, initialMat, key,
+                                             keySize, paint);
     fLayerHash.add(layer);
     return layer;
 }
@@ -200,7 +199,7 @@ bool GrLayerCache::tryToAtlas(GrCachedLayer* layer,
         // Not in the atlas - will it fit?
         GrPictureInfo* pictInfo = fPictureHash.find(layer->pictureID());
         if (NULL == pictInfo) {
-            pictInfo = SkNEW_ARGS(GrPictureInfo, (layer->pictureID()));
+            pictInfo = new GrPictureInfo(layer->pictureID());
             fPictureHash.add(pictInfo);
         }
 
@@ -235,7 +234,7 @@ bool GrLayerCache::tryToAtlas(GrCachedLayer* layer,
 
         if (pictInfo->fPlotUsage.isEmpty()) {
             fPictureHash.remove(pictInfo->fPictureID);
-            SkDELETE(pictInfo);
+            delete pictInfo;
         }
     }
 
@@ -295,7 +294,7 @@ void GrLayerCache::unlock(GrCachedLayer* layer) {
 
             if (pictInfo->fPlotUsage.isEmpty()) {
                 fPictureHash.remove(pictInfo->fPictureID);
-                SkDELETE(pictInfo);
+                delete pictInfo;
             }
         }
 
@@ -380,13 +379,13 @@ void GrLayerCache::purge(uint32_t pictureID) {
         SkASSERT(0 == toBeRemoved[i]->uses());
         this->unlock(toBeRemoved[i]);
         fLayerHash.remove(GrCachedLayer::GetKey(*toBeRemoved[i]));
-        SkDELETE(toBeRemoved[i]);
+        delete toBeRemoved[i];
     }
 
     GrPictureInfo* pictInfo = fPictureHash.find(pictureID);
     if (pictInfo) {
         fPictureHash.remove(pictureID);
-        SkDELETE(pictInfo);
+        delete pictInfo;
     }
 }
 
@@ -431,7 +430,7 @@ void GrLayerCache::purgePlot(GrPlot* plot) {
 
         // Aggressively remove layers and, if it becomes totally uncached, delete the picture info
         fLayerHash.remove(GrCachedLayer::GetKey(*toBeRemoved[i]));
-        SkDELETE(toBeRemoved[i]);
+        delete toBeRemoved[i];
 
         GrPictureInfo* pictInfo = fPictureHash.find(pictureIDToRemove);
         if (pictInfo) {
@@ -442,7 +441,7 @@ void GrLayerCache::purgePlot(GrPlot* plot) {
 
             if (pictInfo->fPlotUsage.isEmpty()) {
                 fPictureHash.remove(pictInfo->fPictureID);
-                SkDELETE(pictInfo);
+                delete pictInfo;
             }
         }
     }
index cf35de8..4ab0fa4 100644 (file)
@@ -86,7 +86,7 @@ public:
             fIDMatrix.fInitialMat.getType(); // force initialization of type so hashes match
 
             if (copyKey) {
-                int* tempKey = SkNEW_ARRAY(int, keySize);
+                int* tempKey = new int[keySize];
                 memcpy(tempKey, key, keySize*sizeof(int));
                 fKey = tempKey;
             } else {
@@ -100,7 +100,7 @@ public:
 
         ~Key() {
             if (fFreeKey) {
-                SkDELETE_ARRAY(fKey);
+                delete[] fKey;
             }
         }
 
@@ -143,10 +143,14 @@ public:
     static uint32_t Hash(const Key& key) { return key.hash(); }
 
     // GrCachedLayer proper
-    GrCachedLayer(uint32_t pictureID, int start, int stop,
-                  const SkIRect& srcIR, const SkIRect& dstIR,
+    GrCachedLayer(uint32_t pictureID,
+                  int start,
+                  int stop,
+                  const SkIRect& srcIR,
+                  const SkIRect& dstIR,
                   const SkMatrix& ctm,
-                  const int* key, int keySize,
+                  const int* key,
+                  int keySize,
                   const SkPaint* paint)
         : fKey(pictureID, ctm, key, keySize, true)
         , fStart(start)
@@ -154,7 +158,7 @@ public:
         , fSrcIR(srcIR)
         , fDstIR(dstIR)
         , fOffset(SkIPoint::Make(0, 0))
-        , fPaint(paint ? SkNEW_ARGS(SkPaint, (*paint)) : NULL)
+        , fPaint(paint ? new SkPaint(*paint) : NULL)
         , fFilter(NULL)
         , fTexture(NULL)
         , fRect(SkIRect::MakeEmpty())
@@ -174,7 +178,7 @@ public:
     ~GrCachedLayer() {
         SkSafeUnref(fTexture);
         SkSafeUnref(fFilter);
-        SkDELETE(fPaint);
+        delete fPaint;
     }
 
     uint32_t pictureID() const { return fKey.pictureID(); }
index e1aa72c..59a4da1 100644 (file)
@@ -282,7 +282,7 @@ SkBitmap wrap_texture(GrTexture* texture) {
 
     SkBitmap result;
     result.setInfo(texture->surfacePriv().info(kPremul_SkAlphaType));
-    result.setPixelRef(SkNEW_ARGS(SkGrPixelRef, (result.info(), texture)))->unref();
+    result.setPixelRef(new SkGrPixelRef(result.info(), texture))->unref();
     return result;
 }
 
index 026e11d..efa2881 100644 (file)
@@ -35,7 +35,7 @@ public:
         SkASSERT(fRefCnt > 0);
         --fRefCnt;
         if (0 == fRefCnt) {
-            SkDELETE(this);
+            delete this;
             return;
         }
     }
index 2ad7e72..829f0ed 100644 (file)
@@ -72,7 +72,7 @@ class CircleEdgeEffect : public GrGeometryProcessor {
 public:
     static GrGeometryProcessor* Create(GrColor color, bool stroke, const SkMatrix& localMatrix,
                                        bool usesLocalCoords) {
-        return SkNEW_ARGS(CircleEdgeEffect, (color, stroke, localMatrix, usesLocalCoords));
+        return new CircleEdgeEffect(color, stroke, localMatrix, usesLocalCoords);
     }
 
     const Attribute* inPosition() const { return fInPosition; }
@@ -173,7 +173,7 @@ public:
 
     virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
                                                      const GrGLSLCaps&) const override {
-        return SkNEW_ARGS(GLProcessor, (*this, bt));
+        return new GLProcessor(*this, bt);
     }
 
 private:
@@ -224,7 +224,7 @@ class EllipseEdgeEffect : public GrGeometryProcessor {
 public:
     static GrGeometryProcessor* Create(GrColor color, bool stroke, const SkMatrix& localMatrix,
                                        bool usesLocalCoords) {
-        return SkNEW_ARGS(EllipseEdgeEffect, (color, stroke, localMatrix, usesLocalCoords));
+        return new EllipseEdgeEffect(color, stroke, localMatrix, usesLocalCoords);
     }
 
     virtual ~EllipseEdgeEffect() {}
@@ -349,7 +349,7 @@ public:
 
     virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
                                                      const GrGLSLCaps&) const override {
-        return SkNEW_ARGS(GLProcessor, (*this, bt));
+        return new GLProcessor(*this, bt);
     }
 
 private:
@@ -406,7 +406,7 @@ public:
 
     static GrGeometryProcessor* Create(GrColor color, const SkMatrix& viewMatrix, Mode mode,
                                        bool usesLocalCoords) {
-        return SkNEW_ARGS(DIEllipseEdgeEffect, (color, viewMatrix, mode, usesLocalCoords));
+        return new DIEllipseEdgeEffect(color, viewMatrix, mode, usesLocalCoords);
     }
 
     virtual ~DIEllipseEdgeEffect() {}
@@ -549,7 +549,7 @@ public:
 
     virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
                                                      const GrGLSLCaps&) const override {
-        return SkNEW_ARGS(GLProcessor, (*this, bt));
+        return new GLProcessor(*this, bt);
     }
 
 private:
@@ -636,9 +636,7 @@ public:
         SkRect fDevBounds;
     };
 
-    static GrDrawBatch* Create(const Geometry& geometry) {
-        return SkNEW_ARGS(CircleBatch, (geometry));
-    }
+    static GrDrawBatch* Create(const Geometry& geometry) { return new CircleBatch(geometry); }
 
     const char* name() const override { return "CircleBatch"; }
 
@@ -855,9 +853,7 @@ public:
         SkRect fDevBounds;
     };
 
-    static GrDrawBatch* Create(const Geometry& geometry) {
-        return SkNEW_ARGS(EllipseBatch, (geometry));
-    }
+    static GrDrawBatch* Create(const Geometry& geometry) { return new EllipseBatch(geometry); }
 
     const char* name() const override { return "EllipseBatch"; }
 
@@ -1124,7 +1120,7 @@ public:
     };
 
     static GrDrawBatch* Create(const Geometry& geometry, const SkRect& bounds) {
-        return SkNEW_ARGS(DIEllipseBatch, (geometry, bounds));
+        return new DIEllipseBatch(geometry, bounds);
     }
 
     const char* name() const override { return "DIEllipseBatch"; }
@@ -1476,7 +1472,7 @@ public:
     };
 
     static GrDrawBatch* Create(const Geometry& geometry) {
-        return SkNEW_ARGS(RRectCircleRendererBatch, (geometry));
+        return new RRectCircleRendererBatch(geometry);
     }
 
     const char* name() const override { return "RRectCircleBatch"; }
@@ -1652,7 +1648,7 @@ public:
     };
 
     static GrDrawBatch* Create(const Geometry& geometry) {
-        return SkNEW_ARGS(RRectEllipseRendererBatch, (geometry));
+        return new RRectEllipseRendererBatch(geometry);
     }
 
     const char* name() const override { return "RRectEllipseRendererBatch"; }
index 7427785..1e57525 100644 (file)
@@ -17,8 +17,7 @@ GrPaint::GrPaint()
     : fAntiAlias(false)
     , fDither(false)
     , fColor(GrColor_WHITE)
-    , fProcDataManager(SkNEW(GrProcessorDataManager)) {
-}
+    , fProcDataManager(new GrProcessorDataManager) {}
 
 void GrPaint::setCoverageSetOpXPFactory(SkRegion::Op regionOp, bool invertCoverage) {
     fXPFactory.reset(GrCoverageSetOpXPFactory::Create(regionOp, invertCoverage));
index b372adc..3a5ab44 100644 (file)
@@ -84,5 +84,5 @@ void GrPathProcessor::getGLProcessorKey(const GrBatchTracker& bt,
 GrGLPrimitiveProcessor* GrPathProcessor::createGLInstance(const GrBatchTracker& bt,
                                                           const GrGLSLCaps& caps) const {
     SkASSERT(caps.pathRenderingSupport());
-    return SkNEW_ARGS(GrGLPathProcessor, (*this, bt));
+    return new GrGLPathProcessor(*this, bt);
 }
index 13b178f..57c5a8b 100644 (file)
@@ -26,7 +26,7 @@ public:
     static GrPathProcessor* Create(GrColor color,
                                    const SkMatrix& viewMatrix = SkMatrix::I(),
                                    const SkMatrix& localMatrix = SkMatrix::I()) {
-        return SkNEW_ARGS(GrPathProcessor, (color, viewMatrix, localMatrix));
+        return new GrPathProcessor(color, viewMatrix, localMatrix);
     }
 
     void initBatchTracker(GrBatchTracker*, const GrPipelineOptimizations&) const override;
index f578851..62193f3 100644 (file)
@@ -89,7 +89,6 @@ void GrPathRendererChain::init() {
     bool twoSided = caps->twoSidedStencilSupport();
     bool wrapOp = caps->stencilWrapOpsSupport();
     GrPathRenderer::AddPathRenderers(fOwner, this);
-    this->addPathRenderer(SkNEW_ARGS(GrDefaultPathRenderer,
-                                     (twoSided, wrapOp)))->unref();
+    this->addPathRenderer(new GrDefaultPathRenderer(twoSided, wrapOp))->unref();
     fInit = true;
 }
index e97d754..710b828 100644 (file)
@@ -63,7 +63,7 @@ GrPathRange* GrPathRendering::createGlyphs(const SkTypeface* typeface,
     }
 
     if (desc) {
-        SkAutoTUnref<GlyphGenerator> generator(SkNEW_ARGS(GlyphGenerator, (*typeface, *desc)));
+        SkAutoTUnref<GlyphGenerator> generator(new GlyphGenerator(*typeface, *desc));
         return this->createPathRange(generator, stroke);
     }
 
@@ -81,6 +81,6 @@ GrPathRange* GrPathRendering::createGlyphs(const SkTypeface* typeface,
     genericDesc->addEntry(kRec_SkDescriptorTag, sizeof(rec), &rec);
     genericDesc->computeChecksum();
 
-    SkAutoTUnref<GlyphGenerator> generator(SkNEW_ARGS(GlyphGenerator, (*typeface, *genericDesc)));
+    SkAutoTUnref<GlyphGenerator> generator(new GlyphGenerator(*typeface, *genericDesc));
     return this->createPathRange(generator, stroke);
 }
index 8f149f5..148ebb4 100644 (file)
@@ -53,7 +53,7 @@ GrPipeline* GrPipeline::CreateAt(void* memory, const CreateArgs& args,
         overrideColor = GrColor_ILLEGAL;
     }
 
-    GrPipeline* pipeline = SkNEW_PLACEMENT(memory, GrPipeline);
+    GrPipeline* pipeline = new (memory) GrPipeline;
     pipeline->fXferProcessor.reset(xferProcessor.get());
 
     pipeline->fRenderTarget.reset(builder.fRenderTarget.get());
index 64a1d0c..d7db201 100644 (file)
 #include "effects/GrPorterDuffXferProcessor.h"
 
 GrPipelineBuilder::GrPipelineBuilder()
-    : fProcDataManager(SkNEW(GrProcessorDataManager))
-    , fFlags(0x0)
-    , fDrawFace(kBoth_DrawFace) {
+    : fProcDataManager(new GrProcessorDataManager), fFlags(0x0), fDrawFace(kBoth_DrawFace) {
     SkDEBUGCODE(fBlockEffectRemovalCnt = 0;)
 }
 
 GrPipelineBuilder& GrPipelineBuilder::operator=(const GrPipelineBuilder& that) {
-    fProcDataManager.reset(SkNEW_ARGS(GrProcessorDataManager, (*that.processorDataManager())));
+    fProcDataManager.reset(new GrProcessorDataManager(*that.processorDataManager()));
     fRenderTarget.reset(SkSafeRef(that.fRenderTarget.get()));
     fFlags = that.fFlags;
     fStencilSettings = that.fStencilSettings;
index d1a8d93..5f0adb1 100644 (file)
@@ -18,7 +18,7 @@
 static inline void wrap_texture(GrTexture* texture, int width, int height, SkBitmap* result) {
     SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);
     result->setInfo(info);
-    result->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, texture)))->unref();
+    result->setPixelRef(new SkGrPixelRef(info, texture))->unref();
 }
 
 static inline void draw_replacement_bitmap(GrCachedLayer* layer, SkCanvas* canvas) {
index 2d443ca..7091a57 100644 (file)
@@ -56,5 +56,5 @@ bool GrRectanizerPow2::addRect(int width, int height, SkIPoint16* loc) {
 
 // factory is now in GrRectanizer_skyline.cpp
 //GrRectanizer* GrRectanizer::Factory(int width, int height) {
-//    return SkNEW_ARGS(GrRectanizerPow2, (width, height));
+//    return new GrRectanizerPow2  (width, height);
 //}
old mode 100755 (executable)
new mode 100644 (file)
index 44da1c3..32fd410
@@ -118,5 +118,5 @@ void GrRectanizerSkyline::addSkylineLevel(int skylineIndex, int x, int y, int wi
 ///////////////////////////////////////////////////////////////////////////////
 
 GrRectanizer* GrRectanizer::Factory(int width, int height) {
-    return SkNEW_ARGS(GrRectanizerSkyline, (width, height));
+    return new GrRectanizerSkyline(width, height);
 }
index e77d9ac..85a3021 100644 (file)
@@ -84,7 +84,7 @@ GrResourceCache::GrResourceCache(const GrCaps* caps)
 
 GrResourceCache::~GrResourceCache() {
     this->releaseAll();
-    SkDELETE_ARRAY(fFlushTimestamps);
+    delete[] fFlushTimestamps;
 }
 
 void GrResourceCache::setLimits(int count, size_t bytes, int maxUnusedFlushes) {
@@ -96,7 +96,7 @@ void GrResourceCache::setLimits(int count, size_t bytes, int maxUnusedFlushes) {
 }
 
 void GrResourceCache::resetFlushTimestamps() {
-    SkDELETE_ARRAY(fFlushTimestamps);
+    delete[] fFlushTimestamps;
 
     // We assume this number is a power of two when wrapping indices into the timestamp array.
     fMaxUnusedFlushes = SkNextPow2(fMaxUnusedFlushes);
@@ -110,7 +110,7 @@ void GrResourceCache::resetFlushTimestamps() {
         return;
     }
 
-    fFlushTimestamps = SkNEW_ARRAY(uint32_t, fMaxUnusedFlushes);
+    fFlushTimestamps = new uint32_t[fMaxUnusedFlushes];
     fLastFlushTimestampIndex = 0;
     // Set all the historical flush timestamps to initially be at the beginning of time (timestamp
     // 0).
index 3adb0fa..e328c66 100644 (file)
@@ -37,7 +37,7 @@ const GrIndexBuffer* GrResourceProvider::createInstancedIndexBuffer(const uint16
     uint16_t* data = (uint16_t*) buffer->map();
     bool useTempData = (NULL == data);
     if (useTempData) {
-        data = SkNEW_ARRAY(uint16_t, reps * patternSize);
+        data = new uint16_t[reps * patternSize];
     }
     for (int i = 0; i < reps; ++i) {
         int baseIdx = i * patternSize;
@@ -51,7 +51,7 @@ const GrIndexBuffer* GrResourceProvider::createInstancedIndexBuffer(const uint16
             buffer->unref();
             return NULL;
         }
-        SkDELETE_ARRAY(data);
+        delete[] data;
     } else {
         buffer->unmap();
     }
@@ -161,5 +161,5 @@ GrBatchAtlas* GrResourceProvider::createAtlas(GrPixelConfig config,
     if (!texture) {
         return NULL;
     }
-    return SkNEW_ARGS(GrBatchAtlas, (texture, numPlotsX, numPlotsY));
+    return new GrBatchAtlas(texture, numPlotsX, numPlotsY);
 }
index 60f9f64..a5e34ff 100644 (file)
@@ -35,7 +35,7 @@ static GrPathRendering::FillType convert_skpath_filltype(SkPath::FillType fill)
 GrPathRenderer* GrStencilAndCoverPathRenderer::Create(GrResourceProvider* resourceProvider,
                                                       const GrCaps& caps) {
     if (caps.shaderCaps()->pathRenderingSupport()) {
-        return SkNEW_ARGS(GrStencilAndCoverPathRenderer, (resourceProvider));
+        return new GrStencilAndCoverPathRenderer(resourceProvider);
     } else {
         return NULL;
     }
index 554038f..d63df88 100644 (file)
@@ -33,8 +33,8 @@ GrStencilAndCoverTextContext::GrStencilAndCoverTextContext(GrContext* context,
 GrStencilAndCoverTextContext*
 GrStencilAndCoverTextContext::Create(GrContext* context, GrDrawContext* drawContext,
                                      const SkSurfaceProps& surfaceProps) {
-    GrStencilAndCoverTextContext* textContext = SkNEW_ARGS(GrStencilAndCoverTextContext,
-                                                           (context, drawContext, surfaceProps));
+    GrStencilAndCoverTextContext* textContext =
+            new GrStencilAndCoverTextContext(context, drawContext, surfaceProps);
     textContext->fFallbackTextContext = GrAtlasTextContext::Create(context, drawContext, surfaceProps);
 
     return textContext;
index 9fe5278..55af044 100644 (file)
@@ -89,8 +89,7 @@
 #define LOG(...)
 #endif
 
-#define ALLOC_NEW(Type, args, alloc) \
-    SkNEW_PLACEMENT_ARGS(alloc.allocThrow(sizeof(Type)), Type, args)
+#define ALLOC_NEW(Type, args, alloc) new (alloc.allocThrow(sizeof(Type))) Type args
 
 namespace {
 
@@ -1392,7 +1391,7 @@ public:
                                const GrStrokeInfo& stroke,
                                const SkMatrix& viewMatrix,
                                SkRect clipBounds) {
-        return SkNEW_ARGS(TessellatingPathBatch, (color, path, stroke, viewMatrix, clipBounds));
+        return new TessellatingPathBatch(color, path, stroke, viewMatrix, clipBounds);
     }
 
     const char* name() const override { return "TessellatingPathBatch"; }
@@ -1461,7 +1460,7 @@ private:
         }
 
         LOG("got %d pts, %d contours\n", maxPts, contourCnt);
-        SkAutoTDeleteArray<Vertex*> contours(SkNEW_ARRAY(Vertex *, contourCnt));
+        SkAutoTDeleteArray<Vertex*> contours(new Vertex* [contourCnt]);
 
         // For the initial size of the chunk allocator, estimate based on the point count:
         // one vertex per point for the initial passes, plus two for the vertices in the
@@ -1495,7 +1494,7 @@ private:
         if (canMapVB) {
             verts = static_cast<SkPoint*>(vertexBuffer->map());
         } else {
-            verts = SkNEW_ARRAY(SkPoint, count);
+            verts = new SkPoint[count];
         }
         SkPoint* end = polys_to_triangles(polys, fillType, verts);
         int actualCount = static_cast<int>(end - verts);
@@ -1505,7 +1504,7 @@ private:
             vertexBuffer->unmap();
         } else {
             vertexBuffer->updateData(verts, actualCount * sizeof(SkPoint));
-            SkDELETE_ARRAY(verts);
+            delete[] verts;
         }
 
 
@@ -1516,7 +1515,7 @@ private:
             SkAutoTUnref<SkData> data(SkData::NewWithCopy(&info, sizeof(info)));
             key->setCustomData(data.get());
             resourceProvider->assignUniqueKeyToResource(*key, vertexBuffer.get());
-            SkPathPriv::AddGenIDChangeListener(fPath, SkNEW(PathInvalidator(*key)));
+            SkPathPriv::AddGenIDChangeListener(fPath, new PathInvalidator(*key));
         }
         return actualCount;
     }
index a41fb06..1f5e2ce 100644 (file)
@@ -179,7 +179,7 @@ class GrPipeline;
 class MockGpu : public GrGpu {
 public:
     MockGpu(GrContext* context, const GrContextOptions& options) : INHERITED(context) {
-        fCaps.reset(SkNEW_ARGS(GrCaps, (options)));
+        fCaps.reset(new GrCaps(options));
     }
     ~MockGpu() override {}
 
@@ -281,7 +281,7 @@ private:
 };
 
 GrContext* GrContext::CreateMockContext() {
-    GrContext* context = SkNEW(GrContext);
+    GrContext* context = new GrContext;
 
     context->initMockContext();
     return context;
@@ -291,7 +291,7 @@ void GrContext::initMockContext() {
     GrContextOptions options;
     options.fGeometryBufferMapThreshold = 0;
     SkASSERT(NULL == fGpu);
-    fGpu = SkNEW_ARGS(MockGpu, (this, options));
+    fGpu = new MockGpu(this, options);
     SkASSERT(fGpu);
     this->initCommon();
 
index a456fbb..2212c74 100644 (file)
@@ -244,7 +244,7 @@ GrStrokeInfo TestStrokeInfo(SkRandom* random) {
     randomize_stroke_rec(&strokeInfo, random);
     SkPathEffect::DashInfo dashInfo;
     dashInfo.fCount = random->nextRangeU(1, 50) * 2;
-    dashInfo.fIntervals = SkNEW_ARRAY(SkScalar, dashInfo.fCount);
+    dashInfo.fIntervals = new SkScalar[dashInfo.fCount];
     SkScalar sum = 0;
     for (int i = 0; i < dashInfo.fCount; i++) {
         dashInfo.fIntervals[i] = random->nextRangeScalar(SkDoubleToScalar(0.01),
@@ -253,7 +253,7 @@ GrStrokeInfo TestStrokeInfo(SkRandom* random) {
     }
     dashInfo.fPhase = random->nextRangeScalar(0, sum);
     strokeInfo.setDashInfo(dashInfo);
-    SkDELETE_ARRAY(dashInfo.fIntervals);
+    delete[] dashInfo.fIntervals;
     return strokeInfo;
 }
 
index dd7ddc1..f11b7c6 100644 (file)
@@ -27,7 +27,7 @@ GrAtlasTextBlob* GrTextBlobCache::createBlob(int glyphCount, int runCount, size_
     sk_bzero(allocation, size);
 #endif
 
-    GrAtlasTextBlob* cacheBlob = SkNEW_PLACEMENT(allocation, GrAtlasTextBlob);
+    GrAtlasTextBlob* cacheBlob = new (allocation) GrAtlasTextBlob;
 #ifdef CACHE_SANITY_CHECK
     cacheBlob->fSize = size;
 #endif
@@ -39,7 +39,7 @@ GrAtlasTextBlob* GrTextBlobCache::createBlob(int glyphCount, int runCount, size_
 
     // Initialize runs
     for (int i = 0; i < runCount; i++) {
-        SkNEW_PLACEMENT(&cacheBlob->fRuns[i], GrAtlasTextBlob::Run);
+        new (&cacheBlob->fRuns[i]) GrAtlasTextBlob::Run;
     }
     cacheBlob->fRunCount = runCount;
     cacheBlob->fPool = &fPool;
index 8f348f6..387b7eb 100644 (file)
@@ -28,9 +28,7 @@ GrTextContext::GrTextContext(GrContext* context, GrDrawContext* drawContext,
     , fDrawContext(drawContext) {
 }
 
-GrTextContext::~GrTextContext() {
-    SkDELETE(fFallbackTextContext);
-}
+GrTextContext::~GrTextContext() { delete fFallbackTextContext; }
 
 void GrTextContext::drawText(GrRenderTarget* rt, const GrClip& clip, const GrPaint& paint,
                              const SkPaint& skPaint, const SkMatrix& viewMatrix,
@@ -236,7 +234,7 @@ void GrTextContext::drawPosTextAsPath(GrRenderTarget* rt,
     }
 }
 
-//*** change to output positions?
+// *** change to output positions?
 int GrTextContext::MeasureText(SkGlyphCache* cache, SkDrawCacheProc glyphCacheProc,
                                 const char text[], size_t byteLength, SkVector* stopVector) {
     SkFixed     x = 0, y = 0;
@@ -274,7 +272,7 @@ GrFontScaler* GrTextContext::GetGrFontScaler(SkGlyphCache* cache) {
         scaler = (GrFontScaler*)auxData;
     }
     if (NULL == scaler) {
-        scaler = SkNEW_ARGS(GrFontScaler, (cache));
+        scaler = new GrFontScaler(cache);
         cache->setAuxProc(GlyphCacheAuxProc, scaler);
     }
 
index 23151d4..aefa389 100644 (file)
@@ -159,7 +159,7 @@ SkGpuDevice* SkGpuDevice::Create(GrRenderTarget* rt, int width, int height,
     if (!CheckAlphaTypeAndGetFlags(NULL, init, &flags)) {
         return NULL;
     }
-    return SkNEW_ARGS(SkGpuDevice, (rt, width, height, props, flags));
+    return new SkGpuDevice(rt, width, height, props, flags);
 }
 
 SkGpuDevice* SkGpuDevice::Create(GrContext* context, SkSurface::Budgeted budgeted,
@@ -175,7 +175,7 @@ SkGpuDevice* SkGpuDevice::Create(GrContext* context, SkSurface::Budgeted budgete
         return NULL;
     }
 
-    return SkNEW_ARGS(SkGpuDevice, (rt, info.width(), info.height(), props, flags));
+    return new SkGpuDevice(rt, info.width(), info.height(), props, flags);
 }
 
 SkGpuDevice::SkGpuDevice(GrRenderTarget* rt, int width, int height,
@@ -192,7 +192,7 @@ SkGpuDevice::SkGpuDevice(GrRenderTarget* rt, int width, int height,
 
     SkAlphaType at = fOpaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType;
     SkImageInfo info = rt->surfacePriv().info(at).makeWH(width, height);
-    SkPixelRef* pr = SkNEW_ARGS(SkGrPixelRef, (info, rt));
+    SkPixelRef* pr = new SkGrPixelRef(info, rt);
     fLegacyBitmap.setInfo(info);
     fLegacyBitmap.setPixelRef(pr)->unref();
 
@@ -370,7 +370,7 @@ void SkGpuDevice::replaceRenderTarget(bool shouldRetainContent) {
                                                                    kPremul_SkAlphaType);
     SkASSERT(info == fLegacyBitmap.info());
 #endif
-    SkPixelRef* pr = SkNEW_ARGS(SkGrPixelRef, (fLegacyBitmap.info(), fRenderTarget));
+    SkPixelRef* pr = new SkGrPixelRef(fLegacyBitmap.info(), fRenderTarget);
     fLegacyBitmap.setPixelRef(pr)->unref();
 
     fDrawContext.reset(SkRef(fRenderTarget->getContext()->drawContext(&this->surfaceProps())));
@@ -668,7 +668,7 @@ void SkGpuDevice::drawOval(const SkDraw& draw, const SkRect& oval,
 static SkBitmap wrap_texture(GrTexture* texture, int width, int height) {
     SkBitmap result;
     result.setInfo(SkImageInfo::MakeN32Premul(width, height));
-    result.setPixelRef(SkNEW_ARGS(SkGrPixelRef, (result.info(), texture)))->unref();
+    result.setPixelRef(new SkGrPixelRef(result.info(), texture))->unref();
     return result;
 }
 
@@ -1630,7 +1630,7 @@ void SkGpuDevice::drawVertices(const SkDraw& draw, SkCanvas::VertexMode vmode,
         //number of indices for lines per triangle with kLines
         indexCount = triangleCount * 6;
 
-        outAlloc.reset(SkNEW_ARRAY(uint16_t, indexCount));
+        outAlloc.reset(new uint16_t[indexCount]);
         outIndices = outAlloc.get();
         uint16_t* auxIndices = outAlloc.get();
         int i = 0;
index 6c1ec4b..ef8460b 100644 (file)
@@ -245,7 +245,7 @@ static GrTexture* create_texture_for_bmp(GrContext* ctx,
                                          size_t rowBytes) {
     GrTexture* result = ctx->textureProvider()->createTexture(desc, true, pixels, rowBytes);
     if (result && optionalKey.isValid()) {
-        BitmapInvalidator* listener = SkNEW_ARGS(BitmapInvalidator, (optionalKey));
+        BitmapInvalidator* listener = new BitmapInvalidator(optionalKey);
         pixelRefForInvalidationNotification->addGenIDChangeListener(listener);
         ctx->textureProvider()->assignUniqueKeyToTexture(optionalKey, result);
     }
@@ -892,7 +892,7 @@ SkImageInfo GrMakeInfoFromTexture(GrTexture* tex, int w, int h, bool isOpaque) {
 void GrWrapTextureInBitmap(GrTexture* src, int w, int h, bool isOpaque, SkBitmap* dst) {
     const SkImageInfo info = GrMakeInfoFromTexture(src, w, h, isOpaque);
     dst->setInfo(info);
-    dst->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, src)))->unref();
+    dst->setPixelRef(new SkGrPixelRef(info, src))->unref();
 }
 
 GrTextureParams::FilterMode GrSkFilterQualityToGrFilterMode(SkFilterQuality paintFilterQuality,
index 21b999f..50b1269 100644 (file)
@@ -90,7 +90,7 @@ static SkGrPixelRef* copy_to_new_texture_pixelref(GrTexture* texture, SkColorTyp
 
     SkImageInfo info = SkImageInfo::Make(desc.fWidth, desc.fHeight, dstCT, kPremul_SkAlphaType,
                                          dstPT);
-    SkGrPixelRef* pixelRef = SkNEW_ARGS(SkGrPixelRef, (info, dst));
+    SkGrPixelRef* pixelRef = new SkGrPixelRef(info, dst);
     SkSafeUnref(dst);
     return pixelRef;
 }
index f74c33c..ae75348 100644 (file)
@@ -28,7 +28,7 @@ public:
     };
 
     static GrDrawBatch* Create(const Geometry& geometry, const SkMatrix& viewMatrix) {
-        return SkNEW_ARGS(GrAAStrokeRectBatch, (geometry, viewMatrix));
+        return new GrAAStrokeRectBatch(geometry, viewMatrix);
     }
 
     const char* name() const override { return "AAStrokeRect"; }
index 2c859f8..b4e7ce2 100644 (file)
@@ -75,5 +75,5 @@ GrBatch* GrCopySurfaceBatch::Create(GrSurface* dst, GrSurface* src, const SkIRec
                                     &clippedDstPoint)) {
         return NULL;
     }
-    return SkNEW_ARGS(GrCopySurfaceBatch, (dst, src, clippedSrcRect, clippedDstPoint));
+    return new GrCopySurfaceBatch(dst, src, clippedSrcRect, clippedDstPoint);
 }
index e7dd9bf..9a864c0 100644 (file)
@@ -22,8 +22,7 @@ public:
     static GrDrawBatch* Create(const Geometry& geometry, const SkMatrix& viewMatrix,
                                int spriteCount, const SkRSXform* xforms, const SkRect* rects,
                                const SkColor* colors) {
-        return SkNEW_ARGS(GrDrawAtlasBatch, (geometry, viewMatrix, spriteCount,
-                                             xforms, rects, colors));
+        return new GrDrawAtlasBatch(geometry, viewMatrix, spriteCount, xforms, rects, colors);
     }
     
     const char* name() const override { return "DrawAtlasBatch"; }
index e8349d1..cf67cd9 100644 (file)
@@ -18,7 +18,7 @@ class GrDrawPathBatch final : public GrDrawBatch {
 public:
     // This must return the concrete type because we install the stencil settings late :(
     static GrDrawPathBatch* Create(const GrPathProcessor* primProc, const GrPath* path) {
-        return SkNEW_ARGS(GrDrawPathBatch, (primProc, path));
+        return new GrDrawPathBatch(primProc, path);
     }
 
     const char* name() const override { return "DrawPath"; }
index 18ddee0..aaa7b09 100644 (file)
@@ -34,9 +34,8 @@ public:
                                const uint16_t* indices, int indexCount,
                                const GrColor* colors, const SkPoint* localCoords,
                                const SkRect& bounds) {
-        return SkNEW_ARGS(GrDrawVerticesBatch, (geometry, primitiveType, viewMatrix, positions,
-                                                vertexCount, indices, indexCount, colors,
-                                                localCoords, bounds));
+        return new GrDrawVerticesBatch(geometry, primitiveType, viewMatrix, positions, vertexCount,
+                                       indices, indexCount, colors, localCoords, bounds);
     }
 
     const char* name() const override { return "DrawVerticesBatch"; }
index d679009..6b4ddf0 100644 (file)
@@ -23,8 +23,7 @@ public:
                            const GrScissorState& scissor,
                            GrRenderTarget* renderTarget,
                            const GrPath* path) {
-        return SkNEW_ARGS(GrStencilPathBatch, (viewMatrix, useHWAA, stencil, scissor, renderTarget,
-                                               path));
+        return new GrStencilPathBatch(viewMatrix, useHWAA, stencil, scissor, renderTarget, path);
     }
 
     const char* name() const override { return "StencilPath"; }
index ee053d7..b374ea8 100644 (file)
@@ -22,7 +22,7 @@ public:
     };
 
     static GrDrawBatch* Create(const Geometry& geometry, bool snapToPixelCenters) {
-        return SkNEW_ARGS(GrStrokeRectBatch, (geometry, snapToPixelCenters));
+        return new GrStrokeRectBatch(geometry, snapToPixelCenters);
     }
 
     const char* name() const override { return "GrStrokeRectBatch"; }
index 9690d55..e314959 100644 (file)
@@ -42,9 +42,7 @@ class GrTInstanceBatch : public GrVertexBatch {
 public:
     typedef typename Impl::Geometry Geometry;
 
-    static GrTInstanceBatch* Create() {
-        return SkNEW(GrTInstanceBatch);
-    }
+    static GrTInstanceBatch* Create() { return new GrTInstanceBatch; }
 
     const char* name() const override { return Impl::Name(); }
 
index 6a39be4..23f1899 100644 (file)
@@ -194,7 +194,7 @@ void GrConicEffect::getGLProcessorKey(const GrBatchTracker& bt,
 
 GrGLPrimitiveProcessor* GrConicEffect::createGLInstance(const GrBatchTracker& bt,
                                                         const GrGLSLCaps&) const {
-    return SkNEW_ARGS(GrGLConicEffect, (*this, bt));
+    return new GrGLConicEffect(*this, bt);
 }
 
 GrConicEffect::GrConicEffect(GrColor color, const SkMatrix& viewMatrix, uint8_t coverage,
@@ -402,7 +402,7 @@ void GrQuadEffect::getGLProcessorKey(const GrBatchTracker& bt,
 
 GrGLPrimitiveProcessor* GrQuadEffect::createGLInstance(const GrBatchTracker& bt,
                                                        const GrGLSLCaps&) const {
-    return SkNEW_ARGS(GrGLQuadEffect, (*this, bt));
+    return new GrGLQuadEffect(*this, bt);
 }
 
 GrQuadEffect::GrQuadEffect(GrColor color, const SkMatrix& viewMatrix, uint8_t coverage,
@@ -626,7 +626,7 @@ void GrCubicEffect::getGLProcessorKey(const GrBatchTracker& bt,
 
 GrGLPrimitiveProcessor* GrCubicEffect::createGLInstance(const GrBatchTracker& bt,
                                                         const GrGLSLCaps&) const {
-    return SkNEW_ARGS(GrGLCubicEffect, (*this, bt));
+    return new GrGLCubicEffect(*this, bt);
 }
 
 GrCubicEffect::GrCubicEffect(GrColor color, const SkMatrix& viewMatrix,
index 161a2eb..b78c3f3 100644 (file)
@@ -70,20 +70,18 @@ public:
                 if (!caps.shaderCaps()->shaderDerivativeSupport()) {
                     return NULL;
                 }
-                return SkNEW_ARGS(GrConicEffect, (color, viewMatrix, coverage,
-                                                  kFillAA_GrProcessorEdgeType,
-                                                  localMatrix, usesLocalCoords));
+                return new GrConicEffect(color, viewMatrix, coverage, kFillAA_GrProcessorEdgeType,
+                                         localMatrix, usesLocalCoords);
             case kHairlineAA_GrProcessorEdgeType:
                 if (!caps.shaderCaps()->shaderDerivativeSupport()) {
                     return NULL;
                 }
-                return SkNEW_ARGS(GrConicEffect, (color, viewMatrix, coverage,
-                                                  kHairlineAA_GrProcessorEdgeType,
-                                                  localMatrix, usesLocalCoords));
+                return new GrConicEffect(color, viewMatrix, coverage,
+                                         kHairlineAA_GrProcessorEdgeType, localMatrix,
+                                         usesLocalCoords);
             case kFillBW_GrProcessorEdgeType:
-                return SkNEW_ARGS(GrConicEffect, (color, viewMatrix, coverage,
-                                                  kFillBW_GrProcessorEdgeType,
-                                                  localMatrix, usesLocalCoords));
+                return new GrConicEffect(color, viewMatrix, coverage, kFillBW_GrProcessorEdgeType,
+                                         localMatrix, usesLocalCoords);
             default:
                 return NULL;
         }
@@ -155,20 +153,18 @@ public:
                 if (!caps.shaderCaps()->shaderDerivativeSupport()) {
                     return NULL;
                 }
-                return SkNEW_ARGS(GrQuadEffect, (color, viewMatrix, coverage,
-                                                 kFillAA_GrProcessorEdgeType,
-                                                 localMatrix, usesLocalCoords));
+                return new GrQuadEffect(color, viewMatrix, coverage, kFillAA_GrProcessorEdgeType,
+                                        localMatrix, usesLocalCoords);
             case kHairlineAA_GrProcessorEdgeType:
                 if (!caps.shaderCaps()->shaderDerivativeSupport()) {
                     return NULL;
                 }
-                return SkNEW_ARGS(GrQuadEffect, (color, viewMatrix, coverage,
-                                                 kHairlineAA_GrProcessorEdgeType,
-                                                 localMatrix, usesLocalCoords));
+                return new GrQuadEffect(color, viewMatrix, coverage,
+                                        kHairlineAA_GrProcessorEdgeType, localMatrix,
+                                        usesLocalCoords);
             case kFillBW_GrProcessorEdgeType:
-                return SkNEW_ARGS(GrQuadEffect, (color, viewMatrix, coverage,
-                                                 kFillBW_GrProcessorEdgeType,
-                                                 localMatrix, usesLocalCoords));
+                return new GrQuadEffect(color, viewMatrix, coverage, kFillBW_GrProcessorEdgeType,
+                                        localMatrix, usesLocalCoords);
             default:
                 return NULL;
         }
@@ -239,16 +235,14 @@ public:
                 if (!caps.shaderCaps()->shaderDerivativeSupport()) {
                     return NULL;
                 }
-                return SkNEW_ARGS(GrCubicEffect, (color, viewMatrix, kFillAA_GrProcessorEdgeType));
+                return new GrCubicEffect(color, viewMatrix, kFillAA_GrProcessorEdgeType);
             case kHairlineAA_GrProcessorEdgeType:
                 if (!caps.shaderCaps()->shaderDerivativeSupport()) {
                     return NULL;
                 }
-                return SkNEW_ARGS(GrCubicEffect, (color, viewMatrix,
-                                                  kHairlineAA_GrProcessorEdgeType));
+                return new GrCubicEffect(color, viewMatrix, kHairlineAA_GrProcessorEdgeType);
             case kFillBW_GrProcessorEdgeType:
-                return SkNEW_ARGS(GrCubicEffect, (color, viewMatrix,
-                                                  kFillBW_GrProcessorEdgeType));
+                return new GrCubicEffect(color, viewMatrix, kFillBW_GrProcessorEdgeType);
             default:
                 return NULL;
         }
index e3b959d..ad9be6b 100644 (file)
@@ -159,7 +159,7 @@ void GrBicubicEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLFragmentProcessor* GrBicubicEffect::onCreateGLInstance() const  {
-    return SkNEW_ARGS(GrGLBicubicEffect, (*this));
+    return new GrGLBicubicEffect(*this);
 }
 
 bool GrBicubicEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
index f95b3f9..ff2d60e 100644 (file)
@@ -41,9 +41,8 @@ public:
             return Create(procDataManager, tex, coefficients,
                           GrCoordTransform::MakeDivByTextureWHMatrix(tex), kTileModes);
         } else {
-            return SkNEW_ARGS(GrBicubicEffect, (procDataManager, tex, coefficients,
-                                                GrCoordTransform::MakeDivByTextureWHMatrix(tex),
-                                                *domain));
+            return new GrBicubicEffect(procDataManager, tex, coefficients,
+                                       GrCoordTransform::MakeDivByTextureWHMatrix(tex), *domain);
         }
     }
 
@@ -63,7 +62,7 @@ public:
     static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, GrTexture* tex,
                                        const SkScalar coefficients[16], const SkMatrix& matrix,
                                        const SkShader::TileMode tileModes[2]) {
-        return SkNEW_ARGS(GrBicubicEffect, (procDataManager, tex, coefficients, matrix, tileModes));
+        return new GrBicubicEffect(procDataManager, tex, coefficients, matrix, tileModes);
     }
 
     /**
@@ -71,8 +70,7 @@ public:
      */
     static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, GrTexture* tex,
                                        const SkMatrix& matrix, const SkRect& domain) {
-        return SkNEW_ARGS(GrBicubicEffect, (procDataManager, tex, gMitchellCoefficients, matrix,
-                                            domain));
+        return new GrBicubicEffect(procDataManager, tex, gMitchellCoefficients, matrix, domain);
     }
 
     /**
index dfced55..3b4f24c 100644 (file)
@@ -152,7 +152,7 @@ void GrBitmapTextGeoProc::getGLProcessorKey(const GrBatchTracker& bt,
 GrGLPrimitiveProcessor*
 GrBitmapTextGeoProc::createGLInstance(const GrBatchTracker& bt,
                                       const GrGLSLCaps& caps) const {
-    return SkNEW_ARGS(GrGLBitmapTextGeoProc, (*this, bt));
+    return new GrGLBitmapTextGeoProc(*this, bt);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
index 2bd2726..ab7ba3f 100644 (file)
@@ -24,8 +24,7 @@ public:
     static GrGeometryProcessor* Create(GrColor color, GrTexture* tex, const GrTextureParams& p,
                                        GrMaskFormat format, const SkMatrix& localMatrix,
                                        bool usesLocalCoords) {
-        return SkNEW_ARGS(GrBitmapTextGeoProc, (color, tex, p, format, localMatrix,
-                usesLocalCoords));
+        return new GrBitmapTextGeoProc(color, tex, p, format, localMatrix, usesLocalCoords);
     }
 
     virtual ~GrBitmapTextGeoProc() {}
index 4c8813d..06b2d8d 100644 (file)
@@ -136,12 +136,9 @@ GrFragmentProcessor* GrConfigConversionEffect::TestCreate(GrProcessorTestData* d
     } else {
         swapRB = d->fRandom->nextBool();
     }
-    return SkNEW_ARGS(GrConfigConversionEffect,
-                                      (d->fProcDataManager,
-                                       d->fTextures[GrProcessorUnitTest::kSkiaPMTextureIdx],
-                                       swapRB,
-                                       pmConv,
-                                       GrTest::TestMatrix(d->fRandom)));
+    return new GrConfigConversionEffect(d->fProcDataManager,
+                                        d->fTextures[GrProcessorUnitTest::kSkiaPMTextureIdx],
+                                        swapRB, pmConv, GrTest::TestMatrix(d->fRandom));
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -152,7 +149,7 @@ void GrConfigConversionEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLFragmentProcessor* GrConfigConversionEffect::onCreateGLInstance() const {
-    return SkNEW_ARGS(GrGLConfigConversionEffect, (*this));
+    return new GrGLConfigConversionEffect(*this);
 }
 
 
@@ -219,18 +216,12 @@ void GrConfigConversionEffect::TestForPreservingPMConversions(GrContext* context
         GrPaint paint1;
         GrPaint paint2;
         GrPaint paint3;
-        SkAutoTUnref<GrFragmentProcessor> pmToUPM1(
-                SkNEW_ARGS(GrConfigConversionEffect,
-                           (paint1.getProcessorDataManager(), dataTex, false, *pmToUPMRule,
-                            SkMatrix::I())));
-        SkAutoTUnref<GrFragmentProcessor> upmToPM(
-                SkNEW_ARGS(GrConfigConversionEffect,
-                           (paint2.getProcessorDataManager(), readTex, false, *upmToPMRule,
-                            SkMatrix::I())));
-        SkAutoTUnref<GrFragmentProcessor> pmToUPM2(
-                SkNEW_ARGS(GrConfigConversionEffect,
-                           (paint3.getProcessorDataManager(), tempTex, false, *pmToUPMRule,
-                            SkMatrix::I())));
+        SkAutoTUnref<GrFragmentProcessor> pmToUPM1(new GrConfigConversionEffect(
+                paint1.getProcessorDataManager(), dataTex, false, *pmToUPMRule, SkMatrix::I()));
+        SkAutoTUnref<GrFragmentProcessor> upmToPM(new GrConfigConversionEffect(
+                paint2.getProcessorDataManager(), readTex, false, *upmToPMRule, SkMatrix::I()));
+        SkAutoTUnref<GrFragmentProcessor> pmToUPM2(new GrConfigConversionEffect(
+                paint3.getProcessorDataManager(), tempTex, false, *pmToUPMRule, SkMatrix::I()));
 
         paint1.addColorProcessor(pmToUPM1);
 
@@ -314,10 +305,7 @@ const GrFragmentProcessor* GrConfigConversionEffect::Create(GrProcessorDataManag
             // The PM conversions assume colors are 0..255
             return NULL;
         }
-        return SkNEW_ARGS(GrConfigConversionEffect, (procDataManager,
-                                                     texture,
-                                                     swapRedAndBlue,
-                                                     pmConversion,
-                                                     matrix));
+        return new GrConfigConversionEffect(procDataManager, texture, swapRedAndBlue, pmConversion,
+                                            matrix);
     }
 }
index 88bd82b..131d91c 100644 (file)
@@ -91,7 +91,7 @@ void GrConstColorProcessor::onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKe
 }
 
 GrGLFragmentProcessor* GrConstColorProcessor::onCreateGLInstance() const  {
-    return SkNEW(GLConstColorProcessor);
+    return new GLConstColorProcessor;
 }
 
 bool GrConstColorProcessor::onIsEqual(const GrFragmentProcessor& other) const {
index 6c47768..92ec518 100644 (file)
@@ -17,7 +17,7 @@ public:
     const SkRect& getRect() const { return fRect; }
 
     static GrFragmentProcessor* Create(GrPrimitiveEdgeType edgeType, const SkRect& rect) {
-        return SkNEW_ARGS(AARectEffect, (edgeType, rect));
+        return new AARectEffect(edgeType, rect);
     }
 
     GrPrimitiveEdgeType getEdgeType() const { return fEdgeType; }
@@ -158,7 +158,7 @@ void AARectEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBui
 }
 
 GrGLFragmentProcessor* AARectEffect::onCreateGLInstance() const  {
-    return SkNEW_ARGS(GLAARectEffect, (*this));
+    return new GLAARectEffect(*this);
 }
 
 //////////////////////////////////////////////////////////////////////////////
@@ -310,7 +310,7 @@ void GrConvexPolyEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLFragmentProcessor* GrConvexPolyEffect::onCreateGLInstance() const  {
-    return SkNEW_ARGS(GrGLConvexPolyEffect, (*this));
+    return new GrGLConvexPolyEffect(*this);
 }
 
 GrConvexPolyEffect::GrConvexPolyEffect(GrPrimitiveEdgeType edgeType, int n, const SkScalar edges[])
index ead7fe4..68cd9ec 100644 (file)
@@ -43,7 +43,7 @@ public:
         if (n <= 0 || n > kMaxEdges || kHairlineAA_GrProcessorEdgeType == edgeType) {
             return NULL;
         }
-        return SkNEW_ARGS(GrConvexPolyEffect, (edgeType, n, edges));
+        return new GrConvexPolyEffect(edgeType, n, edges);
     }
 
     /**
index 3ab9efb..f70b664 100644 (file)
@@ -201,7 +201,7 @@ void GrConvolutionEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLFragmentProcessor* GrConvolutionEffect::onCreateGLInstance() const  {
-    return SkNEW_ARGS(GrGLConvolutionEffect, (*this));
+    return new GrGLConvolutionEffect(*this);
 }
 
 bool GrConvolutionEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
index 37faa08..2cf36af 100644 (file)
@@ -28,13 +28,8 @@ public:
                                        const float* kernel,
                                        bool useBounds,
                                        float bounds[2]) {
-        return SkNEW_ARGS(GrConvolutionEffect, (procDataManager,
-                                                tex,
-                                                dir,
-                                                halfWidth,
-                                                kernel,
-                                                useBounds,
-                                                bounds));
+        return new GrConvolutionEffect(procDataManager, tex, dir, halfWidth, kernel, useBounds,
+                                       bounds);
     }
 
     /// Convolve with a Gaussian kernel
@@ -45,13 +40,8 @@ public:
                                                float gaussianSigma,
                                                bool useBounds,
                                                float bounds[2]) {
-        return SkNEW_ARGS(GrConvolutionEffect, (procDataManager,
-                                                tex,
-                                                dir,
-                                                halfWidth,
-                                                gaussianSigma,
-                                                useBounds,
-                                                bounds));
+        return new GrConvolutionEffect(procDataManager, tex, dir, halfWidth, gaussianSigma,
+                                       useBounds, bounds);
     }
 
     virtual ~GrConvolutionEffect();
index d7f4347..8a7c83b 100644 (file)
@@ -18,7 +18,7 @@
 class CoverageSetOpXP : public GrXferProcessor {
 public:
     static GrXferProcessor* Create(SkRegion::Op regionOp, bool invertCoverage) {
-        return SkNEW_ARGS(CoverageSetOpXP, (regionOp, invertCoverage));
+        return new CoverageSetOpXP(regionOp, invertCoverage);
     }
 
     ~CoverageSetOpXP() override;
@@ -102,7 +102,7 @@ void CoverageSetOpXP::onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKey
 }
 
 GrGLXferProcessor* CoverageSetOpXP::createGLInstance() const {
-    return SkNEW_ARGS(GLCoverageSetOpXP, (*this));
+    return new GLCoverageSetOpXP(*this);
 }
 
 GrXferProcessor::OptFlags
index 761e177..1fcdb12 100644 (file)
@@ -436,7 +436,7 @@ GrFragmentProcessor* GrCustomXfermode::CreateFP(GrProcessorDataManager* procData
     if (!GrCustomXfermode::IsSupportedMode(mode)) {
         return NULL;
     } else {
-        return SkNEW_ARGS(GrCustomXferFP, (procDataManager, mode, background));
+        return new GrCustomXferFP(procDataManager, mode, background);
     }
 }
 
@@ -493,7 +493,7 @@ void GrCustomXferFP::onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyB
 }
 
 GrGLFragmentProcessor* GrCustomXferFP::onCreateGLInstance() const {
-    return SkNEW_ARGS(GLCustomXferFP, (*this));
+    return new GLCustomXferFP(*this);
 }
 
 bool GrCustomXferFP::onIsEqual(const GrFragmentProcessor& other) const {
@@ -509,8 +509,8 @@ GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrCustomXferFP);
 GrFragmentProcessor* GrCustomXferFP::TestCreate(GrProcessorTestData* d) {
     int mode = d->fRandom->nextRangeU(SkXfermode::kLastCoeffMode + 1, SkXfermode::kLastSeparableMode);
 
-    return SkNEW_ARGS(GrCustomXferFP, (d->fProcDataManager, static_cast<SkXfermode::Mode>(mode),
-                                       d->fTextures[0]));
+    return new GrCustomXferFP(d->fProcDataManager, static_cast<SkXfermode::Mode>(mode),
+                              d->fTextures[0]);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -571,7 +571,7 @@ GrXPFactory* GrCustomXfermode::CreateXPFactory(SkXfermode::Mode mode) {
     if (!GrCustomXfermode::IsSupportedMode(mode)) {
         return NULL;
     } else {
-        return SkNEW_ARGS(GrCustomXPFactory, (mode));
+        return new GrCustomXPFactory(mode);
     }
 }
 
@@ -637,7 +637,7 @@ void CustomXP::onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder
 
 GrGLXferProcessor* CustomXP::createGLInstance() const {
     SkASSERT(this->willReadDstColor() != this->hasHWBlendEquation());
-    return SkNEW_ARGS(GLCustomXP, (*this));
+    return new GLCustomXP(*this);
 }
 
 bool CustomXP::onIsEqual(const GrXferProcessor& other) const {
@@ -786,9 +786,9 @@ GrCustomXPFactory::onCreateXferProcessor(const GrCaps& caps,
                                          const DstTexture* dstTexture) const {
     if (can_use_hw_blend_equation(fHWBlendEquation, coveragePOI, caps)) {
         SkASSERT(!dstTexture || !dstTexture->texture());
-        return SkNEW_ARGS(CustomXP, (fMode, fHWBlendEquation));
+        return new CustomXP(fMode, fHWBlendEquation);
     }
-    return SkNEW_ARGS(CustomXP, (dstTexture, hasMixedSamples, fMode));
+    return new CustomXP(dstTexture, hasMixedSamples, fMode);
 }
 
 bool GrCustomXPFactory::willReadDstColor(const GrCaps& caps,
@@ -809,6 +809,6 @@ GrXPFactory* GrCustomXPFactory::TestCreate(GrProcessorTestData* d) {
     int mode = d->fRandom->nextRangeU(SkXfermode::kLastCoeffMode + 1,
                                       SkXfermode::kLastSeparableMode);
 
-    return SkNEW_ARGS(GrCustomXPFactory, (static_cast<SkXfermode::Mode>(mode)));
+    return new GrCustomXPFactory(static_cast<SkXfermode::Mode>(mode));
 }
 
index 5fb45a3..89fa423 100644 (file)
@@ -259,7 +259,7 @@ public:
 
     static GrDrawBatch* Create(const Geometry& geometry, SkPaint::Cap cap, DashAAMode aaMode,
                                bool fullDash) {
-        return SkNEW_ARGS(DashBatch, (geometry, cap, aaMode, fullDash));
+        return new DashBatch(geometry, cap, aaMode, fullDash);
     }
 
     const char* name() const override { return "DashBatch"; }
@@ -929,7 +929,7 @@ GrGeometryProcessor* DashingCircleEffect::Create(GrColor color,
                                                  DashAAMode aaMode,
                                                  const SkMatrix& localMatrix,
                                                  bool usesLocalCoords) {
-    return SkNEW_ARGS(DashingCircleEffect, (color, aaMode, localMatrix, usesLocalCoords));
+    return new DashingCircleEffect(color, aaMode, localMatrix, usesLocalCoords);
 }
 
 void DashingCircleEffect::getGLProcessorKey(const GrBatchTracker& bt,
@@ -940,7 +940,7 @@ void DashingCircleEffect::getGLProcessorKey(const GrBatchTracker& bt,
 
 GrGLPrimitiveProcessor* DashingCircleEffect::createGLInstance(const GrBatchTracker& bt,
                                                               const GrGLSLCaps&) const {
-    return SkNEW_ARGS(GLDashingCircleEffect, (*this, bt));
+    return new GLDashingCircleEffect(*this, bt);
 }
 
 DashingCircleEffect::DashingCircleEffect(GrColor color,
@@ -1165,7 +1165,7 @@ GrGeometryProcessor* DashingLineEffect::Create(GrColor color,
                                                DashAAMode aaMode,
                                                const SkMatrix& localMatrix,
                                                bool usesLocalCoords) {
-    return SkNEW_ARGS(DashingLineEffect, (color, aaMode, localMatrix, usesLocalCoords));
+    return new DashingLineEffect(color, aaMode, localMatrix, usesLocalCoords);
 }
 
 void DashingLineEffect::getGLProcessorKey(const GrBatchTracker& bt,
@@ -1176,7 +1176,7 @@ void DashingLineEffect::getGLProcessorKey(const GrBatchTracker& bt,
 
 GrGLPrimitiveProcessor* DashingLineEffect::createGLInstance(const GrBatchTracker& bt,
                                                             const GrGLSLCaps&) const {
-    return SkNEW_ARGS(GLDashingLineEffect, (*this, bt));
+    return new GLDashingLineEffect(*this, bt);
 }
 
 DashingLineEffect::DashingLineEffect(GrColor color,
index 31d5849..caccf10 100644 (file)
@@ -17,9 +17,7 @@
  */
 class DisableColorXP : public GrXferProcessor {
 public:
-    static GrXferProcessor* Create() {
-        return SkNEW(DisableColorXP);
-    }
+    static GrXferProcessor* Create() { return new DisableColorXP; }
 
     ~DisableColorXP() override {};
 
@@ -83,9 +81,7 @@ void DisableColorXP::onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyB
     GLDisableColorXP::GenKey(*this, caps, b);
 }
 
-GrGLXferProcessor* DisableColorXP::createGLInstance() const {
-    return SkNEW_ARGS(GLDisableColorXP, (*this));
-}
+GrGLXferProcessor* DisableColorXP::createGLInstance() const { return new GLDisableColorXP(*this); }
 
 void DisableColorXP::onGetBlendInfo(GrXferProcessor::BlendInfo* blendInfo) const {
     blendInfo->fWriteColor = false;
index 2f57064..caa0eec 100644 (file)
@@ -15,9 +15,7 @@ class GrProcOptInfo;
 
 class GrDisableColorXPFactory : public GrXPFactory {
 public:
-    static GrXPFactory* Create() {
-        return SkNEW(GrDisableColorXPFactory);
-    }
+    static GrXPFactory* Create() { return new GrDisableColorXPFactory; }
 
     bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlags) const override {
         return true;
old mode 100755 (executable)
new mode 100644 (file)
index 8551272..5d6df72
@@ -245,7 +245,7 @@ void GrDistanceFieldA8TextGeoProc::getGLProcessorKey(const GrBatchTracker& bt,
 GrGLPrimitiveProcessor*
 GrDistanceFieldA8TextGeoProc::createGLInstance(const GrBatchTracker& bt,
                                                const GrGLSLCaps&) const {
-    return SkNEW_ARGS(GrGLDistanceFieldA8TextGeoProc, (*this, bt));
+    return new GrGLDistanceFieldA8TextGeoProc(*this, bt);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -468,7 +468,7 @@ void GrDistanceFieldPathGeoProc::getGLProcessorKey(const GrBatchTracker& bt,
 
 GrGLPrimitiveProcessor*
 GrDistanceFieldPathGeoProc::createGLInstance(const GrBatchTracker& bt, const GrGLSLCaps&) const {
-    return SkNEW_ARGS(GrGLDistanceFieldPathGeoProc, (*this, bt));
+    return new GrGLDistanceFieldPathGeoProc(*this, bt);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -741,7 +741,7 @@ void GrDistanceFieldLCDTextGeoProc::getGLProcessorKey(const GrBatchTracker& bt,
 GrGLPrimitiveProcessor*
 GrDistanceFieldLCDTextGeoProc::createGLInstance(const GrBatchTracker& bt,
                                                 const GrGLSLCaps&) const {
-    return SkNEW_ARGS(GrGLDistanceFieldLCDTextGeoProc, (*this, bt));
+    return new GrGLDistanceFieldLCDTextGeoProc(*this, bt);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
index 42c397d..b0ebdb0 100644 (file)
@@ -50,15 +50,15 @@ public:
     static GrGeometryProcessor* Create(GrColor color, const SkMatrix& viewMatrix,
                                        GrTexture* tex, const GrTextureParams& params,
                                        float lum, uint32_t flags, bool usesLocalCoords) {
-        return SkNEW_ARGS(GrDistanceFieldA8TextGeoProc, (color, viewMatrix, tex, params, lum,
-                                                         flags, usesLocalCoords));
+        return new GrDistanceFieldA8TextGeoProc(color, viewMatrix, tex, params, lum, flags,
+                                                usesLocalCoords);
     }
 #else
     static GrGeometryProcessor* Create(GrColor color, const SkMatrix& viewMatrix,
                                        GrTexture* tex, const GrTextureParams& params,
                                        uint32_t flags, bool usesLocalCoords) {
-        return SkNEW_ARGS(GrDistanceFieldA8TextGeoProc, (color, viewMatrix, tex,  params, flags,
-                                                         usesLocalCoords));
+        return new GrDistanceFieldA8TextGeoProc(color, viewMatrix, tex, params, flags,
+                                                usesLocalCoords);
     }
 #endif
 
@@ -123,8 +123,8 @@ public:
     static GrGeometryProcessor* Create(GrColor color, const SkMatrix& viewMatrix, GrTexture* tex,
                                        const GrTextureParams& params,
                                        uint32_t flags, bool usesLocalCoords) {
-        return SkNEW_ARGS(GrDistanceFieldPathGeoProc, (color, viewMatrix, tex, params, flags,
-                                                       usesLocalCoords));
+        return new GrDistanceFieldPathGeoProc(color, viewMatrix, tex, params, flags,
+                                              usesLocalCoords);
     }
 
     virtual ~GrDistanceFieldPathGeoProc() {}
@@ -194,8 +194,8 @@ public:
                                        GrTexture* tex, const GrTextureParams& params,
                                        DistanceAdjust distanceAdjust, uint32_t flags,
                                        bool usesLocalCoords) {
-        return SkNEW_ARGS(GrDistanceFieldLCDTextGeoProc,
-                          (color, viewMatrix, tex, params, distanceAdjust, flags, usesLocalCoords));
+        return new GrDistanceFieldLCDTextGeoProc(color, viewMatrix, tex, params, distanceAdjust,
+                                                 flags, usesLocalCoords);
     }
 
     virtual ~GrDistanceFieldLCDTextGeoProc() {}
index 2b10ac0..33928a0 100644 (file)
@@ -98,7 +98,7 @@ void DitherEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLFragmentProcessor* DitherEffect::onCreateGLInstance() const  {
-    return SkNEW_ARGS(GLDitherEffect, (*this));
+    return new GLDitherEffect(*this);
 }
 
 GrFragmentProcessor* GrDitherEffect::Create() { return DitherEffect::Create(); }
index 3da4c54..c5a7fb7 100644 (file)
@@ -162,7 +162,7 @@ void GrMatrixConvolutionEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLFragmentProcessor* GrMatrixConvolutionEffect::onCreateGLInstance() const  {
-    return SkNEW_ARGS(GrGLMatrixConvolutionEffect, (*this));
+    return new GrGLMatrixConvolutionEffect(*this);
 }
 
 bool GrMatrixConvolutionEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
@@ -216,16 +216,8 @@ GrMatrixConvolutionEffect::CreateGaussian(GrProcessorDataManager* procDataManage
     for (int i = 0; i < width * height; ++i) {
         kernel[i] *= scale;
     }
-    return SkNEW_ARGS(GrMatrixConvolutionEffect, (procDataManager,
-                                                  texture,
-                                                  bounds,
-                                                  kernelSize,
-                                                  kernel,
-                                                  gain,
-                                                  bias,
-                                                  kernelOffset,
-                                                  tileMode,
-                                                  convolveAlpha));
+    return new GrMatrixConvolutionEffect(procDataManager, texture, bounds, kernelSize, kernel, gain,
+                                         bias, kernelOffset, tileMode, convolveAlpha);
 }
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrMatrixConvolutionEffect);
index f3d6b24..0d6192d 100644 (file)
@@ -28,16 +28,8 @@ public:
                                        const SkIPoint& kernelOffset,
                                        GrTextureDomain::Mode tileMode,
                                        bool convolveAlpha) {
-        return SkNEW_ARGS(GrMatrixConvolutionEffect, (procDataManager,
-                                                      texture,
-                                                      bounds,
-                                                      kernelSize,
-                                                      kernel,
-                                                      gain,
-                                                      bias,
-                                                      kernelOffset,
-                                                      tileMode,
-                                                      convolveAlpha));
+        return new GrMatrixConvolutionEffect(procDataManager, texture, bounds, kernelSize, kernel,
+                                             gain, bias, kernelOffset, tileMode, convolveAlpha);
     }
 
     static GrFragmentProcessor* CreateGaussian(GrProcessorDataManager*,
index 3fb7b90..dec6ae2 100644 (file)
@@ -51,7 +51,7 @@ private:
 GrFragmentProcessor* CircleEffect::Create(GrPrimitiveEdgeType edgeType, const SkPoint& center,
                                           SkScalar radius) {
     SkASSERT(radius >= 0);
-    return SkNEW_ARGS(CircleEffect, (edgeType, center, radius));
+    return new CircleEffect(edgeType, center, radius);
 }
 
 void CircleEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const {
@@ -177,7 +177,7 @@ void CircleEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLFragmentProcessor* CircleEffect::onCreateGLInstance() const  {
-    return SkNEW_ARGS(GLCircleEffect, (*this));
+    return new GLCircleEffect(*this);
 }
 
 //////////////////////////////////////////////////////////////////////////////
@@ -221,7 +221,7 @@ GrFragmentProcessor* EllipseEffect::Create(GrPrimitiveEdgeType edgeType,
                                            SkScalar rx,
                                            SkScalar ry) {
     SkASSERT(rx >= 0 && ry >= 0);
-    return SkNEW_ARGS(EllipseEffect, (edgeType, center, rx, ry));
+    return new EllipseEffect(edgeType, center, rx, ry);
 }
 
 void EllipseEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const {
@@ -353,7 +353,7 @@ void EllipseEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLFragmentProcessor* EllipseEffect::onCreateGLInstance() const  {
-    return SkNEW_ARGS(GLEllipseEffect, (*this));
+    return new GLEllipseEffect(*this);
 }
 
 //////////////////////////////////////////////////////////////////////////////
index 0e1bc51..4a86aab 100644 (file)
@@ -420,7 +420,7 @@ void PorterDuffXferProcessor::onGetGLProcessorKey(const GrGLSLCaps&,
 }
 
 GrGLXferProcessor* PorterDuffXferProcessor::createGLInstance() const {
-    return SkNEW(GLPorterDuffXferProcessor);
+    return new GLPorterDuffXferProcessor;
 }
 
 GrXferProcessor::OptFlags
@@ -518,7 +518,7 @@ void ShaderPDXferProcessor::onGetGLProcessorKey(const GrGLSLCaps&,
 }
 
 GrGLXferProcessor* ShaderPDXferProcessor::createGLInstance() const {
-    return SkNEW(GLShaderPDXferProcessor);
+    return new GLShaderPDXferProcessor;
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -611,7 +611,7 @@ GrXferProcessor* PDLCDXferProcessor::Create(SkXfermode::Mode xfermode,
     uint8_t alpha = GrColorUnpackA(blendConstant);
     blendConstant |= (0xff << GrColor_SHIFT_A);
 
-    return SkNEW_ARGS(PDLCDXferProcessor, (blendConstant, alpha));
+    return new PDLCDXferProcessor(blendConstant, alpha);
 }
 
 PDLCDXferProcessor::~PDLCDXferProcessor() {
@@ -623,7 +623,7 @@ void PDLCDXferProcessor::onGetGLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLXferProcessor* PDLCDXferProcessor::createGLInstance() const {
-    return SkNEW_ARGS(GLPDLCDXferProcessor, (*this));
+    return new GLPDLCDXferProcessor(*this);
 }
 
 GrXferProcessor::OptFlags
@@ -691,11 +691,11 @@ GrPorterDuffXPFactory::onCreateXferProcessor(const GrCaps& caps,
 
     BlendFormula blendFormula = get_blend_formula(colorPOI, covPOI, hasMixedSamples, fXfermode);
     if (blendFormula.hasSecondaryOutput() && !caps.shaderCaps()->dualSourceBlendingSupport()) {
-        return SkNEW_ARGS(ShaderPDXferProcessor, (dstTexture, hasMixedSamples, fXfermode));
+        return new ShaderPDXferProcessor(dstTexture, hasMixedSamples, fXfermode);
     }
 
     SkASSERT(!dstTexture || !dstTexture->texture());
-    return SkNEW_ARGS(PorterDuffXferProcessor, (blendFormula));
+    return new PorterDuffXferProcessor(blendFormula);
 }
 
 bool GrPorterDuffXPFactory::supportsRGBCoverage(GrColor /*knownColor*/,
index 519d72c..62c6d3b 100644 (file)
@@ -81,7 +81,7 @@ GrFragmentProcessor* CircularRRectEffect::Create(GrPrimitiveEdgeType edgeType,
     if (kFillAA_GrProcessorEdgeType != edgeType && kInverseFillAA_GrProcessorEdgeType != edgeType) {
         return NULL;
     }
-    return SkNEW_ARGS(CircularRRectEffect, (edgeType, circularCornerFlags, rrect));
+    return new CircularRRectEffect(edgeType, circularCornerFlags, rrect);
 }
 
 void CircularRRectEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const {
@@ -368,7 +368,7 @@ void CircularRRectEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLFragmentProcessor* CircularRRectEffect::onCreateGLInstance() const  {
-    return SkNEW_ARGS(GLCircularRRectEffect, (*this));
+    return new GLCircularRRectEffect(*this);
 }
 
 //////////////////////////////////////////////////////////////////////////////
@@ -409,7 +409,7 @@ EllipticalRRectEffect::Create(GrPrimitiveEdgeType edgeType, const SkRRect& rrect
     if (kFillAA_GrProcessorEdgeType != edgeType && kInverseFillAA_GrProcessorEdgeType != edgeType) {
         return NULL;
     }
-    return SkNEW_ARGS(EllipticalRRectEffect, (edgeType, rrect));
+    return new EllipticalRRectEffect(edgeType, rrect);
 }
 
 void EllipticalRRectEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const {
@@ -617,7 +617,7 @@ void EllipticalRRectEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLFragmentProcessor* EllipticalRRectEffect::onCreateGLInstance() const  {
-    return SkNEW_ARGS(GLEllipticalRRectEffect, (*this));
+    return new GLEllipticalRRectEffect(*this);
 }
 
 //////////////////////////////////////////////////////////////////////////////
index 0bd1fcd..fb7c3a7 100644 (file)
@@ -43,7 +43,7 @@ void GrSimpleTextureEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLFragmentProcessor* GrSimpleTextureEffect::onCreateGLInstance() const  {
-    return SkNEW_ARGS(GrGLSimpleTextureEffect, (*this));
+    return new GrGLSimpleTextureEffect(*this);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
index ab10ecf..7f66f90 100644 (file)
@@ -27,8 +27,8 @@ public:
                                        GrTexture* tex,
                                        const SkMatrix& matrix,
                                        GrCoordSet coordSet = kLocal_GrCoordSet) {
-        return SkNEW_ARGS(GrSimpleTextureEffect, (procDataManager, tex, matrix,
-                                                  GrTextureParams::kNone_FilterMode, coordSet));
+        return new GrSimpleTextureEffect(procDataManager, tex, matrix,
+                                         GrTextureParams::kNone_FilterMode, coordSet);
     }
 
     /* clamp mode */
@@ -37,8 +37,7 @@ public:
                                        const SkMatrix& matrix,
                                        GrTextureParams::FilterMode filterMode,
                                        GrCoordSet coordSet = kLocal_GrCoordSet) {
-        return SkNEW_ARGS(GrSimpleTextureEffect, (procDataManager, tex, matrix, filterMode,
-                                                  coordSet));
+        return new GrSimpleTextureEffect(procDataManager, tex, matrix, filterMode, coordSet);
     }
 
     static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager,
@@ -46,7 +45,7 @@ public:
                                        const SkMatrix& matrix,
                                        const GrTextureParams& p,
                                        GrCoordSet coordSet = kLocal_GrCoordSet) {
-        return SkNEW_ARGS(GrSimpleTextureEffect, (procDataManager, tex, matrix, p, coordSet));
+        return new GrSimpleTextureEffect(procDataManager, tex, matrix, p, coordSet);
     }
 
     virtual ~GrSimpleTextureEffect() {}
index e5ae18c..c1f9ef0 100644 (file)
@@ -227,14 +227,8 @@ GrFragmentProcessor* GrTextureDomainEffect::Create(GrProcessorDataManager* procD
         (GrTextureDomain::kClamp_Mode == mode && domain.contains(kFullRect))) {
         return GrSimpleTextureEffect::Create(procDataManager, texture, matrix, filterMode);
     } else {
-
-        return SkNEW_ARGS(GrTextureDomainEffect, (procDataManager,
-                                                  texture,
-                                                  matrix,
-                                                  domain,
-                                                  mode,
-                                                  filterMode,
-                                                  coordSet));
+        return new GrTextureDomainEffect(procDataManager, texture, matrix, domain, mode, filterMode,
+                                         coordSet);
     }
 }
 
@@ -262,7 +256,7 @@ void GrTextureDomainEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLFragmentProcessor* GrTextureDomainEffect::onCreateGLInstance() const  {
-    return SkNEW_ARGS(GrGLTextureDomainEffect, (*this));
+    return new GrGLTextureDomainEffect(*this);
 }
 
 bool GrTextureDomainEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
index e8de4d7..6aeaf6f 100644 (file)
@@ -27,7 +27,7 @@ GrTextureStripAtlas::Hash* GrTextureStripAtlas::gAtlasCache = NULL;
 GrTextureStripAtlas::Hash* GrTextureStripAtlas::GetCache() {
 
     if (NULL == gAtlasCache) {
-        gAtlasCache = SkNEW(Hash);
+        gAtlasCache = new Hash;
     }
 
     return gAtlasCache;
@@ -43,10 +43,10 @@ void GrTextureStripAtlas::CleanUp(const GrContext*, void* info) {
     GetCache()->remove(entry->fDesc);
 
     // remove the actual entry
-    SkDELETE(entry);
+    delete entry;
 
     if (0 == GetCache()->count()) {
-        SkDELETE(gAtlasCache);
+        delete gAtlasCache;
         gAtlasCache = NULL;
     }
 }
@@ -54,9 +54,9 @@ void GrTextureStripAtlas::CleanUp(const GrContext*, void* info) {
 GrTextureStripAtlas* GrTextureStripAtlas::GetAtlas(const GrTextureStripAtlas::Desc& desc) {
     AtlasEntry* entry = GetCache()->find(desc);
     if (NULL == entry) {
-        entry = SkNEW(AtlasEntry);
+        entry = new AtlasEntry;
 
-        entry->fAtlas = SkNEW_ARGS(GrTextureStripAtlas, (desc));
+        entry->fAtlas = new GrTextureStripAtlas(desc);
         entry->fDesc = desc;
 
         desc.fContext->addCleanUp(CleanUp, entry);
@@ -73,7 +73,7 @@ GrTextureStripAtlas::GrTextureStripAtlas(GrTextureStripAtlas::Desc desc)
     , fDesc(desc)
     , fNumRows(desc.fHeight / desc.fRowHeight)
     , fTexture(NULL)
-    , fRows(SkNEW_ARRAY(AtlasRow, fNumRows))
+    , fRows(new AtlasRow[fNumRows])
     , fLRUFront(NULL)
     , fLRUBack(NULL) {
     SkASSERT(fNumRows * fDesc.fRowHeight == fDesc.fHeight);
@@ -82,9 +82,7 @@ GrTextureStripAtlas::GrTextureStripAtlas(GrTextureStripAtlas::Desc desc)
     VALIDATE;
 }
 
-GrTextureStripAtlas::~GrTextureStripAtlas() {
-    SkDELETE_ARRAY(fRows);
-}
+GrTextureStripAtlas::~GrTextureStripAtlas() { delete[] fRows; }
 
 int GrTextureStripAtlas::lockRow(const SkBitmap& data) {
     VALIDATE;
index 3b18706..98ac52a 100644 (file)
@@ -146,7 +146,7 @@ private:
 
         // AtlasEntry proper
         AtlasEntry() : fAtlas(NULL) {}
-        ~AtlasEntry() { SkDELETE(fAtlas); }
+        ~AtlasEntry() { delete fAtlas; }
         Desc fDesc;
         GrTextureStripAtlas* fAtlas;
     };
index 913c37e..84be8c3 100644 (file)
@@ -40,8 +40,8 @@ public:
              (sizes[2].fHeight != sizes[0].fHeight)) ?
             GrTextureParams::kBilerp_FilterMode :
             GrTextureParams::kNone_FilterMode;
-        return SkNEW_ARGS(YUVtoRGBEffect, (procDataManager, yTexture, uTexture, vTexture, yuvMatrix,
-                                           uvFilterMode, colorSpace));
+        return new YUVtoRGBEffect(procDataManager, yTexture, uTexture, vTexture, yuvMatrix,
+                                  uvFilterMode, colorSpace);
     }
 
     const char* name() const override { return "YUV to RGB"; }
@@ -123,9 +123,7 @@ private:
         this->addTextureAccess(&fVAccess);
     }
 
-    GrGLFragmentProcessor* onCreateGLInstance() const override {
-        return SkNEW_ARGS(GLProcessor, (*this));
-    }
+    GrGLFragmentProcessor* onCreateGLInstance() const override { return new GLProcessor(*this); }
 
     virtual void onGetGLProcessorKey(const GrGLSLCaps& caps,
                                      GrProcessorKeyBuilder* b) const override {
index 9b07246..adb11df 100644 (file)
@@ -58,7 +58,7 @@ const GrGLInterface* GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) {
         return NULL;
     }
 
-    GrGLInterface* interface = SkNEW(GrGLInterface());
+    GrGLInterface* interface = new GrGLInterface();
     GrGLInterface::Functions* functions = &interface->fFunctions;
 
     GET_PROC(ActiveTexture);
@@ -487,7 +487,7 @@ const GrGLInterface* GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get) {
         return NULL;
     }
 
-    GrGLInterface* interface = SkNEW(GrGLInterface);
+    GrGLInterface* interface = new GrGLInterface;
     GrGLInterface::Functions* functions = &interface->fFunctions;
 
     GET_PROC(ActiveTexture);
index af0fa78..19d6a80 100644 (file)
@@ -54,7 +54,7 @@ GrGLCaps::GrGLCaps(const GrContextOptions& contextOptions,
 
     fReadPixelsSupportedCache.reset();
 
-    fShaderCaps.reset(SkNEW_ARGS(GrGLSLCaps, (contextOptions)));
+    fShaderCaps.reset(new GrGLSLCaps(contextOptions));
 
     this->init(contextOptions, ctxInfo, glInterface);
 }
index ee840b3..b4fb3ea 100644 (file)
@@ -60,7 +60,7 @@ GrGLContext* GrGLContext::Create(const GrGLInterface* interface, const GrContext
 
     args.fContextOptions = &options;
 
-    return SkNEW_ARGS(GrGLContext, (args));
+    return new GrGLContext(args);
 }
 
 GrGLContextInfo::GrGLContextInfo(const ConstructorArgs& args) {
@@ -72,5 +72,5 @@ GrGLContextInfo::GrGLContextInfo(const ConstructorArgs& args) {
     fDriver = args.fDriver;
     fDriverVersion = args.fDriverVersion;
 
-    fGLCaps.reset(SkNEW_ARGS(GrGLCaps, (*args.fContextOptions, *this, fInterface)));
+    fGLCaps.reset(new GrGLCaps(*args.fContextOptions, *this, fInterface));
 }
index 886aacd..37d0285 100644 (file)
@@ -24,16 +24,16 @@ public:
 
     BufferObj(GrGLuint id) : fID(id), fDataPtr(NULL), fSize(0), fMapped(false) {
     }
-    ~BufferObj() { SkDELETE_ARRAY(fDataPtr); }
+    ~BufferObj() { delete[] fDataPtr; }
 
     void allocate(GrGLsizeiptr size, const GrGLchar* dataPtr) {
         if (fDataPtr) {
             SkASSERT(0 != fSize);
-            SkDELETE_ARRAY(fDataPtr);
+            delete[] fDataPtr;
         }
 
         fSize = size;
-        fDataPtr = SkNEW_ARRAY(char, size);
+        fDataPtr = new char[size];
     }
 
     GrGLuint id() const          { return fID; }
@@ -82,14 +82,14 @@ public:
         if (kFreeListEnd == fFreeListHead) {
             // no free slots - create a new one
             id = fBuffers.count();
-            buffer = SkNEW_ARGS(BufferObj, (id));
+            buffer = new BufferObj(id);
             *fBuffers.append() = buffer;
         } else {
             // grab the head of the free list and advance the head to the next free slot.
             id = static_cast<GrGLuint>(fFreeListHead);
             fFreeListHead = reinterpret_cast<intptr_t>(fBuffers[id]);
 
-            buffer = SkNEW_ARGS(BufferObj, (id));
+            buffer = new BufferObj(id);
             fBuffers[id] = buffer;
         }
 
@@ -100,7 +100,7 @@ public:
         SkASSERT(fBuffers.count() > 0);
 
         GrGLuint id = buffer->id();
-        SkDELETE(buffer);
+        delete buffer;
 
         fBuffers[id] = reinterpret_cast<BufferObj*>(fFreeListHead);
         fFreeListHead = id;
@@ -141,8 +141,8 @@ public:
         , fCurrShaderID(0) {}
 
 private:
-    static void* Create() { return SkNEW(ThreadContext ); }
-    static void Delete(void* context) { SkDELETE(reinterpret_cast<ThreadContext *>(context)); }
+    static void* Create() { return new ThreadContext; }
+    static void Delete(void* context) { delete reinterpret_cast<ThreadContext*>(context); }
 };
 
 // Functions not declared in GrGLBogusInterface.h (not common with the Debug GL interface).
@@ -343,7 +343,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE nullGLGetBufferParameteriv(GrGLenum target, GrGLenu
 } // end anonymous namespace
 
 const GrGLInterface* GrGLCreateNullInterface() {
-    GrGLInterface* interface = SkNEW(GrGLInterface);
+    GrGLInterface* interface = new GrGLInterface;
 
     interface->fStandard = kGL_GrGLStandard;
 
index 5ccb339..f2d54ff 100644 (file)
@@ -31,7 +31,7 @@ static int find_string(const SkTArray<SkString>& strings, const char ext[]) {
     return idx;
 }
 
-GrGLExtensions::GrGLExtensions(const GrGLExtensions& that) : fStrings(SkNEW(SkTArray<SkString>)) {
+GrGLExtensions::GrGLExtensions(const GrGLExtensions& that) : fStrings(new SkTArray<SkString>) {
     *this = that;
 }
 
@@ -112,7 +112,7 @@ bool GrGLExtensions::remove(const char ext[]) {
         // This is not terribly effecient but we really only expect this function to be called at
         // most a handful of times when our test programs start.
         SkAutoTDelete< SkTArray<SkString> > oldStrings(fStrings.detach());
-        fStrings.reset(SkNEW(SkTArray<SkString>(oldStrings->count() - 1)));
+        fStrings.reset(new SkTArray<SkString>(oldStrings->count() - 1));
         fStrings->push_back_n(idx, &oldStrings->front());
         fStrings->push_back_n(oldStrings->count() - idx - 1, &(*oldStrings)[idx] + 1);
         return true;
index c46b002..05ee375 100644 (file)
@@ -20,7 +20,7 @@ public:
 
     virtual ~GrGLFragmentProcessor() {
         for (int i = 0; i < fChildProcessors.count(); ++i) {
-            SkDELETE(fChildProcessors[i]);
+            delete fChildProcessors[i];
         }
     }
 
index 9cc699c..92cfba1 100644 (file)
@@ -173,7 +173,7 @@ GrGpu* GrGLGpu::Create(GrBackendContext backendContext, const GrContextOptions&
     }
     GrGLContext* glContext = GrGLContext::Create(glInterface, options);
     if (glContext) {
-        return SkNEW_ARGS(GrGLGpu, (glContext, context));
+        return new GrGLGpu(glContext, context);
     }
     return NULL;
 }
@@ -207,7 +207,7 @@ GrGLGpu::GrGLGpu(GrGLContext* ctx, GrContext* context)
         SkDebugf("%s", this->glCaps().dump().c_str());
     }
 
-    fProgramCache = SkNEW_ARGS(ProgramCache, (this));
+    fProgramCache = new ProgramCache(this);
 
     SkASSERT(this->glCaps().maxVertexAttributes() >= GrGeometryProcessor::kMaxVertexAttribs);
 
@@ -449,9 +449,9 @@ GrTexture* GrGLGpu::onWrapBackendTexture(const GrBackendTextureDesc& desc,
                                              idDesc.fTextureID, &rtIDDesc)) {
             return NULL;
         }
-        texture = SkNEW_ARGS(GrGLTextureRenderTarget, (this, surfDesc, idDesc, rtIDDesc));
+        texture = new GrGLTextureRenderTarget(this, surfDesc, idDesc, rtIDDesc);
     } else {
-        texture = SkNEW_ARGS(GrGLTexture, (this, surfDesc, idDesc));
+        texture = new GrGLTexture(this, surfDesc, idDesc);
     }
     if (NULL == texture) {
         return NULL;
@@ -484,7 +484,7 @@ GrRenderTarget* GrGLGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDe
     desc.fSampleCnt = SkTMin(wrapDesc.fSampleCnt, this->caps()->maxSampleCount());
     desc.fOrigin = resolve_origin(wrapDesc.fOrigin, true);
 
-    GrRenderTarget* tgt = SkNEW_ARGS(GrGLRenderTarget, (this, desc, idDesc));
+    GrRenderTarget* tgt = new GrGLRenderTarget(this, desc, idDesc);
     if (wrapDesc.fStencilBits) {
         GrGLStencilAttachment::IDDesc sbDesc;
         GrGLStencilAttachment::Format format;
@@ -492,13 +492,8 @@ GrRenderTarget* GrGLGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDe
         format.fPacked = false;
         format.fStencilBits = wrapDesc.fStencilBits;
         format.fTotalBits = wrapDesc.fStencilBits;
-        GrGLStencilAttachment* sb = SkNEW_ARGS(GrGLStencilAttachment,
-                                           (this,
-                                            sbDesc,
-                                            desc.fWidth,
-                                            desc.fHeight,
-                                            desc.fSampleCnt,
-                                            format));
+        GrGLStencilAttachment* sb = new GrGLStencilAttachment(
+                this, sbDesc, desc.fWidth, desc.fHeight, desc.fSampleCnt, format);
         tgt->renderTargetPriv().didAttachStencilAttachment(sb);
         sb->unref();
     }
@@ -1083,9 +1078,9 @@ GrTexture* GrGLGpu::onCreateTexture(const GrSurfaceDesc& desc,
             GL_CALL(DeleteTextures(1, &idDesc.fTextureID));
             return return_null_texture();
         }
-        tex = SkNEW_ARGS(GrGLTextureRenderTarget, (this, desc, idDesc, rtIDDesc));
+        tex = new GrGLTextureRenderTarget(this, desc, idDesc, rtIDDesc);
     } else {
-        tex = SkNEW_ARGS(GrGLTexture, (this, desc, idDesc));
+        tex = new GrGLTexture(this, desc, idDesc);
     }
     tex->setCachedTexParams(initialTexParams, this->getResetTimestamp());
 #ifdef TRACE_TEXTURE_CREATION
@@ -1143,7 +1138,7 @@ GrTexture* GrGLGpu::onCreateCompressedTexture(const GrSurfaceDesc& desc,
     }
 
     GrGLTexture* tex;
-    tex = SkNEW_ARGS(GrGLTexture, (this, desc, idDesc));
+    tex = new GrGLTexture(this, desc, idDesc);
     tex->setCachedTexParams(initialTexParams, this->getResetTimestamp());
 #ifdef TRACE_TEXTURE_CREATION
     SkDebugf("--- new compressed texture [%d] size=(%d %d) config=%d\n",
@@ -1223,8 +1218,8 @@ bool GrGLGpu::createStencilAttachmentForRenderTarget(GrRenderTarget* rt, int wid
             // whatever sizes GL gives us. In that case we query for the size.
             GrGLStencilAttachment::Format format = sFmt;
             get_stencil_rb_sizes(this->glInterface(), &format);
-            SkAutoTUnref<GrGLStencilAttachment> sb(SkNEW_ARGS(GrGLStencilAttachment,
-                                                  (this, sbDesc, width, height, samples, format)));
+            SkAutoTUnref<GrGLStencilAttachment> sb(
+                    new GrGLStencilAttachment(this, sbDesc, width, height, samples, format));
             if (this->attachStencilAttachmentToRenderTarget(sb, rt)) {
                 fLastSuccessfulStencilFmtIdx = sIdx;
                 rt->renderTargetPriv().didAttachStencilAttachment(sb);
@@ -1366,7 +1361,7 @@ GrVertexBuffer* GrGLGpu::onCreateVertexBuffer(size_t size, bool dynamic) {
 
     if (this->glCaps().useNonVBOVertexAndIndexDynamicData() && desc.fDynamic) {
         desc.fID = 0;
-        GrGLVertexBuffer* vertexBuffer = SkNEW_ARGS(GrGLVertexBuffer, (this, desc));
+        GrGLVertexBuffer* vertexBuffer = new GrGLVertexBuffer(this, desc);
         return vertexBuffer;
     } else {
         GL_CALL(GenBuffers(1, &desc.fID));
@@ -1384,7 +1379,7 @@ GrVertexBuffer* GrGLGpu::onCreateVertexBuffer(size_t size, bool dynamic) {
                 this->notifyVertexBufferDelete(desc.fID);
                 return NULL;
             }
-            GrGLVertexBuffer* vertexBuffer = SkNEW_ARGS(GrGLVertexBuffer, (this, desc));
+            GrGLVertexBuffer* vertexBuffer = new GrGLVertexBuffer(this, desc);
             return vertexBuffer;
         }
         return NULL;
@@ -1398,7 +1393,7 @@ GrIndexBuffer* GrGLGpu::onCreateIndexBuffer(size_t size, bool dynamic) {
 
     if (this->glCaps().useNonVBOVertexAndIndexDynamicData() && desc.fDynamic) {
         desc.fID = 0;
-        GrIndexBuffer* indexBuffer = SkNEW_ARGS(GrGLIndexBuffer, (this, desc));
+        GrIndexBuffer* indexBuffer = new GrGLIndexBuffer(this, desc);
         return indexBuffer;
     } else {
         GL_CALL(GenBuffers(1, &desc.fID));
@@ -1416,7 +1411,7 @@ GrIndexBuffer* GrGLGpu::onCreateIndexBuffer(size_t size, bool dynamic) {
                 this->notifyIndexBufferDelete(desc.fID);
                 return NULL;
             }
-            GrIndexBuffer* indexBuffer = SkNEW_ARGS(GrGLIndexBuffer, (this, desc));
+            GrIndexBuffer* indexBuffer = new GrGLIndexBuffer(this, desc);
             return indexBuffer;
         }
         return NULL;
@@ -3182,7 +3177,7 @@ GrGLAttribArrayState* GrGLGpu::HWGeometryState::internalBind(GrGLGpu* gpu,
             GrGLuint arrayID;
             GR_GL_CALL(gpu->glInterface(), GenVertexArrays(1, &arrayID));
             int attrCount = gpu->glCaps().maxVertexAttributes();
-            fVBOVertexArray = SkNEW_ARGS(GrGLVertexArray, (arrayID, attrCount));
+            fVBOVertexArray = new GrGLVertexArray(arrayID, attrCount);
         }
         if (ibufferID) {
             attribState = fVBOVertexArray->bindWithIndexBuffer(gpu, *ibufferID);
index defb81a..4be8a76 100644 (file)
@@ -341,7 +341,7 @@ private:
     public:
         HWGeometryState() { fVBOVertexArray = NULL; this->invalidate(); }
 
-        ~HWGeometryState() { SkDELETE(fVBOVertexArray); }
+        ~HWGeometryState() { delete fVBOVertexArray; }
 
         void invalidate() {
             fBoundVertexArrayIDIsValid = false;
index 11e237a..c6b673b 100644 (file)
@@ -58,7 +58,7 @@ GrGLGpu::ProgramCache::ProgramCache(GrGLGpu* gpu)
 
 GrGLGpu::ProgramCache::~ProgramCache() {
     for (int i = 0; i < fCount; ++i){
-        SkDELETE(fEntries[i]);
+        delete fEntries[i];
     }
     // dump stats
 #ifdef PROGRAM_CACHE_STATS
@@ -80,7 +80,7 @@ void GrGLGpu::ProgramCache::abandon() {
     for (int i = 0; i < fCount; ++i) {
         SkASSERT(fEntries[i]->fProgram.get());
         fEntries[i]->fProgram->abandon();
-        SkDELETE(fEntries[i]);
+        delete fEntries[i];
     }
     fCount = 0;
 }
@@ -131,7 +131,7 @@ GrGLProgram* GrGLGpu::ProgramCache::refProgram(const DrawArgs& args) {
         }
         int purgeIdx = 0;
         if (fCount < kMaxEntries) {
-            entry = SkNEW(Entry);
+            entry = new Entry;
             purgeIdx = fCount++;
             fEntries[purgeIdx] = entry;
         } else {
index ffc2ea0..fca7bf2 100644 (file)
@@ -75,7 +75,7 @@ GrGLInterface::GrGLInterface() {
 GrGLInterface* GrGLInterface::NewClone(const GrGLInterface* interface) {
     SkASSERT(interface);
 
-    GrGLInterface* clone = SkNEW(GrGLInterface);
+    GrGLInterface* clone = new GrGLInterface;
     clone->fStandard = interface->fStandard;
     clone->fExtensions = interface->fExtensions;
     clone->fFunctions = interface->fFunctions;
index 94792f1..49d4564 100644 (file)
@@ -319,10 +319,10 @@ public:
             return this->takeRef();
         }
 
-        SparseNameRange* left = SkNEW_ARGS(ContiguousNameRange, (fFirst, name));
+        SparseNameRange* left = new ContiguousNameRange(fFirst, name);
         SparseNameRange* right = this->takeRef();
         fFirst = name + 1;
-        return SkNEW_ARGS(SparseNameTree, (left, right));
+        return new SparseNameTree(left, right);
     }
 };
 
@@ -338,7 +338,7 @@ GrGLNameAllocator::~GrGLNameAllocator() {
 
 GrGLuint GrGLNameAllocator::allocateName() {
     if (NULL == fAllocatedNames.get()) {
-        fAllocatedNames.reset(SkNEW_ARGS(ContiguousNameRange, (fFirstName, fFirstName + 1)));
+        fAllocatedNames.reset(new ContiguousNameRange(fFirstName, fFirstName + 1));
         return fFirstName;
     }
 
index 7c77155..22b12bf 100644 (file)
@@ -82,12 +82,12 @@ void GrGLPathRendering::resetContext() {
 }
 
 GrPath* GrGLPathRendering::createPath(const SkPath& inPath, const GrStrokeInfo& stroke) {
-    return SkNEW_ARGS(GrGLPath, (this->gpu(), inPath, stroke));
+    return new GrGLPath(this->gpu(), inPath, stroke);
 }
 
 GrPathRange* GrGLPathRendering::createPathRange(GrPathRange::PathGenerator* pathGenerator,
                                                 const GrStrokeInfo& stroke) {
-    return SkNEW_ARGS(GrGLPathRange, (this->gpu(), pathGenerator, stroke));
+    return new GrGLPathRange(this->gpu(), pathGenerator, stroke);
 }
 
 void GrGLPathRendering::onStencilPath(const StencilPathArgs& args, const GrPath* path) {
@@ -240,7 +240,7 @@ GrGLuint GrGLPathRendering::genPaths(GrGLsizei range) {
         static const int range = 65536;
         GrGLuint firstName;
         GL_CALL_RET(firstName, GenPaths(range));
-        fPathNameAllocator.reset(SkNEW_ARGS(GrGLNameAllocator, (firstName, firstName + range)));
+        fPathNameAllocator.reset(new GrGLNameAllocator(firstName, firstName + range));
     }
 
     // When allocating names one at a time, pull from a client-side pool of
index 8975a98..75fbf2b 100644 (file)
@@ -105,7 +105,7 @@ void SkGLContext::testAbandon() {
 }
 
 SkGLContext::GLFenceSync* SkGLContext::GLFenceSync::CreateIfSupported(const SkGLContext* ctx) {
-    SkAutoTDelete<GLFenceSync> ret(SkNEW(GLFenceSync));
+    SkAutoTDelete<GLFenceSync> ret(new GLFenceSync);
 
     if (kGL_GrGLStandard == ctx->gl()->fStandard) {
         const GrGLubyte* versionStr;
index c59fb98..dddea76 100644 (file)
@@ -22,16 +22,16 @@ public:
     
 
     BufferObj(GrGLuint id) : fID(id), fDataPtr(NULL), fSize(0), fMapped(false) {}
-    ~BufferObj() { SkDELETE_ARRAY(fDataPtr); }
+    ~BufferObj() { delete[] fDataPtr; }
 
     void allocate(GrGLsizeiptr size, const GrGLchar* dataPtr) {
         if (fDataPtr) {
             SkASSERT(0 != fSize);
-            SkDELETE_ARRAY(fDataPtr);
+            delete[] fDataPtr;
         }
 
         fSize = size;
-        fDataPtr = SkNEW_ARRAY(char, size);
+        fDataPtr = new char[size];
     }
 
     GrGLuint id() const          { return fID; }
@@ -80,14 +80,14 @@ public:
         if (kFreeListEnd == fFreeListHead) {
             // no free slots - create a new one
             id = fBuffers.count();
-            buffer = SkNEW_ARGS(BufferObj, (id));
+            buffer = new BufferObj(id);
             *fBuffers.append() = buffer;
         } else {
             // grab the head of the free list and advance the head to the next free slot.
             id = static_cast<GrGLuint>(fFreeListHead);
             fFreeListHead = reinterpret_cast<intptr_t>(fBuffers[id]);
 
-            buffer = SkNEW_ARGS(BufferObj, (id));
+            buffer = new BufferObj(id);
             fBuffers[id] = buffer;
         }
 
@@ -98,7 +98,7 @@ public:
         SkASSERT(fBuffers.count() > 0);
 
         GrGLuint id = buffer->id();
-        SkDELETE(buffer);
+        delete buffer;
 
         fBuffers[id] = reinterpret_cast<BufferObj*>(fFreeListHead);
         fFreeListHead = id;
@@ -346,7 +346,7 @@ public:
 } // end anonymous namespace
 
 static GrGLInterface* create_null_interface(State* state) {
-    GrGLInterface* interface = SkNEW_ARGS(NullInterface, (state));
+    GrGLInterface* interface = new NullInterface(state);
 
     interface->fStandard = kGL_GrGLStandard;
 
@@ -498,7 +498,7 @@ static GrGLInterface* create_null_interface(State* state) {
 //////////////////////////////////////////////////////////////////////////////
 
 static void* create_tls() {
-    State** current = SkNEW(State*);
+    State** current = new State*;
     *current = NULL;
     return current;
 }
@@ -508,7 +508,7 @@ static void delete_tls(void* ctx) {
     if (*current) {
         (*current)->unref();
     }
-    SkDELETE(current);
+    delete current;
 }
 
 static State* current_context() {
@@ -536,16 +536,16 @@ SkNullGLContext* SkNullGLContext::Create(GrGLStandard forcedGpuAPI) {
     if (kGLES_GrGLStandard == forcedGpuAPI) {
         return NULL;
     }
-    SkNullGLContext* ctx = SkNEW(SkNullGLContext);
+    SkNullGLContext* ctx = new SkNullGLContext;
     if (!ctx->isValid()) {
-        SkDELETE(ctx);
+        delete ctx;
         return NULL;
     }
     return ctx;
 }
 
 SkNullGLContext::SkNullGLContext() {
-    fState = SkNEW(ContextState);
+    fState = new ContextState;
     GrGLInterface* interface = create_null_interface(fState);
     this->init(interface);
 #if GR_GL_PER_GL_FUNC_CALLBACK
index 9bebe0d..426676f 100644 (file)
@@ -18,12 +18,9 @@ GrGLPathProgramBuilder::GrGLPathProgramBuilder(GrGLGpu* gpu, const DrawArgs& arg
 }
 
 GrGLProgram* GrGLPathProgramBuilder::createProgram(GrGLuint programID) {
-    return SkNEW_ARGS(GrGLPathProgram, (fGpu, this->desc(), fUniformHandles, programID,
-                                        fUniforms,
-                                        fSeparableVaryingInfos,
-                                        fGeometryProcessor,
-                                        fXferProcessor, fFragmentProcessors.get(),
-                                        &fSamplerUniforms));
+    return new GrGLPathProgram(fGpu, this->desc(), fUniformHandles, programID, fUniforms,
+                               fSeparableVaryingInfos, fGeometryProcessor, fXferProcessor,
+                               fFragmentProcessors.get(), &fSamplerUniforms);
 }
 
 GrGLProgramBuilder::SeparableVaryingHandle GrGLPathProgramBuilder::addSeparableVarying(
index 2db5686..39d8ec5 100644 (file)
@@ -55,9 +55,9 @@ GrGLProgramBuilder* GrGLProgramBuilder::CreateProgramBuilder(const DrawArgs& arg
         SkASSERT(gpu->glCaps().shaderCaps()->pathRenderingSupport() &&
                  !args.fPrimitiveProcessor->willUseGeoShader() &&
                  args.fPrimitiveProcessor->numAttribs() == 0);
-        return SkNEW_ARGS(GrGLPathProgramBuilder, (gpu, args));
+        return new GrGLPathProgramBuilder(gpu, args);
     } else {
-        return SkNEW_ARGS(GrGLProgramBuilder, (gpu, args));
+        return new GrGLProgramBuilder(gpu, args);
     }
 }
 
@@ -203,7 +203,7 @@ bool GrGLProgramBuilder::emitAndInstallProcs(GrGLSLExpr4* inputColor, GrGLSLExpr
 
     this->emitAndInstallProc(primProc, inputColor, inputCoverage);
 
-    fFragmentProcessors.reset(SkNEW(GrGLInstalledFragProcs));
+    fFragmentProcessors.reset(new GrGLInstalledFragProcs);
     int numProcs = this->pipeline().numFragmentStages();
     this->emitAndInstallFragProcs(0, this->pipeline().numColorFragmentStages(), inputColor);
     this->emitAndInstallFragProcs(this->pipeline().numColorFragmentStages(), numProcs,
@@ -280,7 +280,7 @@ void GrGLProgramBuilder::emitAndInstallProc(const GrPendingFragmentStage& fs,
                                             int index,
                                             const char* outColor,
                                             const char* inColor) {
-    GrGLInstalledFragProc* ifp = SkNEW(GrGLInstalledFragProc);
+    GrGLInstalledFragProc* ifp = new GrGLInstalledFragProc;
 
     const GrFragmentProcessor& fp = *fs.processor();
     ifp->fGLProc.reset(fp.createGLInstance());
@@ -301,7 +301,7 @@ void GrGLProgramBuilder::emitAndInstallProc(const GrPrimitiveProcessor& gp,
                                             const char* outColor,
                                             const char* outCoverage) {
     SkASSERT(!fGeometryProcessor);
-    fGeometryProcessor = SkNEW(GrGLInstalledGeoProc);
+    fGeometryProcessor = new GrGLInstalledGeoProc;
 
     const GrBatchTracker& bt = this->batchTracker();
     fGeometryProcessor->fGLProc.reset(gp.createGLInstance(bt, *fGpu->glCaps().glslCaps()));
@@ -325,7 +325,7 @@ void GrGLProgramBuilder::emitAndInstallXferProc(const GrXferProcessor& xp,
     AutoStageAdvance adv(this);
 
     SkASSERT(!fXferProcessor);
-    fXferProcessor = SkNEW(GrGLInstalledXferProc);
+    fXferProcessor = new GrGLInstalledXferProc;
 
     fXferProcessor->fGLProc.reset(xp.createGLInstance());
 
@@ -492,9 +492,9 @@ void GrGLProgramBuilder::cleanupShaders(const SkTDArray<GrGLuint>& shaderIDs) {
 }
 
 GrGLProgram* GrGLProgramBuilder::createProgram(GrGLuint programID) {
-    return SkNEW_ARGS(GrGLProgram, (fGpu, this->desc(), fUniformHandles, programID, fUniforms,
-                                    fGeometryProcessor, fXferProcessor, fFragmentProcessors.get(),
-                                    &fSamplerUniforms));
+    return new GrGLProgram(fGpu, this->desc(), fUniformHandles, programID, fUniforms,
+                           fGeometryProcessor, fXferProcessor, fFragmentProcessors.get(),
+                           &fSamplerUniforms);
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -502,6 +502,6 @@ GrGLProgram* GrGLProgramBuilder::createProgram(GrGLuint programID) {
 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() {
     int numProcs = fProcs.count();
     for (int e = 0; e < numProcs; ++e) {
-        SkDELETE(fProcs[e]);
+        delete fProcs[e];
     }
 }
index 9192725..ae6a978 100644 (file)
@@ -93,7 +93,7 @@ public:
         SkASSERT(0 < gStaticRefCount);
 
         if (NULL == gObj) {
-            gObj = SkNEW(GrDebugGL);
+            gObj = new GrDebugGL;
         }
 
         return gObj;
@@ -109,7 +109,7 @@ public:
         SkASSERT(gStaticRefCount > 0);
         gStaticRefCount--;
         if (0 == gStaticRefCount) {
-            SkDELETE(gObj);
+            delete gObj;
             gObj = NULL;
         }
     }
index 27e27ce..3058051 100644 (file)
@@ -79,10 +79,8 @@ private:
 // factory creation entry point. This entry point is used by the GrGLDebug
 // object to instantiate the various objects
 // all globally unique IDs
-#define GR_DEFINE_CREATOR(className)                        \
-    public:                                                 \
-    static GrFakeRefObj *create ## className() {            \
-        return SkNEW(className);                            \
-    }
+#define GR_DEFINE_CREATOR(className) \
+public:                              \
+    static GrFakeRefObj *create##className() { return new className; }
 
 #endif // GrFakeRefObj_DEFINED
index 8b0f8c5..ef52fb6 100644 (file)
@@ -836,7 +836,7 @@ private:
 
 ////////////////////////////////////////////////////////////////////////////////
 const GrGLInterface* GrGLCreateDebugInterface() {
-    GrGLInterface* interface = SkNEW(GrDebugGLInterface);
+    GrGLInterface *interface = new GrDebugGLInterface;
 
     interface->fStandard = kGL_GrGLStandard;
 
index 6a4d9fc..0a61f72 100644 (file)
@@ -18,7 +18,7 @@ public:
         if (kGLES_GrGLStandard == forcedGpuAPI) {
             return NULL;
         }
-        return SkNEW(SkDebugGLContext);
+        return new SkDebugGLContext;
     }
 private:
     void onPlatformMakeCurrent() const override {}
index 9ed57a3..9bdedf7 100644 (file)
@@ -236,7 +236,7 @@ SkEGLFenceSync* SkEGLFenceSync::CreateIfSupported(EGLDisplay display) {
     if (!display || !supports_egl_extension(display, "EGL_KHR_fence_sync")) {
         return NULL;
     }
-    return SkNEW_ARGS(SkEGLFenceSync, (display));
+    return new SkEGLFenceSync(display);
 }
 
 SkPlatformGpuFence SkEGLFenceSync::insertFence() const {
@@ -259,9 +259,9 @@ void SkEGLFenceSync::deleteFence(SkPlatformGpuFence platformFence) const {
 } // anonymous namespace
 
 SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI) {
-    EGLGLContext* ctx = SkNEW_ARGS(EGLGLContext, (forcedGpuAPI));
+    EGLGLContext* ctx = new EGLGLContext(forcedGpuAPI);
     if (!ctx->isValid()) {
-        SkDELETE(ctx);
+        delete ctx;
         return NULL;
     }
     return ctx;
index 7933757..cabd443 100644 (file)
@@ -332,9 +332,9 @@ GrGLFuncPtr GLXGLContext::onPlatformGetProcAddress(const char* procName) const {
 } // anonymous namespace
 
 SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI) {
-    GLXGLContext* ctx = SkNEW_ARGS(GLXGLContext, (forcedGpuAPI));
+    GLXGLContext *ctx = new GLXGLContext(forcedGpuAPI);
     if (!ctx->isValid()) {
-        SkDELETE(ctx);
+        delete ctx;
         return NULL;
     }
     return ctx;
index d2d8569..4754c01 100644 (file)
@@ -110,9 +110,9 @@ SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI) {
     if (kGLES_GrGLStandard == forcedGpuAPI) {
         return NULL;
     }
-    MacGLContext* ctx = SkNEW(MacGLContext);
+    MacGLContext* ctx = new MacGLContext;
     if (!ctx->isValid()) {
-        SkDELETE(ctx);
+        delete ctx;
         return NULL;
     }
     return ctx;
index fa3df7b..1548bfd 100644 (file)
@@ -23,9 +23,9 @@ public:
         if (kGLES_GrGLStandard == forcedGpuAPI) {
             return NULL;
         }
-        SkMesaGLContext* ctx = SkNEW(SkMesaGLContext);
+        SkMesaGLContext* ctx = new SkMesaGLContext;
         if (!ctx->isValid()) {
-            SkDELETE(ctx);
+            delete ctx;
             return NULL;
         }
         return ctx;
index 8a4c5db..0517f73 100644 (file)
@@ -188,9 +188,9 @@ GrGLFuncPtr WinGLContext::onPlatformGetProcAddress(const char* name) const {
 } // anonymous namespace
 
 SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI) {
-    WinGLContext* ctx = SkNEW_ARGS(WinGLContext, (forcedGpuAPI));
+    WinGLContext* ctx = new WinGLContext(forcedGpuAPI);
     if (!ctx->isValid()) {
-        SkDELETE(ctx);
+        delete ctx;
         return NULL;
     }
     return ctx;
index 715b4f4..3cefec2 100644 (file)
@@ -247,8 +247,8 @@ SkImage* SkImage::NewFromBitmap(const SkBitmap& bm) {
             unrefCopy.reset(tex);
         }
         const SkImageInfo info = bm.info();
-        return SkNEW_ARGS(SkImage_Gpu, (info.width(), info.height(), bm.getGenerationID(),
-                                        info.alphaType(), tex, 0, SkSurface::kNo_Budgeted));
+        return new SkImage_Gpu(info.width(), info.height(), bm.getGenerationID(), info.alphaType(),
+                               tex, 0, SkSurface::kNo_Budgeted);
     }
 #endif
 
index d172df8..1be6eaa 100644 (file)
@@ -149,9 +149,7 @@ static SkImage* new_wrapped_texture_common(GrContext* ctx, const GrBackendTextur
     }
 
     const SkSurface::Budgeted budgeted = SkSurface::kNo_Budgeted;
-    return SkNEW_ARGS(SkImage_Gpu,
-                      (desc.fWidth, desc.fHeight, kNeedNewImageUniqueID, at, tex, 0, budgeted));
-
+    return new SkImage_Gpu(desc.fWidth, desc.fHeight, kNeedNewImageUniqueID, at, tex, 0, budgeted);
 }
 
 SkImage* SkImage::NewFromTexture(GrContext* ctx, const GrBackendTextureDesc& desc, SkAlphaType at,
@@ -184,8 +182,8 @@ SkImage* SkImage::NewFromTextureCopy(GrContext* ctx, const GrBackendTextureDesc&
 
     const SkSurface::Budgeted budgeted = SkSurface::kYes_Budgeted;
     const int sampleCount = 0;  // todo: make this an explicit parameter to newSurface()?
-    return SkNEW_ARGS(SkImage_Gpu, (desc.fWidth, desc.fHeight, kNeedNewImageUniqueID,
-                                    at, dst, sampleCount, budgeted));
+    return new SkImage_Gpu(desc.fWidth, desc.fHeight, kNeedNewImageUniqueID, at, dst, sampleCount,
+                           budgeted);
 }
 
 SkImage* SkImage::NewFromYUVTexturesCopy(GrContext* ctx , SkYUVColorSpace colorSpace,
@@ -258,8 +256,8 @@ SkImage* SkImage::NewFromYUVTexturesCopy(GrContext* ctx , SkYUVColorSpace colorS
     GrDrawContext* drawContext = ctx->drawContext();
     drawContext->drawRect(dst->asRenderTarget(), GrClip::WideOpen(), paint, SkMatrix::I(), rect);
     ctx->flushSurfaceWrites(dst);
-    return SkNEW_ARGS(SkImage_Gpu, (dstDesc.fWidth, dstDesc.fHeight, kNeedNewImageUniqueID,
-                                    kOpaque_SkAlphaType, dst, 0, budgeted));
+    return new SkImage_Gpu(dstDesc.fWidth, dstDesc.fHeight, kNeedNewImageUniqueID,
+                           kOpaque_SkAlphaType, dst, 0, budgeted);
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
index 51bc6f0..3486114 100644 (file)
@@ -191,7 +191,7 @@ SkImage* SkImage::NewRasterCopy(const SkImageInfo& info, const void* pixels, siz
 
     // Here we actually make a copy of the caller's pixel data
     SkAutoDataUnref data(SkData::NewWithCopy(pixels, size));
-    return SkNEW_ARGS(SkImage_Raster, (info, data, rowBytes, ctable, NULL));
+    return new SkImage_Raster(info, data, rowBytes, ctable, NULL);
 }
 
 
@@ -207,7 +207,7 @@ SkImage* SkImage::NewRasterData(const SkImageInfo& info, SkData* data, size_t ro
     }
 
     SkColorTable* ctable = NULL;
-    return SkNEW_ARGS(SkImage_Raster, (info, data, rowBytes, ctable, NULL));
+    return new SkImage_Raster(info, data, rowBytes, ctable, NULL);
 }
 
 SkImage* SkImage::NewFromRaster(const SkImageInfo& info, const void* pixels, size_t rowBytes,
@@ -219,7 +219,7 @@ SkImage* SkImage::NewFromRaster(const SkImageInfo& info, const void* pixels, siz
 
     SkColorTable* ctable = NULL;
     SkAutoDataUnref data(SkData::NewWithProc(pixels, size, proc, ctx));
-    return SkNEW_ARGS(SkImage_Raster, (info, data, rowBytes, ctable, NULL));
+    return new SkImage_Raster(info, data, rowBytes, ctable, NULL);
 }
 
 SkImage* SkImage::NewFromGenerator(SkImageGenerator* generator, const SkIRect* subset) {
@@ -231,7 +231,7 @@ SkImage* SkImage::NewFromGenerator(SkImageGenerator* generator, const SkIRect* s
         return NULL;
     }
 
-    return SkNEW_ARGS(SkImage_Raster, (bitmap, NULL));
+    return new SkImage_Raster(bitmap, NULL);
 }
 
 SkImage* SkNewImageFromPixelRef(const SkImageInfo& info, SkPixelRef* pr,
@@ -240,7 +240,7 @@ SkImage* SkNewImageFromPixelRef(const SkImageInfo& info, SkPixelRef* pr,
     if (!SkImage_Raster::ValidArgs(info, rowBytes, NULL, NULL)) {
         return NULL;
     }
-    return SkNEW_ARGS(SkImage_Raster, (info, pr, pixelRefOrigin, rowBytes, props));
+    return new SkImage_Raster(info, pr, pixelRefOrigin, rowBytes, props);
 }
 
 SkImage* SkNewImageFromRasterBitmap(const SkBitmap& bm, const SkSurfaceProps* props,
@@ -265,7 +265,7 @@ SkImage* SkNewImageFromRasterBitmap(const SkBitmap& bm, const SkSurfaceProps* pr
             as_IB(image)->initWithProps(*props);
         }
     } else {
-        image = SkNEW_ARGS(SkImage_Raster, (bm, props));
+        image = new SkImage_Raster(bm, props);
     }
     return image;
 }
index f0719d8..34671f7 100644 (file)
@@ -66,7 +66,7 @@ SkCanvas* SkSurface_Gpu::onNewCanvas() {
     // When we think this works...
 //    flags |= SkCanvas::kConservativeRasterClip_InitFlag;
 
-    return SkNEW_ARGS(SkCanvas, (fDevice, flags));
+    return new SkCanvas(fDevice, flags);
 }
 
 SkSurface* SkSurface_Gpu::onNewSurface(const SkImageInfo& info) {
@@ -84,9 +84,8 @@ SkImage* SkSurface_Gpu::onNewImageSnapshot(Budgeted budgeted) {
     SkImage* image = NULL;
     GrTexture* tex = fDevice->accessRenderTarget()->asTexture();
     if (tex) {
-        image = SkNEW_ARGS(SkImage_Gpu,
-                           (info.width(), info.height(), kNeedNewImageUniqueID, info.alphaType(),
-                            tex, sampleCount, budgeted));
+        image = new SkImage_Gpu(info.width(), info.height(), kNeedNewImageUniqueID,
+                                info.alphaType(), tex, sampleCount, budgeted);
     }
     if (image) {
         as_IB(image)->initWithProps(this->props());
@@ -123,7 +122,7 @@ SkSurface* SkSurface::NewRenderTargetDirect(GrRenderTarget* target, const SkSurf
     if (!device) {
         return NULL;
     }
-    return SkNEW_ARGS(SkSurface_Gpu, (device));
+    return new SkSurface_Gpu(device);
 }
 
 SkSurface* SkSurface::NewRenderTarget(GrContext* ctx, Budgeted budgeted, const SkImageInfo& info,
@@ -133,7 +132,7 @@ SkSurface* SkSurface::NewRenderTarget(GrContext* ctx, Budgeted budgeted, const S
     if (!device) {
         return NULL;
     }
-    return SkNEW_ARGS(SkSurface_Gpu, (device));
+    return new SkSurface_Gpu(device);
 }
 
 SkSurface* SkSurface::NewFromBackendTexture(GrContext* context, const GrBackendTextureDesc& desc,
@@ -154,7 +153,7 @@ SkSurface* SkSurface::NewFromBackendTexture(GrContext* context, const GrBackendT
     if (!device) {
         return NULL;
     }
-    return SkNEW_ARGS(SkSurface_Gpu, (device));
+    return new SkSurface_Gpu(device);
 }
 
 SkSurface* SkSurface::NewFromBackendRenderTarget(GrContext* context,
@@ -172,7 +171,7 @@ SkSurface* SkSurface::NewFromBackendRenderTarget(GrContext* context,
     if (!device) {
         return NULL;
     }
-    return SkNEW_ARGS(SkSurface_Gpu, (device));
+    return new SkSurface_Gpu(device);
 }
 
 #endif
index bcf6da7..3c88f7a 100644 (file)
@@ -105,9 +105,7 @@ SkSurface_Raster::SkSurface_Raster(SkPixelRef* pr, const SkSurfaceProps* props)
     }
 }
 
-SkCanvas* SkSurface_Raster::onNewCanvas() {
-    return SkNEW_ARGS(SkCanvas, (fBitmap, this->props()));
-}
+SkCanvas* SkSurface_Raster::onNewCanvas() { return new SkCanvas(fBitmap, this->props()); }
 
 SkSurface* SkSurface_Raster::onNewSurface(const SkImageInfo& info) {
     return SkSurface::NewRaster(info, &this->props());
@@ -174,7 +172,7 @@ SkSurface* SkSurface::NewRasterDirectReleaseProc(const SkImageInfo& info, void*
         return NULL;
     }
 
-    return SkNEW_ARGS(SkSurface_Raster, (info, pixels, rb, releaseProc, context, props));
+    return new SkSurface_Raster(info, pixels, rb, releaseProc, context, props);
 }
 
 SkSurface* SkSurface::NewRasterDirect(const SkImageInfo& info, void* pixels, size_t rowBytes,
@@ -191,5 +189,5 @@ SkSurface* SkSurface::NewRaster(const SkImageInfo& info, const SkSurfaceProps* p
     if (NULL == pr.get()) {
         return NULL;
     }
-    return SkNEW_ARGS(SkSurface_Raster, (pr, props));
+    return new SkSurface_Raster(pr, props);
 }
index b4af220..5d71ab8 100644 (file)
@@ -257,9 +257,8 @@ SkImageGenerator* CreateDecodingImageGenerator(
         return NULL;
     }
 
-    return SkNEW_ARGS(DecodingImageGenerator,
-                      (data, autoStream.detach(), info.makeAlphaType(newAlphaType),
-                       opts.fSampleSize, opts.fDitherImage));
+    return new DecodingImageGenerator(data, autoStream.detach(), info.makeAlphaType(newAlphaType),
+                                      opts.fSampleSize, opts.fDitherImage);
 }
 
 }  // namespace
@@ -273,7 +272,7 @@ SkImageGenerator* SkDecodingImageGenerator::Create(
     if (NULL == data) {
         return NULL;
     }
-    SkStreamRewindable* stream = SkNEW_ARGS(SkMemoryStream, (data));
+    SkStreamRewindable* stream = new SkMemoryStream(data);
     SkASSERT(stream != NULL);
     return CreateDecodingImageGenerator(data, stream, opts);
 }
index 5b3cf32..0be295c 100644 (file)
@@ -160,7 +160,7 @@ bool SkImageDecoder::buildTileIndex(SkStreamRewindable* stream, int *width, int
 
 bool SkImageDecoder::onBuildTileIndex(SkStreamRewindable* stream, int* /*width*/,
                                       int* /*height*/) {
-    SkDELETE(stream);
+    delete stream;
     return false;
 }
 
index b47a6d5..68202a9 100644 (file)
@@ -31,7 +31,7 @@ SkImageDecoder* image_decoder_from_stream(SkStreamRewindable* stream) {
         // if we are given a stream that does not support rewinding.
         if (!rewindSuceeded) {
             SkDEBUGF(("Unable to rewind the image stream."));
-            SkDELETE(codec);
+            delete codec;
             return NULL;
         }
 
index 869acfb..cb29b4d 100644 (file)
@@ -186,7 +186,7 @@ static bool is_astc(SkStreamRewindable* stream) {
 
 static SkImageDecoder* sk_libastc_dfactory(SkStreamRewindable* stream) {
     if (is_astc(stream)) {
-        return SkNEW(SkASTCImageDecoder);
+        return new SkASTCImageDecoder;
     }
     return NULL;
 }
index 837fe58..a7e1a70 100644 (file)
@@ -309,7 +309,7 @@ DEFINE_ENCODER_CREATOR(KTXImageEncoder);
 
 static SkImageDecoder* sk_libktx_dfactory(SkStreamRewindable* stream) {
     if (SkKTXFile::is_ktx(stream)) {
-        return SkNEW(SkKTXImageDecoder);
+        return new SkKTXImageDecoder;
     }
     return NULL;
 }
@@ -322,7 +322,7 @@ static SkImageDecoder::Format get_format_ktx(SkStreamRewindable* stream) {
 }
 
 SkImageEncoder* sk_libktx_efactory(SkImageEncoder::Type t) {
-    return (SkImageEncoder::kKTX_Type == t) ? SkNEW(SkKTXImageEncoder) : NULL;
+    return (SkImageEncoder::kKTX_Type == t) ? new SkKTXImageEncoder : NULL;
 }
 
 static SkImageDecoder_DecodeReg gReg(sk_libktx_dfactory);
index 6647e1b..3884508 100644 (file)
@@ -46,7 +46,7 @@ static bool is_bmp(SkStreamRewindable* stream) {
 
 static SkImageDecoder* sk_libbmp_dfactory(SkStreamRewindable* stream) {
     if (is_bmp(stream)) {
-        return SkNEW(SkBMPImageDecoder);
+        return new SkBMPImageDecoder;
     }
     return NULL;
 }
index 5d55a13..65172ac 100644 (file)
@@ -365,7 +365,7 @@ SkImageDecoder::Result SkGIFImageDecoder::onDecode(SkStream* sk_stream, SkBitmap
                     fillIndex = 0;  // If not, fix it.
                 }
 
-                SkAutoTUnref<SkColorTable> ctable(SkNEW_ARGS(SkColorTable, (colorPtr, colorCount)));
+                SkAutoTUnref<SkColorTable> ctable(new SkColorTable(colorPtr, colorCount));
                 if (!this->allocPixelRef(bm, ctable)) {
                     return error_return(*bm, "allocPixelRef");
                 }
@@ -524,7 +524,7 @@ static bool is_gif(SkStreamRewindable* stream) {
 
 static SkImageDecoder* sk_libgif_dfactory(SkStreamRewindable* stream) {
     if (is_gif(stream)) {
-        return SkNEW(SkGIFImageDecoder);
+        return new SkGIFImageDecoder;
     }
     return NULL;
 }
index b9b3fba..78f41d9 100644 (file)
@@ -435,7 +435,7 @@ static bool is_ico(SkStreamRewindable* stream) {
 
 static SkImageDecoder* sk_libico_dfactory(SkStreamRewindable* stream) {
     if (is_ico(stream)) {
-        return SkNEW(SkICOImageDecoder);
+        return new SkICOImageDecoder;
     }
     return NULL;
 }
index 8e92dd8..d403b74 100644 (file)
@@ -210,9 +210,7 @@ public:
         fImageHeight = 0;
     }
 
-    virtual ~SkJPEGImageDecoder() {
-        SkDELETE(fImageIndex);
-    }
+    virtual ~SkJPEGImageDecoder() { delete fImageIndex; }
 #endif
 
     Format getFormat() const override {
@@ -943,8 +941,7 @@ bool SkJPEGImageDecoder::onDecodeYUV8Planes(SkStream* stream, SkISize componentS
 
 #ifdef SK_BUILD_FOR_ANDROID
 bool SkJPEGImageDecoder::onBuildTileIndex(SkStreamRewindable* stream, int *width, int *height) {
-
-    SkAutoTDelete<SkJPEGImageIndex> imageIndex(SkNEW_ARGS(SkJPEGImageIndex, (stream, this)));
+    SkAutoTDelete<SkJPEGImageIndex> imageIndex(new SkJPEGImageIndex(stream, this));
 
     skjpeg_error_mgr sk_err;
     set_error_mgr(imageIndex->cinfo(), &sk_err);
@@ -1000,7 +997,7 @@ bool SkJPEGImageDecoder::onBuildTileIndex(SkStreamRewindable* stream, int *width
         *height = fImageHeight;
     }
 
-    SkDELETE(fImageIndex);
+    delete fImageIndex;
     fImageIndex = imageIndex.detach();
 
     return true;
@@ -1437,7 +1434,7 @@ static bool is_jpeg(SkStreamRewindable* stream) {
 
 static SkImageDecoder* sk_libjpeg_dfactory(SkStreamRewindable* stream) {
     if (is_jpeg(stream)) {
-        return SkNEW(SkJPEGImageDecoder);
+        return new SkJPEGImageDecoder;
     }
     return NULL;
 }
@@ -1450,7 +1447,7 @@ static SkImageDecoder::Format get_format_jpeg(SkStreamRewindable* stream) {
 }
 
 static SkImageEncoder* sk_libjpeg_efactory(SkImageEncoder::Type t) {
-    return (SkImageEncoder::kJPEG_Type == t) ? SkNEW(SkJPEGImageEncoder) : NULL;
+    return (SkImageEncoder::kJPEG_Type == t) ? new SkJPEGImageEncoder : NULL;
 }
 
 static SkImageDecoder_DecodeReg gDReg(sk_libjpeg_dfactory);
index 44aa8e2..bccdfc8 100644 (file)
@@ -85,9 +85,7 @@ public:
         return kPNG_Format;
     }
 
-    virtual ~SkPNGImageDecoder() {
-        SkDELETE(fImageIndex);
-    }
+    virtual ~SkPNGImageDecoder() { delete fImageIndex; }
 
 protected:
 #ifdef SK_BUILD_FOR_ANDROID
@@ -723,7 +721,7 @@ bool SkPNGImageDecoder::decodePalette(png_structp png_ptr, png_infop info_ptr,
         *colorPtr++ = lastColor;
     }
 
-    *colorTablep = SkNEW_ARGS(SkColorTable, (colorStorage, colorCount));
+    *colorTablep = new SkColorTable(colorStorage, colorCount);
     *reallyHasAlphap = reallyHasAlpha;
     return true;
 }
@@ -755,9 +753,9 @@ bool SkPNGImageDecoder::onBuildTileIndex(SkStreamRewindable* sk_stream, int *wid
     png_build_index(png_ptr);
 
     if (fImageIndex) {
-        SkDELETE(fImageIndex);
+        delete fImageIndex;
     }
-    fImageIndex = SkNEW_ARGS(SkPNGImageIndex, (streamDeleter.detach(), png_ptr, info_ptr));
+    fImageIndex = new SkPNGImageIndex(streamDeleter.detach(), png_ptr, info_ptr);
 
     return true;
 }
@@ -1271,7 +1269,7 @@ static bool is_png(SkStreamRewindable* stream) {
 
 SkImageDecoder* sk_libpng_dfactory(SkStreamRewindable* stream) {
     if (is_png(stream)) {
-        return SkNEW(SkPNGImageDecoder);
+        return new SkPNGImageDecoder;
     }
     return NULL;
 }
@@ -1284,7 +1282,7 @@ static SkImageDecoder::Format get_format_png(SkStreamRewindable* stream) {
 }
 
 SkImageEncoder* sk_libpng_efactory(SkImageEncoder::Type t) {
-    return (SkImageEncoder::kPNG_Type == t) ? SkNEW(SkPNGImageEncoder) : NULL;
+    return (SkImageEncoder::kPNG_Type == t) ? new SkPNGImageEncoder : NULL;
 }
 
 static SkImageDecoder_DecodeReg gDReg(sk_libpng_dfactory);
index a7c9610..e0c1d64 100644 (file)
@@ -657,7 +657,7 @@ static SkImageDecoder* sk_libwebp_dfactory(SkStreamRewindable* stream) {
     }
 
     // Magic matches, call decoder
-    return SkNEW(SkWEBPImageDecoder);
+    return new SkWEBPImageDecoder;
 }
 
 static SkImageDecoder::Format get_format_webp(SkStreamRewindable* stream) {
@@ -669,7 +669,7 @@ static SkImageDecoder::Format get_format_webp(SkStreamRewindable* stream) {
 }
 
 static SkImageEncoder* sk_libwebp_efactory(SkImageEncoder::Type t) {
-      return (SkImageEncoder::kWEBP_Type == t) ? SkNEW(SkWEBPImageEncoder) : NULL;
+    return (SkImageEncoder::kWEBP_Type == t) ? new SkWEBPImageEncoder : NULL;
 }
 
 static SkImageDecoder_DecodeReg gDReg(sk_libwebp_dfactory);
index 9e1a2aa..f407308 100644 (file)
@@ -111,7 +111,7 @@ static bool is_pkm(SkStreamRewindable* stream) {
 
 static SkImageDecoder* sk_libpkm_dfactory(SkStreamRewindable* stream) {
     if (is_pkm(stream)) {
-        return SkNEW(SkPKMImageDecoder);
+        return new SkPKMImageDecoder;
     }
     return NULL;
 }
index b7a6790..82127c3 100644 (file)
@@ -119,7 +119,7 @@ SkImageDecoder::Result SkWBMPImageDecoder::onDecode(SkStream* stream, SkBitmap*
     }
 
     const SkPMColor colors[] = { SK_ColorBLACK, SK_ColorWHITE };
-    SkColorTable* ct = SkNEW_ARGS(SkColorTable, (colors, 2));
+    SkColorTable* ct = new SkColorTable(colors, 2);
     SkAutoUnref   aur(ct);
 
     if (!this->allocPixelRef(decodedBitmap, ct)) {
@@ -156,7 +156,7 @@ static SkImageDecoder* sk_wbmp_dfactory(SkStreamRewindable* stream) {
     wbmp_head   head;
 
     if (head.init(stream)) {
-        return SkNEW(SkWBMPImageDecoder);
+        return new SkWBMPImageDecoder;
     }
     return NULL;
 }
index 380aca4..c40f552 100644 (file)
@@ -443,7 +443,7 @@ SkMovie* Factory(SkStreamRewindable* stream) {
                 memcmp(GIF89_STAMP, buf, GIF_STAMP_LEN) == 0) {
             // must rewind here, since our construct wants to re-read the data
             stream->rewind();
-            return SkNEW_ARGS(SkGIFMovie, (stream));
+            return new SkGIFMovie(stream);
         }
     }
     return NULL;
index 3edd0de..f65e545 100644 (file)
@@ -17,11 +17,10 @@ bool SkCachingPixelRef::Install(SkImageGenerator* generator,
     }
     const SkImageInfo info = generator->getInfo();
     if (!dst->setInfo(info)) {
-        SkDELETE(generator);
+        delete generator;
         return false;
     }
-    SkAutoTUnref<SkCachingPixelRef> ref(SkNEW_ARGS(SkCachingPixelRef,
-                                           (info, generator, dst->rowBytes())));
+    SkAutoTUnref<SkCachingPixelRef> ref(new SkCachingPixelRef(info, generator, dst->rowBytes()));
     dst->setPixelRef(ref);
     return true;
 }
@@ -36,7 +35,7 @@ SkCachingPixelRef::SkCachingPixelRef(const SkImageInfo& info,
     SkASSERT(fImageGenerator != NULL);
 }
 SkCachingPixelRef::~SkCachingPixelRef() {
-    SkDELETE(fImageGenerator);
+    delete fImageGenerator;
     // Assert always unlock before unref.
 }
 
index 818db22..1057441 100644 (file)
@@ -35,8 +35,8 @@ public:
      *
      *  If Install fails or when the SkCachingPixelRef that is
      *  installed into destination is destroyed, it will call
-     *  SkDELETE() on the generator.  Therefore, generator should be
-     *  allocated with SkNEW() or SkNEW_ARGS().
+     *  `delete` on the generator.  Therefore, generator should be
+     *  allocated with `new`.
      */
     static bool Install(SkImageGenerator* gen, SkBitmap* dst);
 
index 70072c6..898d766 100644 (file)
@@ -178,8 +178,7 @@ SkDiscardableMemory* DiscardableMemoryPool::create(size_t bytes) {
     if (NULL == addr) {
         return NULL;
     }
-    PoolDiscardableMemory* dm = SkNEW_ARGS(PoolDiscardableMemory,
-                                             (this, addr, bytes));
+    PoolDiscardableMemory* dm = new PoolDiscardableMemory(this, addr, bytes);
     SkAutoMutexAcquire autoMutexAcquire(fMutex);
     fList.addToHead(dm);
     fUsed += bytes;
@@ -257,7 +256,7 @@ SkDiscardableMemoryPool* create_global_pool() {
 }  // namespace
 
 SkDiscardableMemoryPool* SkDiscardableMemoryPool::Create(size_t size, SkBaseMutex* mutex) {
-    return SkNEW_ARGS(DiscardableMemoryPool, (size, mutex));
+    return new DiscardableMemoryPool(size, mutex);
 }
 
 SK_DECLARE_STATIC_LAZY_PTR(SkDiscardableMemoryPool, global, create_global_pool);
index 4f9178e..01bfd83 100644 (file)
@@ -33,9 +33,9 @@ SkDiscardablePixelRef::~SkDiscardablePixelRef() {
         fDiscardableMemory->unlock();
         fDiscardableMemoryIsLocked = false;
     }
-    SkDELETE(fDiscardableMemory);
+    delete fDiscardableMemory;
     SkSafeUnref(fDMFactory);
-    SkDELETE(fGenerator);
+    delete fGenerator;
 }
 
 bool SkDiscardablePixelRef::onNewLockPixels(LockRec* rec) {
@@ -47,7 +47,7 @@ bool SkDiscardablePixelRef::onNewLockPixels(LockRec* rec) {
             rec->fRowBytes = fRowBytes;
             return true;
         }
-        SkDELETE(fDiscardableMemory);
+        delete fDiscardableMemory;
         fDiscardableMemory = NULL;
         fDiscardableMemoryIsLocked = false;
     }
@@ -74,7 +74,7 @@ bool SkDiscardablePixelRef::onNewLockPixels(LockRec* rec) {
     if (!fGenerator->getPixels(info, pixels, fRowBytes, colors, &colorCount)) {
         fDiscardableMemory->unlock();
         fDiscardableMemoryIsLocked = false;
-        SkDELETE(fDiscardableMemory);
+        delete fDiscardableMemory;
         fDiscardableMemory = NULL;
         return false;
     }
@@ -85,7 +85,7 @@ bool SkDiscardablePixelRef::onNewLockPixels(LockRec* rec) {
     // could move it into the block, but then again perhaps it is small enough that this doesn't
     // really matter.
     if (colorCount > 0) {
-        fCTable.reset(SkNEW_ARGS(SkColorTable, (colors, colorCount)));
+        fCTable.reset(new SkColorTable(colors, colorCount));
     } else {
         fCTable.reset(NULL);
     }
@@ -137,8 +137,7 @@ bool SkInstallDiscardablePixelRef(SkImageGenerator* generator, const SkIRect* su
         return dst->tryAllocPixels();
     }
     SkAutoTUnref<SkDiscardablePixelRef> ref(
-        SkNEW_ARGS(SkDiscardablePixelRef,
-                   (prInfo, autoGenerator.detach(), dst->rowBytes(), factory)));
+            new SkDiscardablePixelRef(prInfo, autoGenerator.detach(), dst->rowBytes(), factory));
     dst->setPixelRef(ref, origin.x(), origin.y());
     return true;
 }
index b4fc8e1..673387b 100644 (file)
@@ -280,8 +280,9 @@ namespace SK_OPTS_NS {
 
 static SkXfermode* create_xfermode(const ProcCoeff& rec, SkXfermode::Mode mode) {
     switch (mode) {
-    #define CASE(Mode) case SkXfermode::k##Mode##_Mode: \
-        return SkNEW_ARGS(Sk4pxXfermode, (rec, mode, &Mode, &xfer_aa<Mode>))
+#define CASE(Mode)                   \
+    case SkXfermode::k##Mode##_Mode: \
+        return new Sk4pxXfermode(rec, mode, &Mode, &xfer_aa<Mode>)
         CASE(Clear);
         CASE(Src);
         CASE(Dst);
@@ -306,8 +307,9 @@ static SkXfermode* create_xfermode(const ProcCoeff& rec, SkXfermode::Mode mode)
         CASE(Lighten);
     #undef CASE
 
-    #define CASE(Mode) case SkXfermode::k##Mode##_Mode: \
-        return SkNEW_ARGS(SkPMFloatXfermode, (rec, mode, &Mode))
+#define CASE(Mode)                   \
+    case SkXfermode::k##Mode##_Mode: \
+        return new SkPMFloatXfermode(rec, mode, &Mode)
         CASE(ColorDodge);
         CASE(ColorBurn);
         CASE(SoftLight);
index 34045d4..2e140e8 100644 (file)
@@ -76,7 +76,7 @@ int* get_SIMD_level() {
     int cpu_info[4] = { 0, 0, 0, 0 };
     getcpuid(1, cpu_info);
 
-    int* level = SkNEW(int);
+    int* level = new int;
 
     if ((cpu_info[2] & (1<<20)) != 0) {
         *level = SK_CPU_SSE_LEVEL_SSE42;
index 61f5096..813f237 100644 (file)
@@ -75,13 +75,9 @@ void SkPathOpsDebug::WindingPrintf(int wind) {
 
 
 #if DEBUG_SHOW_TEST_NAME
-void* SkPathOpsDebug::CreateNameStr() {
-    return SkNEW_ARRAY(char, DEBUG_FILENAME_STRING_LENGTH);
-}
+void* SkPathOpsDebug::CreateNameStr() { return new char[DEBUG_FILENAME_STRING_LENGTH]; }
 
-void SkPathOpsDebug::DeleteNameStr(void* v) {
-    SkDELETE_ARRAY(reinterpret_cast<char* >(v));
-}
+void SkPathOpsDebug::DeleteNameStr(void* v) { delete[] reinterpret_cast<char*>(v); }
 
 void SkPathOpsDebug::BumpTestName(char* test) {
     char* num = test + strlen(test);
index 50e1279..6ea01be 100644 (file)
@@ -349,8 +349,8 @@ void SkTCoincident<TCurve, OppCurve>::setPerp(const TCurve& c1, double t,
 
 template<typename TCurve, typename OppCurve>
 void SkTSpan<TCurve, OppCurve>::addBounded(SkTSpan<OppCurve, TCurve>* span, SkChunkAlloc* heap) {
-    SkTSpanBounded<OppCurve, TCurve>* bounded = SkNEW_PLACEMENT(heap->allocThrow(
-            sizeof(SkTSpanBounded<OppCurve, TCurve>)), (SkTSpanBounded<OppCurve, TCurve>));
+    SkTSpanBounded<OppCurve, TCurve>* bounded = new (heap->allocThrow(
+            sizeof(SkTSpanBounded<OppCurve, TCurve>)))(SkTSpanBounded<OppCurve, TCurve>);
     bounded->fBounded = span;
     bounded->fNext = fBounded;
     fBounded = bounded;
@@ -829,8 +829,8 @@ SkTSpan<TCurve, OppCurve>* SkTSect<TCurve, OppCurve>::addOne() {
         result->reset();
         fDeleted = result->fNext;
     } else {
-        result = SkNEW_PLACEMENT(fHeap.allocThrow(sizeof(SkTSpan<TCurve, OppCurve>)),
-                (SkTSpan<TCurve, OppCurve>));
+        result = new (fHeap.allocThrow(sizeof(SkTSpan<TCurve, OppCurve>)))(
+                SkTSpan<TCurve, OppCurve>);
         result->fBounded = NULL;
 #if DEBUG_T_SECT
         ++fDebugAllocatedCount;
index 2ca516c..bef8d97 100644 (file)
@@ -65,8 +65,7 @@ struct SkDeflateWStream::Impl {
     z_stream fZStream;
 };
 
-SkDeflateWStream::SkDeflateWStream(SkWStream* out)
-    : fImpl(SkNEW(SkDeflateWStream::Impl)) {
+SkDeflateWStream::SkDeflateWStream(SkWStream* out) : fImpl(new SkDeflateWStream::Impl) {
     fImpl->fOut = out;
     fImpl->fInBufferIndex = 0;
     if (!fImpl->fOut) {
index ba26cd8..3505233 100644 (file)
@@ -314,7 +314,7 @@ void PDFDefaultBitmap::addResources(
 }
 
 static SkPDFArray* make_indexed_color_space(const SkColorTable* table) {
-    SkPDFArray* result = SkNEW(SkPDFArray);
+    SkPDFArray* result = new SkPDFArray;
     result->reserve(4);
     result->appendName("Indexed");
     result->appendName("DeviceRGB");
@@ -457,7 +457,7 @@ SkPDFBitmap* SkPDFBitmap::Create(SkPDFCanon* canon, const SkBitmap& bitmap) {
         SkJFIFInfo info;
         if (data && SkIsJFIF(data, &info)) {
             bool yuv = info.fType == SkJFIFInfo::kYCbCr;
-            SkPDFBitmap* pdfBitmap = SkNEW_ARGS(PDFJpegBitmap, (bm, data, yuv));
+            SkPDFBitmap* pdfBitmap = new PDFJpegBitmap(bm, data, yuv);
             canon->addBitmap(pdfBitmap);
             return pdfBitmap;
         }
@@ -465,9 +465,9 @@ SkPDFBitmap* SkPDFBitmap::Create(SkPDFCanon* canon, const SkBitmap& bitmap) {
 
     SkPDFObject* smask = NULL;
     if (!bm.isOpaque() && !SkBitmap::ComputeIsOpaque(bm)) {
-        smask = SkNEW_ARGS(PDFAlphaBitmap, (bm));
+        smask = new PDFAlphaBitmap(bm);
     }
-    SkPDFBitmap* pdfBitmap = SkNEW_ARGS(PDFDefaultBitmap, (bm, smask));
+    SkPDFBitmap* pdfBitmap = new PDFDefaultBitmap(bm, smask);
     canon->addBitmap(pdfBitmap);
     return pdfBitmap;
 }
index 179e02b..678e6c0 100644 (file)
@@ -697,10 +697,7 @@ private:
 
 ////////////////////////////////////////////////////////////////////////////////
 
-SkPDFDevice::SkPDFDevice(SkISize pageSize,
-                         SkScalar rasterDpi,
-                         SkPDFCanon* canon,
-                         bool flip)
+SkPDFDevice::SkPDFDevice(SkISize pageSize, SkScalar rasterDpi, SkPDFCanon* canon, bool flip)
     : INHERITED(SkSurfaceProps(0, kUnknown_SkPixelGeometry))
     , fPageSize(pageSize)
     , fContentSize(pageSize)
@@ -710,7 +707,7 @@ SkPDFDevice::SkPDFDevice(SkISize pageSize,
     , fLastMarginContentEntry(NULL)
     , fDrawingArea(kContent_DrawingArea)
     , fClipStack(NULL)
-    , fFontGlyphUsage(SkNEW(SkPDFGlyphSetMap))
+    , fFontGlyphUsage(new SkPDFGlyphSetMap)
     , fRasterDpi(rasterDpi)
     , fCanon(canon) {
     SkASSERT(pageSize.width() > 0);
@@ -741,7 +738,7 @@ void SkPDFDevice::init() {
     fLastMarginContentEntry = NULL;
     fDrawingArea = kContent_DrawingArea;
     if (fFontGlyphUsage.get() == NULL) {
-        fFontGlyphUsage.reset(SkNEW(SkPDFGlyphSetMap));
+        fFontGlyphUsage.reset(new SkPDFGlyphSetMap);
     }
 }
 
@@ -896,17 +893,17 @@ static SkPath transform_and_clip_path(const SkDraw& d,
 }
 
 static SkPDFDict* create_link_annotation(const SkRect& translatedRect) {
-    SkAutoTUnref<SkPDFDict> annotation(SkNEW_ARGS(SkPDFDict, ("Annot")));
+    SkAutoTUnref<SkPDFDict> annotation(new SkPDFDict("Annot"));
     annotation->insertName("Subtype", "Link");
 
-    SkAutoTUnref<SkPDFArray> border(SkNEW(SkPDFArray));
+    SkAutoTUnref<SkPDFArray> border(new SkPDFArray);
     border->reserve(3);
     border->appendInt(0);  // Horizontal corner radius.
     border->appendInt(0);  // Vertical corner radius.
     border->appendInt(0);  // Width, 0 = no border.
     annotation->insertObject("Border", border.detach());
 
-    SkAutoTUnref<SkPDFArray> rect(SkNEW(SkPDFArray));
+    SkAutoTUnref<SkPDFArray> rect(new SkPDFArray);
     rect->reserve(4);
     rect->appendScalar(translatedRect.fLeft);
     rect->appendScalar(translatedRect.fTop);
@@ -922,7 +919,7 @@ static SkPDFDict* create_link_to_url(SkData* urlData, const SkRect& r) {
 
     SkString url(static_cast<const char *>(urlData->data()),
                  urlData->size() - 1);
-    SkAutoTUnref<SkPDFDict> action(SkNEW_ARGS(SkPDFDict, ("Action")));
+    SkAutoTUnref<SkPDFDict> action(new SkPDFDict("Action"));
     action->insertName("S", "URI");
     action->insertString("URI", url);
     annotation->insertObject("A", action.detach());
@@ -1434,7 +1431,7 @@ const SkTDArray<SkPDFFont*>& SkPDFDevice::getFontResources() const {
 SkPDFArray* SkPDFDevice::copyMediaBox() const {
     // should this be a singleton?
 
-    SkAutoTUnref<SkPDFArray> mediaBox(SkNEW(SkPDFArray));
+    SkAutoTUnref<SkPDFArray> mediaBox(new SkPDFArray);
     mediaBox->reserve(4);
     mediaBox->appendInt(0);
     mediaBox->appendInt(0);
@@ -1579,9 +1576,7 @@ bool SkPDFDevice::handlePointAnnotation(const SkPoint* points, size_t count,
         for (size_t i = 0; i < count; i++) {
             SkPoint translatedPoint;
             transform.mapXY(points[i].x(), points[i].y(), &translatedPoint);
-            fNamedDestinations.push(
-                    SkNEW_ARGS(NamedDestination, (nameData, translatedPoint)));
-
+            fNamedDestinations.push(new NamedDestination(nameData, translatedPoint));
         }
         return true;
     }
@@ -1590,7 +1585,7 @@ bool SkPDFDevice::handlePointAnnotation(const SkPoint* points, size_t count,
 
 void SkPDFDevice::addAnnotation(SkPDFDict* annotation) {
     if (NULL == fAnnotations) {
-        fAnnotations = SkNEW(SkPDFArray);
+        fAnnotations = new SkPDFArray;
     }
     fAnnotations->appendObject(annotation);
 }
@@ -1600,7 +1595,7 @@ void SkPDFDevice::appendDestinations(SkPDFDict* dict, SkPDFObject* page) const {
     int nDest = fNamedDestinations.count();
     for (int i = 0; i < nDest; i++) {
         NamedDestination* dest = fNamedDestinations[i];
-        SkAutoTUnref<SkPDFArray> pdfDest(SkNEW(SkPDFArray));
+        SkAutoTUnref<SkPDFArray> pdfDest(new SkPDFArray);
         pdfDest->reserve(5);
         pdfDest->appendObjRef(SkRef(page));
         pdfDest->appendName("XYZ");
@@ -1613,7 +1608,7 @@ void SkPDFDevice::appendDestinations(SkPDFDict* dict, SkPDFObject* page) const {
 }
 
 SkPDFFormXObject* SkPDFDevice::createFormXObjectFromDevice() {
-    SkPDFFormXObject* xobject = SkNEW_ARGS(SkPDFFormXObject, (this));
+    SkPDFFormXObject* xobject = new SkPDFFormXObject(this);
     // We always draw the form xobjects that we create back into the device, so
     // we simply preserve the font usage instead of pulling it out and merging
     // it back in later.
index bed2947..06d3e10 100644 (file)
@@ -65,14 +65,14 @@ public:
     static SkPDFDevice* Create(SkISize pageSize,
                                SkScalar rasterDpi,
                                SkPDFCanon* canon) {
-        return SkNEW_ARGS(SkPDFDevice, (pageSize, rasterDpi, canon, true));
+        return new SkPDFDevice(pageSize, rasterDpi, canon, true);
     }
 
     /** Create a PDF drawing context without fipping the y-axis. */
     static SkPDFDevice* CreateUnflipped(SkISize pageSize,
                                         SkScalar rasterDpi,
                                         SkPDFCanon* canon) {
-        return SkNEW_ARGS(SkPDFDevice, (pageSize, rasterDpi, canon, false));
+        return new SkPDFDevice(pageSize, rasterDpi, canon, false);
     }
 
     virtual ~SkPDFDevice();
index c4b6c20..bff32ae 100644 (file)
@@ -140,8 +140,7 @@ SkPDFObject* create_invert_function() {
     SkAutoTUnref<SkData> psInvertStream(
             SkData::NewWithoutCopy(psInvert, strlen(psInvert)));
 
-    SkPDFStream* invertFunction = SkNEW_ARGS(
-            SkPDFStream, (psInvertStream.get()));
+    SkPDFStream* invertFunction = new SkPDFStream(psInvertStream.get());
     invertFunction->insertInt("FunctionType", 4);
     invertFunction->insertObject("Domain", SkRef(domainAndRange.get()));
     invertFunction->insertObject("Range", domainAndRange.detach());
@@ -199,7 +198,7 @@ void SkPDFGraphicState::emitObject(
         SkWStream* stream,
         const SkPDFObjNumMap& objNumMap,
         const SkPDFSubstituteMap& substitutes) const {
-    SkAutoTUnref<SkPDFDict> dict(SkNEW_ARGS(SkPDFDict, ("ExtGState")));
+    SkAutoTUnref<SkPDFDict> dict(new SkPDFDict("ExtGState"));
     dict->insertName("Type", "ExtGState");
 
     SkScalar alpha = SkIntToScalar(fAlpha) / 0xFF;
index dbe733e..2f9abca 100644 (file)
@@ -61,7 +61,7 @@ static void add_subdict(
     if (0 == resourceList.count()) {
         return;
     }
-    SkAutoTUnref<SkPDFDict> resources(SkNEW(SkPDFDict));
+    SkAutoTUnref<SkPDFDict> resources(new SkPDFDict);
     for (int i = 0; i < resourceList.count(); i++) {
         resources->insertObjRef(SkPDFResourceDict::getResourceName(type, i),
                                 SkRef(resourceList[i]));
@@ -74,10 +74,10 @@ SkPDFDict* SkPDFResourceDict::Create(
         const SkTDArray<SkPDFObject*>* patternResources,
         const SkTDArray<SkPDFObject*>* xObjectResources,
         const SkTDArray<SkPDFObject*>* fontResources) {
-    SkAutoTUnref<SkPDFDict> dict(SkNEW(SkPDFDict));
+    SkAutoTUnref<SkPDFDict> dict(new SkPDFDict);
     static const char kProcs[][7] = {
         "PDF", "Text", "ImageB", "ImageC", "ImageI"};
-    SkAutoTUnref<SkPDFArray> procSets(SkNEW(SkPDFArray));
+    SkAutoTUnref<SkPDFArray> procSets(new SkPDFArray);
 
     procSets->reserve(SK_ARRAY_COUNT(kProcs));
     for (size_t i = 0; i < SK_ARRAY_COUNT(kProcs); i++) {
index e518bcf..6b4e758 100644 (file)
@@ -518,8 +518,7 @@ SkPDFObject* SkPDFShader::GetPDFShader(SkPDFCanon* canon,
                                        const SkMatrix& matrix,
                                        const SkIRect& surfaceBBox,
                                        SkScalar rasterScale) {
-    SkAutoTDelete<SkPDFShader::State> state(
-            SkNEW_ARGS(State, (shader, matrix, surfaceBBox, rasterScale)));
+    SkAutoTDelete<SkPDFShader::State> state(new State(shader, matrix, surfaceBBox, rasterScale));
     return get_pdf_shader_by_state(canon, dpi, &state);
 }
 
@@ -625,7 +624,7 @@ SkPDFAlphaFunctionShader* SkPDFAlphaFunctionShader::Create(
             create_smask_graphic_state(canon, dpi, state));
 
     SkPDFAlphaFunctionShader* alphaFunctionShader =
-            SkNEW_ARGS(SkPDFAlphaFunctionShader, (autoState->detach()));
+            new SkPDFAlphaFunctionShader(autoState->detach());
 
     SkAutoTUnref<SkPDFDict> resourceDict(
             get_gradient_resource_dict(colorShader.get(), alphaGs.get()));
@@ -680,7 +679,7 @@ static bool split_perspective(const SkMatrix in, SkMatrix* affine,
 
 namespace {
 SkPDFObject* create_range_object() {
-    SkPDFArray* range = SkNEW(SkPDFArray);
+    SkPDFArray* range = new SkPDFArray;
     range->reserve(6);
     range->appendInt(0);
     range->appendInt(1);
@@ -701,7 +700,7 @@ static SkPDFStream* make_ps_function(const SkString& psCode,
                                      SkPDFArray* domain) {
     SkAutoDataUnref funcData(
             SkData::NewWithCopy(psCode.c_str(), psCode.size()));
-    SkPDFStream* result = SkNEW_ARGS(SkPDFStream, (funcData.get()));
+    SkPDFStream* result = new SkPDFStream(funcData.get());
     result->insertInt("FunctionType", 4);
     result->insertObject("Domain", SkRef(domain));
     result->insertObject("Range", SkRef(rangeObject.get()));
@@ -814,8 +813,7 @@ SkPDFFunctionShader* SkPDFFunctionShader::Create(
             make_ps_function(functionCode, domain.get()));
     pdfShader->insertObjRef("Function", function.detach());
 
-    SkPDFFunctionShader* pdfFunctionShader =
-            SkNEW_ARGS(SkPDFFunctionShader, (autoState->detach()));
+    SkPDFFunctionShader* pdfFunctionShader = new SkPDFFunctionShader(autoState->detach());
 
     pdfFunctionShader->insertInt("PatternType", 2);
     pdfFunctionShader->insertObject("Matrix",
@@ -1028,8 +1026,7 @@ SkPDFImageShader* SkPDFImageShader::Create(
     // Put the canvas into the pattern stream (fContent).
     SkAutoTDelete<SkStreamAsset> content(patternDevice->content());
 
-    SkPDFImageShader* imageShader =
-            SkNEW_ARGS(SkPDFImageShader, (autoState->detach()));
+    SkPDFImageShader* imageShader = new SkPDFImageShader(autoState->detach());
     imageShader->setData(content.get());
 
     SkAutoTUnref<SkPDFDict> resourceDict(
index 9bb9dee..43361fc 100644 (file)
@@ -38,7 +38,7 @@ SkPDFUnion::~SkPDFUnion() {
 SkPDFUnion& SkPDFUnion::operator=(SkPDFUnion&& other) {
     if (this != &other) {
         this->~SkPDFUnion();
-        SkNEW_PLACEMENT_ARGS(this, SkPDFUnion, (other.move()));
+        new (this) SkPDFUnion(other.move());
     }
     return *this;
 }
@@ -56,8 +56,7 @@ SkPDFUnion SkPDFUnion::copy() const {
     switch (fType) {
         case Type::kNameSkS:
         case Type::kStringSkS:
-            SkNEW_PLACEMENT_ARGS(pun(u.fSkString), SkString,
-                                 (*pun(fSkString)));
+            new (pun(u.fSkString))  SkString                                   (*pun(fSkString));
             return u.move();
         case Type::kObjRef:
         case Type::kObject:
@@ -226,13 +225,13 @@ SkPDFUnion SkPDFUnion::String(const char* value) {
 
 SkPDFUnion SkPDFUnion::Name(const SkString& s) {
     SkPDFUnion u(Type::kNameSkS);
-    SkNEW_PLACEMENT_ARGS(pun(u.fSkString), SkString, (s));
+    new (pun(u.fSkString)) SkString(s);
     return u.move();
 }
 
 SkPDFUnion SkPDFUnion::String(const SkString& s) {
     SkPDFUnion u(Type::kStringSkS);
-    SkNEW_PLACEMENT_ARGS(pun(u.fSkString), SkString, (s));
+    new (pun(u.fSkString)) SkString(s);
     return u.move();
 }
 
@@ -298,9 +297,7 @@ void SkPDFArray::addResources(SkPDFObjNumMap* catalog,
     }
 }
 
-void SkPDFArray::append(SkPDFUnion&& value) {
-    SkNEW_PLACEMENT_ARGS(fValues.append(), SkPDFUnion, (value.move()));
-}
+void SkPDFArray::append(SkPDFUnion&& value) { new (fValues.append()) SkPDFUnion(value.move()); }
 
 void SkPDFArray::appendInt(int32_t value) {
     this->append(SkPDFUnion::Int(value));
@@ -378,8 +375,8 @@ void SkPDFDict::addResources(SkPDFObjNumMap* catalog,
 void SkPDFDict::set(SkPDFUnion&& name, SkPDFUnion&& value) {
     Record* rec = fRecords.append();
     SkASSERT(name.isName());
-    SkNEW_PLACEMENT_ARGS(&rec->fKey, SkPDFUnion, (name.move()));
-    SkNEW_PLACEMENT_ARGS(&rec->fValue, SkPDFUnion, (value.move()));
+    new (&rec->fKey) SkPDFUnion(name.move());
+    new (&rec->fValue) SkPDFUnion(value.move());
 }
 
 int SkPDFDict::size() const { return fRecords.count(); }
index 85aa013..60d5114 100644 (file)
@@ -313,10 +313,7 @@ private:
 class SkPDFSharedStream : public SkPDFObject {
 public:
     // Takes ownership of asset.
-    SkPDFSharedStream(SkStreamAsset* data)
-        : fAsset(data), fDict(SkNEW(SkPDFDict)) {
-        SkASSERT(data);
-    }
+    SkPDFSharedStream(SkStreamAsset* data) : fAsset(data), fDict(new SkPDFDict) { SkASSERT(data); }
     SkPDFDict* dict() { return fDict; }
     void emitObject(SkWStream*,
                     const SkPDFObjNumMap&,
index c86e6fb..07c62f5 100644 (file)
@@ -179,7 +179,7 @@ public:
 
     ~BitmapInfo() {
         SkASSERT(0 == fToBeDrawnCount);
-        SkDELETE(fBitmap);
+        delete fBitmap;
     }
 
     void addDraws(int drawsToAdd) {
index 29d798b..97cae90 100644 (file)
@@ -150,7 +150,7 @@ public:
         SkASSERT(shouldFlattenBitmaps(fFlags));
         SkBitmap* bm;
         if(fBitmaps.count() == index) {
-            bm = SkNEW(SkBitmap);
+            bm = new SkBitmap;
             *fBitmaps.append() = bm;
         } else {
             bm = fBitmaps[index];
index aa04cb8..b74b36d 100644 (file)
@@ -437,15 +437,16 @@ int SkGPipeCanvas::flattenToIndex(SkFlattenable* obj, PaintFlats paintflat) {
 #define FLATTENABLES_TO_KEEP 10
 
 SkGPipeCanvas::SkGPipeCanvas(SkGPipeController* controller,
-                             SkWriter32* writer, uint32_t flags,
-                             uint32_t width, uint32_t height)
+                             SkWriter32* writer,
+                             uint32_t flags,
+                             uint32_t width,
+                             uint32_t height)
     : SkCanvas(width, height)
-    , fFactorySet(is_cross_process(flags) ? SkNEW(SkNamedFactorySet) : NULL)
+    , fFactorySet(is_cross_process(flags) ? new SkNamedFactorySet : NULL)
     , fWriter(*writer)
     , fFlags(flags)
     , fFlattenableHeap(FLATTENABLES_TO_KEEP, fFactorySet, is_cross_process(flags))
-    , fFlatDictionary(&fFlattenableHeap)
-{
+    , fFlatDictionary(&fFlattenableHeap) {
     fController = controller;
     fDone = false;
     fBlockSize = 0; // need first block from controller
@@ -458,11 +459,10 @@ SkGPipeCanvas::SkGPipeCanvas(SkGPipeController* controller,
     }
 
     if (shouldFlattenBitmaps(flags)) {
-        fBitmapShuttle.reset(SkNEW_ARGS(BitmapShuttle, (this)));
-        fBitmapHeap = SkNEW_ARGS(SkBitmapHeap, (fBitmapShuttle.get(), BITMAPS_TO_KEEP));
+        fBitmapShuttle.reset(new BitmapShuttle(this));
+        fBitmapHeap = new SkBitmapHeap(fBitmapShuttle.get(), BITMAPS_TO_KEEP);
     } else {
-        fBitmapHeap = SkNEW_ARGS(SkBitmapHeap,
-                                 (BITMAPS_TO_KEEP, controller->numberOfReaders()));
+        fBitmapHeap = new SkBitmapHeap(BITMAPS_TO_KEEP, controller->numberOfReaders());
         if (this->needOpBytes(sizeof(void*))) {
             this->writeOp(kShareBitmapHeap_DrawOp);
             fWriter.writePtr(static_cast<void*>(fBitmapHeap));
@@ -470,7 +470,7 @@ SkGPipeCanvas::SkGPipeCanvas(SkGPipeController* controller,
     }
     fFlattenableHeap.setBitmapStorage(fBitmapHeap);
 
-    fImageHeap = SkNEW(SkImageHeap);
+    fImageHeap = new SkImageHeap;
     if (this->needOpBytes(sizeof(void*))) {
         this->writeOp(kShareImageHeap_DrawOp);
         fWriter.writePtr(static_cast<void*>(fImageHeap));
@@ -1399,7 +1399,7 @@ SkCanvas* SkGPipeWriter::startRecording(SkGPipeController* controller, uint32_t
                                         uint32_t width, uint32_t height) {
     if (NULL == fCanvas) {
         fWriter.reset(NULL, 0);
-        fCanvas = SkNEW_ARGS(SkGPipeCanvas, (controller, &fWriter, flags, width, height));
+        fCanvas = new SkGPipeCanvas(controller, &fWriter, flags, width, height);
     }
     controller->setCanvas(fCanvas);
     return fCanvas;
index 9ef088d..3400aa9 100644 (file)
@@ -133,7 +133,7 @@ SkFontConfigInterface* SkFontConfigInterface::GetSingletonDirectInterface(SkBase
     SkAutoMutexAcquire ac(mutex);
     static SkFontConfigInterfaceDirect* singleton = NULL;
     if (singleton == NULL) {
-        singleton = SkNEW(SkFontConfigInterfaceDirect);
+        singleton = new SkFontConfigInterfaceDirect;
     }
     return singleton;
 }
@@ -733,9 +733,7 @@ bool SkFontConfigInterfaceDirect::matchFamilySet(const char inFamilyName[],
             }
         }
 
-        SkFontStyleSet_FC* sset = SkNEW_ARGS(SkFontStyleSet_FC,
-                                             (trimmedMatches.begin(),
-                                              trimmedMatches.count()));
+        SkFontStyleSet_FC* sset = new SkFontStyleSet_FC                                               (trimmedMatches.begin(),                                               trimmedMatches.count());
 #endif
     return false;
 }
index 3672f4e..d207f08 100644 (file)
@@ -21,12 +21,12 @@ public:
     static FontConfigTypeface* Create(const SkFontStyle& style,
                                       const SkFontConfigInterface::FontIdentity& fi,
                                       const SkString& familyName) {
-        return SkNEW_ARGS(FontConfigTypeface, (style, fi, familyName));
+        return new FontConfigTypeface(style, fi, familyName);
     }
 
     static FontConfigTypeface* Create(const SkFontStyle& style, bool fixedWidth,
                                       SkStreamAsset* localStream) {
-        return SkNEW_ARGS(FontConfigTypeface, (style, fixedWidth, localStream));
+        return new FontConfigTypeface(style, fixedWidth, localStream);
     }
 
     const SkFontConfigInterface::FontIdentity& getIdentity() const {
index 63f598f..860f320 100644 (file)
@@ -158,7 +158,7 @@ static bool ref_ft_library() {
 
     if (0 == gFTCount) {
         SkASSERT(NULL == gFTLibrary);
-        gFTLibrary = SkNEW(FreeTypeLibrary);
+        gFTLibrary = new FreeTypeLibrary;
     }
     ++gFTCount;
     return gFTLibrary->library();
@@ -172,7 +172,7 @@ static void unref_ft_library() {
     --gFTCount;
     if (0 == gFTCount) {
         SkASSERT(NULL != gFTLibrary);
-        SkDELETE(gFTLibrary);
+        delete gFTLibrary;
         SkDEBUGCODE(gFTLibrary = NULL;)
     }
 }
@@ -319,7 +319,7 @@ static FT_Face ref_ft_face(const SkTypeface* typeface) {
     }
 
     // this passes ownership of stream to the rec
-    rec = SkNEW_ARGS(SkFaceRec, (data->detachStream(), fontID));
+    rec = new SkFaceRec(data->detachStream(), fontID);
 
     FT_Open_Args args;
     memset(&args, 0, sizeof(args));
@@ -336,7 +336,7 @@ static FT_Face ref_ft_face(const SkTypeface* typeface) {
     FT_Error err = FT_Open_Face(gFTLibrary->library(), &args, data->getIndex(), &rec->fFace);
     if (err) {
         SkDEBUGF(("ERROR: unable to open font '%x'\n", fontID));
-        SkDELETE(rec);
+        delete rec;
         return NULL;
     }
     SkASSERT(rec->fFace);
@@ -374,7 +374,7 @@ static void unref_ft_face(FT_Face face) {
                     gFaceRecHead = next;
                 }
                 FT_Done_Face(face);
-                SkDELETE(rec);
+                delete rec;
             }
             return;
         }
@@ -662,11 +662,10 @@ static bool isAxisAligned(const SkScalerContext::Rec& rec) {
 
 SkScalerContext* SkTypeface_FreeType::onCreateScalerContext(
                                                const SkDescriptor* desc) const {
-    SkScalerContext_FreeType* c = SkNEW_ARGS(SkScalerContext_FreeType,
-                                        (const_cast<SkTypeface_FreeType*>(this),
-                                         desc));
+    SkScalerContext_FreeType* c =
+            new SkScalerContext_FreeType(const_cast<SkTypeface_FreeType*>(this), desc);
     if (!c->success()) {
-        SkDELETE(c);
+        delete c;
         c = NULL;
     }
     return c;
old mode 100755 (executable)
new mode 100644 (file)
index b55aa35..b144aee
@@ -2198,9 +2198,8 @@ static SkTypeface* createFromDesc(CFStringRef cfFamilyName, CTFontDescriptorRef
     bool isFixedPitch;
     (void)computeStyleBits(ctFont, &isFixedPitch);
 
-    face = SkNEW_ARGS(SkTypeface_Mac, (ctFont.detach(), NULL,
-                                       cacheRequest.fStyle, isFixedPitch,
-                                       skFamilyName.c_str(), false));
+    face = new SkTypeface_Mac(ctFont.detach(), NULL, cacheRequest.fStyle, isFixedPitch,
+                              skFamilyName.c_str(), false);
     SkTypefaceCache::Add(face, face->fontStyle());
     return face;
 }
@@ -2298,7 +2297,7 @@ class SkFontMgr_Mac : public SkFontMgr {
 
         AutoCFRelease<CTFontDescriptorRef> desc(
                                 CTFontDescriptorCreateWithAttributes(cfAttr));
-        return SkNEW_ARGS(SkFontStyleSet_Mac, (cfFamilyName, desc));
+        return new SkFontStyleSet_Mac(cfFamilyName, desc);
     }
 
 public:
@@ -2488,6 +2487,4 @@ protected:
 
 ///////////////////////////////////////////////////////////////////////////////
 
-SkFontMgr* SkFontMgr::Factory() {
-    return SkNEW(SkFontMgr_Mac);
-}
+SkFontMgr* SkFontMgr::Factory() { return new SkFontMgr_Mac; }
old mode 100755 (executable)
new mode 100644 (file)
index d19ab1a..97e659e
@@ -2277,10 +2277,9 @@ size_t LogFontTypeface::onGetTableData(SkFontTableTag tag, size_t offset,
 }
 
 SkScalerContext* LogFontTypeface::onCreateScalerContext(const SkDescriptor* desc) const {
-    SkScalerContext_GDI* ctx = SkNEW_ARGS(SkScalerContext_GDI,
-                                                (const_cast<LogFontTypeface*>(this), desc));
+    SkScalerContext_GDI* ctx = new SkScalerContext_GDI(const_cast<LogFontTypeface*>(this), desc);
     if (!ctx->isValid()) {
-        SkDELETE(ctx);
+        delete ctx;
         ctx = NULL;
     }
     return ctx;
@@ -2442,7 +2441,7 @@ protected:
 
     SkFontStyleSet* onCreateStyleSet(int index) const override {
         SkASSERT((unsigned)index < (unsigned)fLogFontArray.count());
-        return SkNEW_ARGS(SkFontStyleSetGDI, (fLogFontArray[index].elfLogFont.lfFaceName));
+        return new SkFontStyleSetGDI(fLogFontArray[index].elfLogFont.lfFaceName);
     }
 
     SkFontStyleSet* onMatchFamily(const char familyName[]) const override {
@@ -2451,7 +2450,7 @@ protected:
         }
         LOGFONT lf;
         logfont_for_name(familyName, &lf);
-        return SkNEW_ARGS(SkFontStyleSetGDI, (lf.lfFaceName));
+        return new SkFontStyleSetGDI(lf.lfFaceName);
     }
 
     virtual SkTypeface* onMatchFamilyStyle(const char familyName[],
@@ -2482,7 +2481,7 @@ protected:
 
     SkTypeface* onCreateFromData(SkData* data, int ttcIndex) const override {
         // could be in base impl
-        return this->createFromStream(SkNEW_ARGS(SkMemoryStream, (data)));
+        return this->createFromStream(new SkMemoryStream(data));
     }
 
     SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const override {
@@ -2511,6 +2510,4 @@ private:
 
 ///////////////////////////////////////////////////////////////////////////////
 
-SkFontMgr* SkFontMgr_New_GDI() {
-    return SkNEW(SkFontMgrGDI);
-}
+SkFontMgr* SkFontMgr_New_GDI() { return new SkFontMgrGDI; }
index 45c787a..dc89d91 100644 (file)
@@ -204,33 +204,27 @@ public:
                 // TODO: warn on defaulted axis?
             }
 
-            SkDEBUGCODE (
-                // Check for axis specified, but not matched in font.
-                for (int i = 0; i < fontFile.fAxes.count(); ++i) {
-                    SkFourByteTag skTag = fontFile.fAxes[i].fTag;
-                    bool found = false;
-                    for (int j = 0; j < axisDefinitions.count(); ++j) {
-                        if (skTag == axisDefinitions[j].fTag) {
-                            found = true;
-                            break;
+            SkDEBUGCODE(
+                    // Check for axis specified, but not matched in font.
+                    for (int i = 0; i < fontFile.fAxes.count(); ++i) {
+                        SkFourByteTag skTag = fontFile.fAxes[i].fTag;
+                        bool found = false;
+                        for (int j = 0; j < axisDefinitions.count(); ++j) {
+                            if (skTag == axisDefinitions[j].fTag) {
+                                found = true;
+                                break;
+                            }
                         }
-                    }
-                    if (!found) {
-                        SkDEBUGF(("Requested font axis not found: %s '%c%c%c%c'\n",
-                                  familyName.c_str(),
-                                  (skTag >> 24) & 0xFF,
-                                  (skTag >> 16) & 0xFF,
-                                  (skTag >>  8) & 0xFF,
-                                  (skTag      ) & 0xFF));
-                    }
-                }
-            )
+                        if (!found) {
+                            SkDEBUGF(("Requested font axis not found: %s '%c%c%c%c'\n",
+                                      familyName.c_str(), (skTag >> 24) & 0xFF,
+                                      (skTag >> 16) & 0xFF, (skTag >> 8) & 0xFF, (skTag)&0xFF));
+                        }
+                    })
 
-            fStyles.push_back().reset(SkNEW_ARGS(SkTypeface_AndroidSystem,
-                                                 (pathName, ttcIndex,
-                                                  axisValues.get(), axisDefinitions.count(),
-                                                  style, isFixedWidth, familyName,
-                                                  lang, variant)));
+                    fStyles.push_back().reset(new SkTypeface_AndroidSystem(
+                            pathName, ttcIndex, axisValues.get(), axisDefinitions.count(), style,
+                            isFixedWidth, familyName, lang, variant));
         }
     }
 
@@ -476,7 +470,7 @@ protected:
             return NULL;
         }
         SkFontData* data(new SkFontData(stream.detach(), ttcIndex, NULL, 0));
-        return SkNEW_ARGS(SkTypeface_AndroidStream, (data, style, isFixedPitch, name));
+        return new SkTypeface_AndroidStream(data, style, isFixedPitch, name);
     }
 
     SkTypeface* onCreateFromFontData(SkFontData* data) const override {
@@ -487,7 +481,7 @@ protected:
         if (!fScanner.scanFont(stream, data->getIndex(), &name, &style, &isFixedPitch, NULL)) {
             return NULL;
         }
-        return SkNEW_ARGS(SkTypeface_AndroidStream, (data, style, isFixedPitch, name));
+        return new SkTypeface_AndroidStream(data, style, isFixedPitch, name);
     }
 
 
@@ -531,17 +525,16 @@ private:
                 }
             }
 
-            SkFontStyleSet_Android* newSet =
-                SkNEW_ARGS(SkFontStyleSet_Android, (family, fScanner));
+            SkFontStyleSet_Android* newSet = new SkFontStyleSet_Android(family, fScanner);
             if (0 == newSet->count()) {
-                SkDELETE(newSet);
+                delete newSet;
                 continue;
             }
             fFontStyleSets.push_back().reset(newSet);
 
             for (int j = 0; j < family.fNames.count(); j++) {
                 NameToFamily* nextEntry = nameToFamily->append();
-                SkNEW_PLACEMENT_ARGS(&nextEntry->name, SkString, (family.fNames[j]));
+                new (&nextEntry->name) SkString(family.fNames[j]);
                 nextEntry->styleSet = newSet;
             }
         }
@@ -591,5 +584,5 @@ SkFontMgr* SkFontMgr_New_Android(const SkFontMgr_Android_CustomFonts* custom) {
                   custom->fFallbackFontsXml));
     }
 
-    return SkNEW_ARGS(SkFontMgr_Android, (custom));
+    return new SkFontMgr_Android(custom);
 }
index 835acd7..496a54c 100644 (file)
@@ -296,8 +296,8 @@ protected:
         SkFontStyle style;
         SkString name;
         if (fScanner.scanFont(stream, ttcIndex, &name, &style, &isFixedPitch, NULL)) {
-            return SkNEW_ARGS(SkTypeface_Stream, (style, isFixedPitch, false, name,
-                                                  stream.detach(), ttcIndex));
+            return new SkTypeface_Stream(style, isFixedPitch, false, name, stream.detach(),
+                                         ttcIndex);
         } else {
             return NULL;
         }
@@ -353,7 +353,7 @@ public:
         if (families->empty()) {
             SkFontStyleSet_Custom* family = new SkFontStyleSet_Custom(SkString());
             families->push_back().reset(family);
-            family->appendTypeface(SkNEW(SkTypeface_Empty));
+            family->appendTypeface(new SkTypeface_Empty);
         }
     }
 
@@ -400,13 +400,9 @@ private:
                     continue;
                 }
 
-                SkTypeface_Custom* tf = SkNEW_ARGS(SkTypeface_File, (
-                                                    style,
-                                                    isFixedPitch,
-                                                    true,  // system-font (cannot delete)
-                                                    realname,
-                                                    filename.c_str(),
-                                                    faceIndex));
+                SkTypeface_Custom* tf = new SkTypeface_File(style, isFixedPitch,
+                                                            true,  // system-font (cannot delete)
+                                                            realname, filename.c_str(), faceIndex);
 
                 SkFontStyleSet_Custom* addTo = find_family(*families, realname.c_str());
                 if (NULL == addTo) {
@@ -454,7 +450,7 @@ public:
         if (families->empty()) {
             SkFontStyleSet_Custom* family = new SkFontStyleSet_Custom(SkString());
             families->push_back().reset(family);
-            family->appendTypeface(SkNEW(SkTypeface_Empty));
+            family->appendTypeface(new SkTypeface_Empty);
         }
     }
 
@@ -491,13 +487,9 @@ private:
                 return;
             }
 
-            SkTypeface_Custom* tf = SkNEW_ARGS(SkTypeface_Stream, (
-                                                style,
-                                                isFixedPitch,
-                                                true,  // system-font (cannot delete)
-                                                realname,
-                                                stream.detach(),
-                                                faceIndex));
+            SkTypeface_Custom* tf =
+                    new SkTypeface_Stream(style, isFixedPitch, true,  // system-font (cannot delete)
+                                          realname, stream.detach(), faceIndex);
 
             SkFontStyleSet_Custom* addTo = find_family(*families, realname.c_str());
             if (NULL == addTo) {
index 5a34455..3dc1ea0 100644 (file)
@@ -65,8 +65,8 @@ namespace {
 SK_DECLARE_STATIC_MUTEX(gFCMutex);
 
 #ifdef SK_DEBUG
-    void *CreateThreadFcLocked() { return SkNEW_ARGS(bool, (false)); }
-    void DeleteThreadFcLocked(void* v) { SkDELETE(static_cast<bool*>(v)); }
+void* CreateThreadFcLocked() { return new bool(false); }
+void DeleteThreadFcLocked(void* v) { delete static_cast<bool*>(v); }
 #   define THREAD_FC_LOCKED \
         static_cast<bool*>(SkTLS::Get(CreateThreadFcLocked, DeleteThreadFcLocked))
 #endif
@@ -416,7 +416,7 @@ class SkTypeface_fontconfig : public SkTypeface_FreeType {
 public:
     /** @param pattern takes ownership of the reference. */
     static SkTypeface_fontconfig* Create(FcPattern* pattern) {
-        return SkNEW_ARGS(SkTypeface_fontconfig, (pattern));
+        return new SkTypeface_fontconfig(pattern);
     }
     mutable SkAutoFcPattern fPattern;
 
@@ -725,7 +725,7 @@ protected:
             }
         }
 
-        return SkNEW_ARGS(StyleSet, (this, matches.detach()));
+        return new StyleSet(this, matches.detach());
     }
 
     virtual SkTypeface* onMatchFamilyStyle(const char familyName[],
@@ -830,12 +830,12 @@ protected:
             return NULL;
         }
 
-        return SkNEW_ARGS(SkTypeface_stream, (new SkFontData(stream.detach(), ttcIndex, NULL, 0),
-                                              style, isFixedWidth));
+        return new SkTypeface_stream(new SkFontData(stream.detach(), ttcIndex, NULL, 0), style,
+                                     isFixedWidth);
     }
 
     SkTypeface* onCreateFromData(SkData* data, int ttcIndex) const override {
-        return this->createFromStream(SkNEW_ARGS(SkMemoryStream, (data)), ttcIndex);
+        return this->createFromStream(new SkMemoryStream(data), ttcIndex);
     }
 
     SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const override {
@@ -856,7 +856,7 @@ protected:
             return NULL;
         }
 
-        return SkNEW_ARGS(SkTypeface_stream, (fontData, style, isFixedWidth));
+        return new SkTypeface_stream(fontData, style, isFixedWidth);
     }
 
     virtual SkTypeface* onLegacyCreateTypeface(const char familyName[],
index ca8b260..df51764 100644 (file)
@@ -479,7 +479,7 @@ SkFontStyleSet* SkFontMgr_DirectWrite::onCreateStyleSet(int index) const {
     SkTScopedComPtr<IDWriteFontFamily> fontFamily;
     HRNM(fFontCollection->GetFontFamily(index, &fontFamily), "Could not get requested family.");
 
-    return SkNEW_ARGS(SkFontStyleSet_DirectWrite, (this, fontFamily.get()));
+    return new SkFontStyleSet_DirectWrite(this, fontFamily.get());
 }
 
 SkFontStyleSet* SkFontMgr_DirectWrite::onMatchFamily(const char familyName[]) const {
@@ -914,7 +914,7 @@ SkTypeface* SkFontMgr_DirectWrite::onCreateFromStream(SkStreamAsset* stream, int
 }
 
 SkTypeface* SkFontMgr_DirectWrite::onCreateFromData(SkData* data, int ttcIndex) const {
-    return this->createFromStream(SkNEW_ARGS(SkMemoryStream, (data)), ttcIndex);
+    return this->createFromStream(new SkMemoryStream(data), ttcIndex);
 }
 
 SkTypeface* SkFontMgr_DirectWrite::onCreateFromFile(const char path[], int ttcIndex) const {
@@ -1092,8 +1092,7 @@ SK_API SkFontMgr* SkFontMgr_New_DirectWrite(IDWriteFactory* factory) {
         };
     }
 
-    return SkNEW_ARGS(SkFontMgr_DirectWrite, (factory, sysFontCollection.get(),
-                                              localeName, localeNameLen));
+    return new SkFontMgr_DirectWrite(factory, sysFontCollection.get(), localeName, localeNameLen);
 }
 
 #include "SkFontMgr_indirect.h"
@@ -1102,5 +1101,5 @@ SK_API SkFontMgr* SkFontMgr_New_DirectWriteRenderer(SkRemotableFontMgr* proxy) {
     if (impl.get() == NULL) {
         return NULL;
     }
-    return SkNEW_ARGS(SkFontMgr_Indirect, (impl.get(), proxy));
+    return new SkFontMgr_Indirect(impl.get(), proxy);
 }
index ba16e4b..e1e6dc1 100644 (file)
@@ -221,7 +221,7 @@ SkImageDecoder* SkImageDecoder::Factory(SkStreamRewindable* stream) {
     SkImageDecoder* decoder = image_decoder_from_stream(stream);
     if (NULL == decoder) {
         // If no image decoder specific to the stream exists, use SkImageDecoder_CG.
-        return SkNEW(SkImageDecoder_CG);
+        return new SkImageDecoder_CG;
     } else {
         return decoder;
     }
@@ -344,7 +344,7 @@ static SkImageEncoder* sk_imageencoder_cg_factory(SkImageEncoder::Type t) {
         default:
             return NULL;
     }
-    return SkNEW_ARGS(SkImageEncoder_CG, (t));
+    return new SkImageEncoder_CG(t);
 }
 
 static SkImageEncoder_EncodeReg gEReg(sk_imageencoder_cg_factory);
index 55344a7..9194831 100644 (file)
@@ -256,7 +256,7 @@ SkImageDecoder* SkImageDecoder::Factory(SkStreamRewindable* stream) {
     SkImageDecoder* decoder = image_decoder_from_stream(stream);
     if (NULL == decoder) {
         // If no image decoder specific to the stream exists, use SkImageDecoder_WIC.
-        return SkNEW(SkImageDecoder_WIC);
+        return new SkImageDecoder_WIC;
     } else {
         return decoder;
     }
@@ -447,7 +447,7 @@ static SkImageEncoder* sk_imageencoder_wic_factory(SkImageEncoder::Type t) {
         default:
             return NULL;
     }
-    return SkNEW_ARGS(SkImageEncoder_WIC, (t));
+    return new SkImageEncoder_WIC(t);
 }
 
 static SkImageEncoder_EncodeReg gEReg(sk_imageencoder_wic_factory);
index e5ad6da..e6cca08 100644 (file)
@@ -49,7 +49,7 @@ bool SkImageDecoder::buildTileIndex(SkStreamRewindable*, int *width, int *height
 
 bool SkImageDecoder::onBuildTileIndex(SkStreamRewindable* stream,
                                       int* /*width*/, int* /*height*/) {
-    SkDELETE(stream);
+    delete stream;
     return false;
 }
 
index 72480b8..2b11651 100644 (file)
@@ -49,8 +49,8 @@ protected:
     bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
                      SkPMColor ctableEntries[], int* ctableCount) override {
         SkMemoryStream stream(fData->data(), fData->size(), false);
-        SkAutoTUnref<BareMemoryAllocator> allocator(SkNEW_ARGS(BareMemoryAllocator,
-                                                               (info, pixels, rowBytes)));
+        SkAutoTUnref<BareMemoryAllocator> allocator(
+                new BareMemoryAllocator(info, pixels, rowBytes));
         fDecoder->setAllocator(allocator);
         fDecoder->setRequireUnpremultipliedColors(kUnpremul_SkAlphaType == info.alphaType());
 
@@ -97,9 +97,9 @@ SkImageGenerator* SkImageGenerator::NewFromEncodedImpl(SkData* data) {
     SkBitmap bm;
     stream.rewind();
     if (!decoder->decode(&stream, &bm, kUnknown_SkColorType, SkImageDecoder::kDecodeBounds_Mode)) {
-        SkDELETE(decoder);
+        delete decoder;
         return NULL;
     }
 
-    return SkNEW_ARGS(SkImageDecoderGenerator, (bm.info(), decoder, data));
+    return new SkImageDecoderGenerator(bm.info(), decoder, data);
 }
index b7cf583..b604c21 100644 (file)
@@ -104,12 +104,10 @@ struct SkOSFileIterData {
 };
 static_assert(sizeof(SkOSFileIterData) <= SkOSFile::Iter::kStorageSize, "not_enough_space");
 
-SkOSFile::Iter::Iter() {
-    SkNEW_PLACEMENT(fSelf.get(), SkOSFileIterData);
-}
+SkOSFile::Iter::Iter() { new (fSelf.get()) SkOSFileIterData; }
 
 SkOSFile::Iter::Iter(const char path[], const char suffix[]) {
-    SkNEW_PLACEMENT(fSelf.get(), SkOSFileIterData);
+    new (fSelf.get()) SkOSFileIterData;
     this->reset(path, suffix);
 }
 
index 62510e7..64bd516 100644 (file)
@@ -155,12 +155,10 @@ static uint16_t* concat_to_16(const char src[], const char suffix[]) {
     return dst;
 }
 
-SkOSFile::Iter::Iter() {
-    SkNEW_PLACEMENT(fSelf.get(), SkOSFileIterData);
-}
+SkOSFile::Iter::Iter() { new (fSelf.get()) SkOSFileIterData; }
 
 SkOSFile::Iter::Iter(const char path[], const char suffix[]) {
-    SkNEW_PLACEMENT(fSelf.get(), SkOSFileIterData);
+    new (fSelf.get()) SkOSFileIterData;
     this->reset(path, suffix);
 }
 
index 006346a..2d06255 100644 (file)
@@ -466,7 +466,7 @@ public:
         HRNM(loader->CreateStreamFromKey(id.fKey, id.fKeySize, &fontFileStream),
              "Could not create font file stream.");
 
-        return SkNEW_ARGS(SkDWriteFontFileStream, (fontFileStream.get()));
+        return new SkDWriteFontFileStream(fontFileStream.get());
     }
 
 private:
@@ -502,6 +502,5 @@ SkRemotableFontMgr* SkRemotableFontMgr_New_DirectWrite() {
         };
     }
 
-    return SkNEW_ARGS(SkRemotableFontMgr_DirectWrite, (sysFontCollection.get(),
-                                                       localeName, localeNameLen));
+    return new SkRemotableFontMgr_DirectWrite(sysFontCollection.get(), localeName, localeNameLen);
 }
index 90dc2c4..3af4cca 100644 (file)
@@ -239,11 +239,11 @@ SkStreamAsset* DWriteFontTypeface::onOpenStream(int* ttcIndex) const {
                                              &fontFileStream),
          "Could not create font file stream.");
 
-    return SkNEW_ARGS(SkDWriteFontFileStream, (fontFileStream.get()));
+    return new SkDWriteFontFileStream(fontFileStream.get());
 }
 
 SkScalerContext* DWriteFontTypeface::onCreateScalerContext(const SkDescriptor* desc) const {
-    return SkNEW_ARGS(SkScalerContext_DW, (const_cast<DWriteFontTypeface*>(this), desc));
+    return new SkScalerContext_DW(const_cast<DWriteFontTypeface*>(this), desc);
 }
 
 void DWriteFontTypeface::onFilterRec(SkScalerContext::Rec* rec) const {
index 71d928b..866e634 100644 (file)
@@ -78,9 +78,8 @@ public:
                                       IDWriteFontFileLoader* fontFileLoader = NULL,
                                       IDWriteFontCollectionLoader* fontCollectionLoader = NULL) {
         SkFontID fontID = SkTypefaceCache::NewFontID();
-        return SkNEW_ARGS(DWriteFontTypeface, (get_style(font), fontID,
-                                               factory, fontFace, font, fontFamily,
-                                               fontFileLoader, fontCollectionLoader));
+        return new DWriteFontTypeface(get_style(font), fontID, factory, fontFace, font, fontFamily,
+                                      fontFileLoader, fontCollectionLoader);
     }
 
 protected:
index 22a6e0b..b6634b8 100644 (file)
@@ -13,5 +13,5 @@ SkCanvas* SkSVGCanvas::Create(const SkRect& bounds, SkXMLWriter* writer) {
     SkISize size = bounds.roundOut().size();
     SkAutoTUnref<SkBaseDevice> device(SkSVGDevice::Create(size, writer));
 
-    return SkNEW_ARGS(SkCanvas, (device));
+    return new SkCanvas(device);
 }
index 64f74c8..a3f8af7 100644 (file)
@@ -290,7 +290,7 @@ public:
         if (!res.fClip.isEmpty()) {
             // The clip is in device space. Apply it via a <g> wrapper to avoid local transform
             // interference.
-            fClipGroup.reset(SkNEW_ARGS(AutoElement, ("g", fWriter)));
+            fClipGroup.reset(new AutoElement("g", fWriter));
             fClipGroup->addAttribute("clip-path",res.fClip);
         }
 
@@ -566,13 +566,13 @@ SkBaseDevice* SkSVGDevice::Create(const SkISize& size, SkXMLWriter* writer) {
         return NULL;
     }
 
-    return SkNEW_ARGS(SkSVGDevice, (size, writer));
+    return new SkSVGDevice(size, writer);
 }
 
 SkSVGDevice::SkSVGDevice(const SkISize& size, SkXMLWriter* writer)
     : INHERITED(SkSurfaceProps(0, kUnknown_SkPixelGeometry))
     , fWriter(writer)
-    , fResourceBucket(SkNEW(ResourceBucket)) {
+    , fResourceBucket(new ResourceBucket) {
     SkASSERT(writer);
 
     fLegacyBitmap.setInfo(SkImageInfo::MakeUnknown(size.width(), size.height()));
@@ -580,7 +580,7 @@ SkSVGDevice::SkSVGDevice(const SkISize& size, SkXMLWriter* writer)
     fWriter->writeHeader();
 
     // The root <svg> tag gets closed by the destructor.
-    fRootElement.reset(SkNEW_ARGS(AutoElement, ("svg", fWriter)));
+    fRootElement.reset(new AutoElement("svg", fWriter));
 
     fRootElement->addAttribute("xmlns", "http://www.w3.org/2000/svg");
     fRootElement->addAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink");
index ae6e54c..2bfb687 100644 (file)
@@ -45,17 +45,17 @@ int tool_main(int argc, char** argv) {
 
     SkAutoTDelete<SkWStream> outStream;
     if (FLAGS_output.count() > 0) {
-        SkFILEWStream* fileStream = SkNEW_ARGS(SkFILEWStream, (FLAGS_output[0]));
+        SkFILEWStream* fileStream = new SkFILEWStream(FLAGS_output[0]);
         if (!fileStream->isValid()) {
             SkDebugf("Couldn't open output file for writing: %s\n", FLAGS_output[0]);
             return kIOError;
         }
         outStream.reset(fileStream);
     } else {
-        outStream.reset(SkNEW(SkDebugWStream));
+        outStream.reset(new SkDebugWStream);
     }
 
-    SkAutoTDelete<SkXMLWriter> xmlWriter(SkNEW_ARGS(SkXMLStreamWriter, (outStream.get())));
+    SkAutoTDelete<SkXMLWriter> xmlWriter(new SkXMLStreamWriter(outStream.get()));
     SkAutoTUnref<SkCanvas> svgCanvas(SkSVGCanvas::Create(pic->cullRect(), xmlWriter.get()));
 
     pic->playback(svgCanvas);
index d9f9cf5..c7389ce 100644 (file)
@@ -291,13 +291,13 @@ Sk3DView::~Sk3DView() {
     Rec* rec = fRec;
     while (rec != &fInitialRec) {
         Rec* next = rec->fNext;
-        SkDELETE(rec);
+        delete rec;
         rec = next;
     }
 }
 
 void Sk3DView::save() {
-    Rec* rec = SkNEW(Rec);
+    Rec* rec = new Rec;
     rec->fNext = fRec;
     rec->fMatrix = fRec->fMatrix;
     fRec = rec;
@@ -306,7 +306,7 @@ void Sk3DView::save() {
 void Sk3DView::restore() {
     SkASSERT(fRec != &fInitialRec);
     Rec* next = fRec->fNext;
-    SkDELETE(fRec);
+    delete fRec;
     fRec = next;
 }
 
index 12ceefc..8ab853d 100644 (file)
@@ -206,7 +206,7 @@ SkCanvasState* SkCanvasStateUtils::CaptureCanvasState(SkCanvas* canvas) {
         return NULL;
     }
 
-    SkAutoTDelete<SkCanvasState_v1> canvasState(SkNEW_ARGS(SkCanvasState_v1, (canvas)));
+    SkAutoTDelete<SkCanvasState_v1> canvasState(new SkCanvasState_v1(canvas));
 
     // decompose the total matrix and clip
     setup_MC_state(&canvasState->mcState, canvas->getTotalMatrix(),
@@ -311,7 +311,7 @@ static SkCanvas* create_canvas_from_canvas_layer(const SkCanvasLayerState& layer
     SkASSERT(!bitmap.empty());
     SkASSERT(!bitmap.isNull());
 
-    SkAutoTUnref<SkCanvas> canvas(SkNEW_ARGS(SkCanvas, (bitmap)));
+    SkAutoTUnref<SkCanvas> canvas(new SkCanvas(bitmap));
 
     // setup the matrix and clip
     setup_canvas_from_MC_state(layerState.mcState, canvas.get());
@@ -330,7 +330,7 @@ SkCanvas* SkCanvasStateUtils::CreateFromCanvasState(const SkCanvasState* state)
         return NULL;
     }
 
-    SkAutoTUnref<SkCanvasStack> canvas(SkNEW_ARGS(SkCanvasStack, (state->width, state->height)));
+    SkAutoTUnref<SkCanvasStack> canvas(new SkCanvasStack(state->width, state->height));
 
     // setup the matrix and clip on the n-way canvas
     setup_canvas_from_MC_state(state_v1->mcState, canvas);
@@ -355,5 +355,5 @@ void SkCanvasStateUtils::ReleaseCanvasState(SkCanvasState* state) {
     // Upcast to the correct version of SkCanvasState. This avoids having a virtual destructor on
     // SkCanvasState. That would be strange since SkCanvasState has no other virtual functions, and
     // instead uses the field "version" to determine how to behave.
-    SkDELETE(static_cast<SkCanvasState_v1*>(state));
+    delete static_cast<SkCanvasState_v1*>(state);
 }
index 6176e1c..1c916ed 100644 (file)
@@ -47,7 +47,7 @@ void SkEventTracer::SetInstance(SkEventTracer* tracer) {
     SkASSERT(nullptr == sk_atomic_load(&gUserTracer, sk_memory_order_acquire));
     sk_atomic_store(&gUserTracer, tracer, sk_memory_order_release);
     // An atomic load during process shutdown is probably overkill, but safe overkill.
-    atexit([](){ SkDELETE(sk_atomic_load(&gUserTracer, sk_memory_order_acquire)); });
+    atexit([]() { delete sk_atomic_load(&gUserTracer, sk_memory_order_acquire); });
 }
 
 SkEventTracer* SkEventTracer::GetInstance() {
index beead37..08364d1 100644 (file)
@@ -69,7 +69,7 @@ SkStreamRewindable* SkFrontBufferedStream::Create(SkStream* stream, size_t buffe
     if (NULL == stream) {
         return NULL;
     }
-    return SkNEW_ARGS(FrontBufferedStream, (stream, bufferSize));
+    return new FrontBufferedStream(stream, bufferSize);
 }
 
 FrontBufferedStream::FrontBufferedStream(SkStream* stream, size_t bufferSize)
index f5198c0..c9b2252 100644 (file)
@@ -14,7 +14,7 @@ public:
 };
 
 SkImageGenerator* SkImageGeneratorUtils::NewEmpty(const SkImageInfo& info) {
-    return SkNEW_ARGS(GeneratorFromEmpty, (info));
+    return new GeneratorFromEmpty(info);
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -38,7 +38,7 @@ private:
 };
 
 SkImageGenerator* SkImageGeneratorUtils::NewFromBitmap(const SkBitmap& bm) {
-    return SkNEW_ARGS(GeneratorFromBitmap, (bm));
+    return new GeneratorFromBitmap(bm);
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -91,7 +91,7 @@ SkImageGenerator* SkImageGeneratorUtils::NewFromTexture(GrContext* ctx, GrTextur
         }
         const SkAlphaType at = kPremul_SkAlphaType; // take isOpaque from caller?
         SkImageInfo info = SkImageInfo::Make(desc.fWidth, desc.fHeight, ct, at, cpt);
-        return SkNEW_ARGS(GeneratorFromTexture, (ctx, tex, info));
+        return new GeneratorFromTexture(ctx, tex, info);
     }
 #endif
     return nullptr;
@@ -126,7 +126,7 @@ SkImageGenerator* SkImageGeneratorUtils::NewFromImage(const SkImage* image) {
         const SkColorType ct = kN32_SkColorType;
         const SkAlphaType at = image->isOpaque() ? kOpaque_SkAlphaType : kPremul_SkAlphaType;
         const SkImageInfo info = SkImageInfo::Make(image->width(), image->height(), ct, at);
-        return SkNEW_ARGS(GeneratorFromImage, (image, info));
+        return new GeneratorFromImage(image, info);
     }
     return nullptr;
 }
index 866a361..b5ee8d3 100644 (file)
@@ -14,5 +14,5 @@
 SkCanvas* SkCreateNullCanvas() {
     // An N-Way canvas forwards calls to N canvas's. When N == 0 it's
     // effectively a null canvas.
-    return SkNEW_ARGS(SkNWayCanvas, (0,0));
+    return new SkNWayCanvas(0, 0);
 }
index 96e3c8f..386e3a6 100644 (file)
@@ -22,11 +22,11 @@ SkPatchGrid::SkPatchGrid(int rows, int cols, VertexType flags, SkXfermode* xfer)
 }
 
 SkPatchGrid::~SkPatchGrid() {
-    SkDELETE_ARRAY(fCornerPts);
-    SkDELETE_ARRAY(fCornerColors);
-    SkDELETE_ARRAY(fTexCoords);
-    SkDELETE_ARRAY(fHrzCtrlPts);
-    SkDELETE_ARRAY(fVrtCtrlPts);
+    delete[] fCornerPts;
+    delete[] fCornerColors;
+    delete[] fTexCoords;
+    delete[] fHrzCtrlPts;
+    delete[] fVrtCtrlPts;
 }
 
 bool SkPatchGrid::setPatch(int x, int y, const SkPoint cubics[12], const SkColor colors[4],
@@ -120,38 +120,38 @@ bool SkPatchGrid::getPatch(int x, int y, SkPoint cubics[12], SkColor colors[4],
 }
 
 void SkPatchGrid::reset(int rows, int cols, VertexType flags, SkXfermode* xMode) {
-    SkDELETE_ARRAY(fCornerPts);
-    SkDELETE_ARRAY(fCornerColors);
-    SkDELETE_ARRAY(fTexCoords);
-    SkDELETE_ARRAY(fHrzCtrlPts);
-    SkDELETE_ARRAY(fVrtCtrlPts);
-    
+    delete[] fCornerPts;
+    delete[] fCornerColors;
+    delete[] fTexCoords;
+    delete[] fHrzCtrlPts;
+    delete[] fVrtCtrlPts;
+
     fCols = cols;
     fRows = rows;
     fModeFlags = flags;
     fXferMode = xMode;
-    
-    fCornerPts = SkNEW_ARRAY(SkPoint, (fRows + 1) * (fCols + 1));
-    fHrzCtrlPts = SkNEW_ARRAY(SkPoint, (fRows + 1) * fCols * 2);
-    fVrtCtrlPts = SkNEW_ARRAY(SkPoint, fRows * 2 * (fCols + 1));
+
+    fCornerPts = new SkPoint[(fRows + 1) * (fCols + 1)];
+    fHrzCtrlPts = new SkPoint[(fRows + 1) * fCols * 2];
+    fVrtCtrlPts = new SkPoint[fRows * 2 * (fCols + 1)];
     memset(fCornerPts, 0, (fRows + 1) * (fCols + 1) * sizeof(SkPoint));
     memset(fHrzCtrlPts, 0, (fRows + 1) * fCols * 2 * sizeof(SkPoint));
     memset(fVrtCtrlPts, 0, fRows * 2 * (fCols + 1) * sizeof(SkPoint));
     
     if (fModeFlags & kColors_VertexType) {
-        fCornerColors = SkNEW_ARRAY(SkColor, (fRows + 1) * (fCols + 1));
+        fCornerColors = new SkColor[(fRows + 1) * (fCols + 1)];
         memset(fCornerColors, 0, (fRows + 1) * (fCols + 1) * sizeof(SkColor));
     }
     
     if (fModeFlags & kTexs_VertexType) {
-        fTexCoords = SkNEW_ARRAY(SkPoint, (fRows + 1) * (fCols + 1));
+        fTexCoords = new SkPoint[(fRows + 1) * (fCols + 1)];
         memset(fTexCoords, 0, (fRows + 1) * (fCols + 1) * sizeof(SkPoint));
     }
 }
 
 void SkPatchGrid::draw(SkCanvas* canvas, SkPaint& paint) {
-    int* maxCols = SkNEW_ARRAY(int, fCols);
-    int* maxRows = SkNEW_ARRAY(int, fRows);
+    int* maxCols = new int[fCols];
+    int* maxRows = new int[fRows];
     memset(maxCols, 0, fCols * sizeof(int));
     memset(maxRows, 0, fRows * sizeof(int));
     
@@ -184,6 +184,6 @@ void SkPatchGrid::draw(SkCanvas* canvas, SkPaint& paint) {
             }
         }
     }
-    SkDELETE_ARRAY(maxCols);
-    SkDELETE_ARRAY(maxRows);
+    delete[] maxCols;
+    delete[] maxRows;
 }
index 08fd438..e9ff906 100644 (file)
@@ -217,10 +217,10 @@ bool SkPatchUtils::getVertexData(SkPatchUtils::VertexData* data, const SkPoint c
         data->fVertexCount = (lodX + 1) * (lodY + 1);
     }
     data->fIndexCount = lodX * lodY * 6;
-    
-    data->fPoints = SkNEW_ARRAY(SkPoint, data->fVertexCount);
-    data->fIndices = SkNEW_ARRAY(uint16_t, data->fIndexCount);
-    
+
+    data->fPoints = new SkPoint[data->fVertexCount];
+    data->fIndices = new uint16_t[data->fIndexCount];
+
     // if colors is not null then create array for colors
     SkPMColor colorsPM[kNumCorners];
     if (colors) {
@@ -228,12 +228,12 @@ bool SkPatchUtils::getVertexData(SkPatchUtils::VertexData* data, const SkPoint c
         for (int i = 0; i < kNumCorners; i++) {
             colorsPM[i] = SkPreMultiplyColor(colors[i]);
         }
-        data->fColors = SkNEW_ARRAY(uint32_t, data->fVertexCount);
+        data->fColors = new uint32_t[data->fVertexCount];
     }
     
     // if texture coordinates are not null then create array for them
     if (texCoords) {
-        data->fTexCoords = SkNEW_ARRAY(SkPoint, data->fVertexCount);
+        data->fTexCoords = new SkPoint[data->fVertexCount];
     }
     
     SkPoint pts[kNumPtsCubic];
index 879053a..3560421 100644 (file)
@@ -35,10 +35,10 @@ public:
         , fIndices(NULL) { }
         
         ~VertexData() {
-            SkDELETE_ARRAY(fPoints);
-            SkDELETE_ARRAY(fTexCoords);
-            SkDELETE_ARRAY(fColors);
-            SkDELETE_ARRAY(fIndices);
+            delete[] fPoints;
+            delete[] fTexCoords;
+            delete[] fColors;
+            delete[] fIndices;
         }
     };
     
index 5c99d27..f441bf1 100644 (file)
@@ -46,8 +46,8 @@ SkRTConfRegistry::SkRTConfRegistry(): fConfs(100) {
             continue;
         }
 
-        SkString* key = SkNEW_ARGS(SkString,(keyptr));
-        SkString* val = SkNEW_ARGS(SkString,(valptr));
+        SkString *key = new SkString(keyptr);
+        SkString *val = new SkString(valptr);
 
         fConfigFileKeys.append(1, &key);
         fConfigFileValues.append(1, &val);
@@ -64,8 +64,8 @@ SkRTConfRegistry::~SkRTConfRegistry() {
     }
 
     for (int i = 0 ; i < fConfigFileKeys.count() ; i++) {
-        SkDELETE(fConfigFileKeys[i]);
-        SkDELETE(fConfigFileValues[i]);
+        delete fConfigFileKeys[i];
+        delete fConfigFileValues[i];
     }
 }
 
index 6251c1b..5ce9067 100644 (file)
@@ -58,12 +58,15 @@ public:
 
 class DebugPaintFilterCanvas : public SkPaintFilterCanvas {
 public:
-    DebugPaintFilterCanvas(int width, int height, bool overdrawViz, bool overrideFilterQuality,
+    DebugPaintFilterCanvas(int width,
+                           int height,
+                           bool overdrawViz,
+                           bool overrideFilterQuality,
                            SkFilterQuality quality)
         : INHERITED(width, height)
-        , fOverdrawXfermode(overdrawViz ? SkNEW(OverdrawXfermode) : NULL)
+        , fOverdrawXfermode(overdrawViz ? new OverdrawXfermode : NULL)
         , fOverrideFilterQuality(overrideFilterQuality)
-        , fFilterQuality(quality) { }
+        , fFilterQuality(quality) {}
 
 protected:
     void onFilterPaint(SkPaint* paint, Type) const override {
@@ -361,11 +364,8 @@ void SkDebugCanvas::updatePaintFilterCanvas() {
     }
 
     const SkImageInfo info = this->imageInfo();
-    fPaintFilterCanvas.reset(SkNEW_ARGS(DebugPaintFilterCanvas, (info.width(),
-                                                                 info.height(),
-                                                                 fOverdrawViz,
-                                                                 fOverrideFilterQuality,
-                                                                 fFilterQuality)));
+    fPaintFilterCanvas.reset(new DebugPaintFilterCanvas(info.width(), info.height(), fOverdrawViz,
+                                                        fOverrideFilterQuality, fFilterQuality));
 }
 
 void SkDebugCanvas::setOverdrawViz(bool overdrawViz) {
index 3807fad..cba8d06 100644 (file)
@@ -201,7 +201,7 @@ SkString* SkObjectParser::PathToString(const SkPath& path) {
 
     if (boundStr) {
         mPath->append(*boundStr);
-        SkDELETE(boundStr);
+        delete boundStr;
     }
 
     return mPath;
index 2688471..e62ced2 100644 (file)
@@ -20,7 +20,7 @@ static void delete_stream_proc(void* info, const void* addr, size_t size) {
     SkStream* stream = (SkStream*)info;
     SkASSERT(stream->getMemoryBase() == addr);
     SkASSERT(stream->getLength() == size);
-    SkDELETE(stream);
+    delete stream;
 }
 
 // These are used by CGDataProviderSequentialCallbacks
@@ -42,7 +42,7 @@ static void rewind_proc(void* info) {
 // Used when info is an SkStream.
 static void release_info_proc(void* info) {
     SkASSERT(info);
-    SkDELETE((SkStream*)info);
+    delete (SkStream*)info;
 }
 
 CGDataProviderRef SkCreateDataProviderFromStream(SkStream* stream) {
index a187601..eb7e5dc 100644 (file)
@@ -85,7 +85,7 @@ bool SkDWriteFontFileStream::rewind() {
 }
 
 SkDWriteFontFileStream* SkDWriteFontFileStream::duplicate() const {
-    return SkNEW_ARGS(SkDWriteFontFileStream, (fFontFileStream.get()));
+    return new SkDWriteFontFileStream(fFontFileStream.get());
 }
 
 size_t SkDWriteFontFileStream::getPosition() const {
index 5c46138..60f3cb3 100644 (file)
@@ -432,7 +432,7 @@ SkWGLPbufferContext* SkWGLPbufferContext::Create(HDC parentDC, int msaaSampleCou
                 if (dc) {
                     HGLRC glrc = create_gl_context(dc, extensions, contextType);
                     if (glrc) {
-                        return SkNEW_ARGS(SkWGLPbufferContext, (pbuf, dc, glrc));
+                        return new SkWGLPbufferContext(pbuf, dc, glrc);
                     }
                     extensions.releasePbufferDC(pbuf, dc);
                 }
index 42c1ceb..282f2b8 100644 (file)
@@ -148,7 +148,7 @@ void SkEventSink::addListenerID(SkEventSinkID id)
         count = prev->countListners();
     }
 
-    SkListenersTagList* next = SkNEW_ARGS(SkListenersTagList, (count + 1));
+    SkListenersTagList* next = new SkListenersTagList(count + 1);
 
     if (prev)
     {
@@ -209,7 +209,7 @@ void SkEventSink::postToListeners(const SkEvent& evt, SkMSec delay) {
         const SkEventSinkID* iter = list->fIDs;
         const SkEventSinkID* stop = iter + list->countListners();
         while (iter < stop) {
-            SkEvent* copy = SkNEW_ARGS(SkEvent, (evt));
+            SkEvent* copy = new SkEvent(evt);
             copy->setTargetID(*iter++)->postDelay(delay);
         }
     }
index eb1bc09..3bb0835 100644 (file)
@@ -366,7 +366,7 @@ const SkDOM::Node* SkDOM::copy(const SkDOM& dom, const SkDOM::Node* node)
 
 SkXMLParser* SkDOM::beginParsing() {
     SkASSERT(!fParser);
-    fParser.reset(SkNEW_ARGS(SkDOMParser, (&fAlloc)));
+    fParser.reset(new SkDOMParser(&fAlloc));
 
     return fParser.get();
 }
index 645340a..cde700e 100644 (file)
@@ -293,7 +293,7 @@ static bool gpu_blur_path(GrContextFactory* factory, const SkPath& path,
     desc.fSampleCnt = 0;
 
     SkAutoTUnref<GrTexture> texture(grContext->createTexture(desc, false, NULL, 0));
-    SkAutoTUnref<SkGpuDevice> device(SkNEW_ARGS(SkGpuDevice, (grContext, texture.get())));
+    SkAutoTUnref<SkGpuDevice> device(new SkGpuDevice  (grContext, texture.get()));
     SkCanvas canvas(device.get());
 
     blur_path(&canvas, path, gaussianSigma);
index f65a46b..e3ceeaf 100644 (file)
@@ -31,9 +31,9 @@ static SkCachedData* make_data(size_t size, SkDiscardableMemoryPool* pool) {
         SkDiscardableMemory* dm = pool->create(size);
         // the pool "can" return null, but it shouldn't in these controlled conditions
         SK_ALWAYSBREAK(dm);
-        return SkNEW_ARGS(SkCachedData, (size, dm));
+        return new SkCachedData(size, dm);
     } else {
-        return SkNEW_ARGS(SkCachedData, (sk_malloc_throw(size), size));
+        return new SkCachedData(sk_malloc_throw(size), size);
     }
 }
 
index c69cd96..721c090 100644 (file)
@@ -239,8 +239,7 @@ static void check_pixelref(TestImageGenerator::TestType type,
                            PixelRefType pixelRefType,
                            SkDiscardableMemory::Factory* factory) {
     SkASSERT((pixelRefType >= 0) && (pixelRefType <= kLast_PixelRefType));
-    SkAutoTDelete<SkImageGenerator> gen(SkNEW_ARGS(TestImageGenerator,
-                                                   (type, reporter)));
+    SkAutoTDelete<SkImageGenerator> gen(new TestImageGenerator(type, reporter));
     REPORTER_ASSERT(reporter, gen.get() != NULL);
     SkBitmap lazy;
     bool success;
@@ -317,7 +316,7 @@ DEF_TEST(Image_NewFromGenerator, r) {
     };
     for (size_t i = 0; i < SK_ARRAY_COUNT(testTypes); ++i) {
         TestImageGenerator::TestType test = testTypes[i];
-        SkImageGenerator* gen = SkNEW_ARGS(TestImageGenerator, (test, r));
+        SkImageGenerator* gen = new TestImageGenerator(test, r);
         SkAutoTUnref<SkImage> image(SkImage::NewFromGenerator(gen));
         if (NULL == image.get()) {
             ERRORF(r, "SkImage::NewFromGenerator unexpecedly failed ["
index c80e6be..f797635 100644 (file)
@@ -654,7 +654,7 @@ static void test_newraster(skiatest::Reporter* reporter) {
         }
         addr = (const SkPMColor*)((const char*)addr + rowBytes);
     }
-    SkDELETE(canvas);
+    delete canvas;
 
     // now try a deliberately bad info
     info = info.makeWH(-1, info.height());
@@ -672,7 +672,7 @@ static void test_newraster(skiatest::Reporter* reporter) {
     info = SkImageInfo::MakeN32Premul(0, 0);
     canvas = SkCanvas::NewRasterDirect(info, baseAddr, minRowBytes);
     REPORTER_ASSERT(reporter, canvas);
-    SkDELETE(canvas);
+    delete canvas;
 }
 
 DEF_TEST(Canvas, reporter) {
index 8f06a18..58600ef 100644 (file)
@@ -310,6 +310,6 @@ DEF_TEST(RWBuffer, reporter) {
         check_alphabet_buffer(reporter, readers[i]);
         check_alphabet_stream(reporter, streams[i]);
         readers[i]->unref();
-        SkDELETE(streams[i]);
+        delete streams[i];
     }
 }
index 52c7433..0b0c87c 100644 (file)
@@ -34,7 +34,7 @@ static void test_faulty_pixelref(skiatest::Reporter* reporter) {
     SkAutoTUnref<SkDiscardableMemoryPool> pool(
         SkDiscardableMemoryPool::Create(10 * 1000, NULL));
     SkBitmap bm;
-    bool success = SkInstallDiscardablePixelRef(SkNEW(FailureImageGenerator), NULL, &bm, pool);
+    bool success = SkInstallDiscardablePixelRef(new FailureImageGenerator, NULL, &bm, pool);
     REPORTER_ASSERT(reporter, success);
     // now our bitmap has a pixelref, but we know it will fail to lock
 
index 13ae5c6..de4672d 100644 (file)
@@ -28,8 +28,7 @@ static void test_saverestore(skiatest::Reporter* reporter) {
     SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(10, 10));
     SkCanvas* canvas = surface->getCanvas();
 
-
-    SkAutoTUnref<TestFilter> df(SkNEW(TestFilter));
+    SkAutoTUnref<TestFilter> df(new TestFilter);
 
     REPORTER_ASSERT(reporter, NULL == canvas->getDrawFilter());
 
index f3ef47d..0b161b9 100644 (file)
@@ -54,7 +54,7 @@ static void test_incremental_buffering(skiatest::Reporter* reporter, size_t buff
     // NOTE: For this and other tests in this file, we cheat and continue to refer to the
     // wrapped stream, but that's okay because we know the wrapping stream has not been
     // deleted yet (and we only call const methods in it).
-    SkMemoryStream* memStream = SkNEW_ARGS(SkMemoryStream, (gAbcs, strlen(gAbcs), false));
+    SkMemoryStream* memStream = new SkMemoryStream(gAbcs, strlen(gAbcs), false);
 
     SkAutoTDelete<SkStream> bufferedStream(SkFrontBufferedStream::Create(memStream, bufferSize));
     test_hasLength(reporter, *bufferedStream.get(), *memStream);
@@ -82,7 +82,7 @@ static void test_incremental_buffering(skiatest::Reporter* reporter, size_t buff
 }
 
 static void test_perfectly_sized_buffer(skiatest::Reporter* reporter, size_t bufferSize) {
-    SkMemoryStream* memStream = SkNEW_ARGS(SkMemoryStream, (gAbcs, strlen(gAbcs), false));
+    SkMemoryStream* memStream = new SkMemoryStream(gAbcs, strlen(gAbcs), false);
     SkAutoTDelete<SkStream> bufferedStream(SkFrontBufferedStream::Create(memStream, bufferSize));
     test_hasLength(reporter, *bufferedStream.get(), *memStream);
 
@@ -101,7 +101,7 @@ static void test_perfectly_sized_buffer(skiatest::Reporter* reporter, size_t buf
 }
 
 static void test_skipping(skiatest::Reporter* reporter, size_t bufferSize) {
-    SkMemoryStream* memStream = SkNEW_ARGS(SkMemoryStream, (gAbcs, strlen(gAbcs), false));
+    SkMemoryStream* memStream = new SkMemoryStream(gAbcs, strlen(gAbcs), false);
     SkAutoTDelete<SkStream> bufferedStream(SkFrontBufferedStream::Create(memStream, bufferSize));
     test_hasLength(reporter, *bufferedStream.get(), *memStream);
 
@@ -152,7 +152,8 @@ private:
 // does not invalidate the buffer.
 static void test_read_beyond_buffer(skiatest::Reporter* reporter, size_t bufferSize) {
     // Use a stream that behaves like Android's stream.
-    AndroidLikeMemoryStream* memStream = SkNEW_ARGS(AndroidLikeMemoryStream, ((void*)gAbcs, bufferSize, false));
+    AndroidLikeMemoryStream* memStream =
+            new AndroidLikeMemoryStream((void*)gAbcs, bufferSize, false);
 
     // Create a buffer that matches the length of the stream.
     SkAutoTDelete<SkStream> bufferedStream(SkFrontBufferedStream::Create(memStream, bufferSize));
@@ -200,7 +201,8 @@ private:
 static void test_length_combos(skiatest::Reporter* reporter, size_t bufferSize) {
     for (int hasLen = 0; hasLen <= 1; hasLen++) {
         for (int hasPos = 0; hasPos <= 1; hasPos++) {
-            LengthOptionalStream* stream = SkNEW_ARGS(LengthOptionalStream, (SkToBool(hasLen), SkToBool(hasPos)));
+            LengthOptionalStream* stream =
+                    new LengthOptionalStream(SkToBool(hasLen), SkToBool(hasPos));
             SkAutoTDelete<SkStream> buffered(SkFrontBufferedStream::Create(stream, bufferSize));
             test_hasLength(reporter, *buffered.get(), *stream);
         }
@@ -209,7 +211,7 @@ static void test_length_combos(skiatest::Reporter* reporter, size_t bufferSize)
 
 // Test using a stream with an initial offset.
 static void test_initial_offset(skiatest::Reporter* reporter, size_t bufferSize) {
-    SkMemoryStream* memStream = SkNEW_ARGS(SkMemoryStream, (gAbcs, strlen(gAbcs), false));
+    SkMemoryStream* memStream = new SkMemoryStream(gAbcs, strlen(gAbcs), false);
 
     // Skip a few characters into the memStream, so that bufferedStream represents an offset into
     // the stream it wraps.
@@ -286,7 +288,7 @@ private:
 };
 
 DEF_TEST(ShortFrontBufferedStream, reporter) {
-    FailingStream* failingStream = SkNEW(FailingStream);
+    FailingStream* failingStream = new FailingStream;
     SkAutoTDelete<SkStreamRewindable> stream(SkFrontBufferedStream::Create(failingStream, 64));
     SkBitmap bm;
     // The return value of DecodeStream is not important. We are just using DecodeStream because
index 16745e5..4b3bcdf 100644 (file)
@@ -69,7 +69,7 @@ public:
     const char* name() const override { return "Big Ole Key"; }
 
     GrGLFragmentProcessor* onCreateGLInstance() const override {
-        return SkNEW_ARGS(GLBigKeyProcessor, (*this));
+        return new GLBigKeyProcessor(*this);
     }
 
 private:
index e2efe97..98fb4ef 100644 (file)
@@ -50,7 +50,7 @@ static void test_cache(skiatest::Reporter* reporter, SkResourceCache& cache, boo
         REPORTER_ASSERT(reporter, !cache.find(key, TestingRec::Visitor, &value));
         REPORTER_ASSERT(reporter, -1 == value);
 
-        cache.add(SkNEW_ARGS(TestingRec, (key, i)));
+        cache.add(new TestingRec(key, i));
 
         REPORTER_ASSERT(reporter, cache.find(key, TestingRec::Visitor, &value));
         REPORTER_ASSERT(reporter, i == value);
@@ -60,7 +60,7 @@ static void test_cache(skiatest::Reporter* reporter, SkResourceCache& cache, boo
         // stress test, should trigger purges
         for (int i = 0; i < COUNT * 100; ++i) {
             TestingKey key(i);
-            cache.add(SkNEW_ARGS(TestingRec, (key, i)));
+            cache.add(new TestingRec(key, i));
         }
     }
 
@@ -75,8 +75,8 @@ static void test_cache(skiatest::Reporter* reporter, SkResourceCache& cache, boo
 
 static void test_cache_purge_shared_id(skiatest::Reporter* reporter, SkResourceCache& cache) {
     for (int i = 0; i < COUNT; ++i) {
-        TestingKey key(i, i & 1);   // every other key will have a 1 for its sharedID        
-        cache.add(SkNEW_ARGS(TestingRec, (key, i)));
+        TestingKey key(i, i & 1);   // every other key will have a 1 for its sharedID
+        cache.add(new TestingRec(key, i));
     }
 
     // Ensure that everyone is present
@@ -143,8 +143,8 @@ DEF_TEST(ImageCache_doubleAdd, r) {
 
     TestingKey key(1);
 
-    cache.add(SkNEW_ARGS(TestingRec, (key, 2)));
-    cache.add(SkNEW_ARGS(TestingRec, (key, 3)));
+    cache.add(new TestingRec(key, 2));
+    cache.add(new TestingRec(key, 3));
 
     // Lookup can return either value.
     intptr_t value = -1;
index 1348ded..971c3e7 100644 (file)
@@ -742,8 +742,7 @@ DEF_TEST(ImageDecoding_JpegOverwrite, r) {
     pixels[pixelCount] = sentinal;  // This value should not be changed.
 
     SkAutoTUnref<SingleAllocator> allocator(
-            SkNEW_ARGS(SingleAllocator,
-                       ((void*)pixels.get(), sizeof(uint16_t) * pixelCount)));
+            new SingleAllocator((void*)pixels.get(), sizeof(uint16_t) * pixelCount));
     decoder->setAllocator(allocator);
     decoder->setSampleSize(2);
     SkBitmap bitmap;
index c15d719..f2aa0e9 100644 (file)
@@ -80,7 +80,7 @@ SkFlattenable* MatrixTestImageFilter::CreateProc(SkReadBuffer& buffer) {
     skiatest::Reporter* reporter = (skiatest::Reporter*)buffer.readFunctionPtr();
     SkMatrix matrix;
     buffer.readMatrix(&matrix);
-    return SkNEW_ARGS(MatrixTestImageFilter, (reporter, matrix));
+    return new MatrixTestImageFilter(reporter, matrix);
 }
 
 #ifndef SK_IGNORE_TO_STRING
index 1c173da..de945f9 100644 (file)
@@ -109,7 +109,7 @@ DEF_TEST(Image_NewRasterCopy, reporter) {
     const SkPMColor green = SkPackARGB32(0xFF, 0, 0xFF, 0);
     const SkPMColor blue =  SkPackARGB32(0xFF, 0, 0, 0xFF);
     SkPMColor colors[] = { red, green, blue, 0 };
-    SkAutoTUnref<SkColorTable> ctable(SkNEW_ARGS(SkColorTable, (colors, SK_ARRAY_COUNT(colors))));
+    SkAutoTUnref<SkColorTable> ctable(new SkColorTable(colors, SK_ARRAY_COUNT(colors)));
     // The colortable made a copy, so we can trash the original colors
     memset(colors, 0xFF, sizeof(colors));
 
index 8828926..1153a36 100644 (file)
@@ -456,7 +456,7 @@ DEF_TEST(Jpeg, reporter) {
 
 DEF_TEST(Jpeg_YUV, reporter) {
     size_t len = sizeof(goodJpegImage);
-    SkMemoryStream* stream = SkNEW_ARGS(SkMemoryStream, (goodJpegImage, len));
+    SkMemoryStream* stream = new SkMemoryStream(goodJpegImage, len);
 
     SkBitmap bitmap;
     SkDecodingImageGenerator::Options opts;
index 53caabd..eb36d64 100644 (file)
@@ -55,7 +55,7 @@ DEF_TEST(KtxReadWrite, reporter) {
     SkAutoDataUnref encodedData(SkImageEncoder::EncodeData(bm8888, SkImageEncoder::kKTX_Type, 0));
     REPORTER_ASSERT(reporter, encodedData);
 
-    SkAutoTDelete<SkMemoryStream> stream(SkNEW_ARGS(SkMemoryStream, (encodedData)));
+    SkAutoTDelete<SkMemoryStream> stream(new SkMemoryStream(encodedData));
     REPORTER_ASSERT(reporter, stream);
 
     SkBitmap decodedBitmap;
@@ -107,8 +107,7 @@ DEF_TEST(KtxReadUnpremul, reporter) {
         0xFF, 0xFF, 0xFF, 0x80, // Pixel 3
         0xFF, 0xFF, 0xFF, 0x80};// Pixel 4
 
-    SkAutoTDelete<SkMemoryStream> stream(
-        SkNEW_ARGS(SkMemoryStream, (kHalfWhiteKTX, sizeof(kHalfWhiteKTX))));
+    SkAutoTDelete<SkMemoryStream> stream(new SkMemoryStream(kHalfWhiteKTX, sizeof(kHalfWhiteKTX)));
     REPORTER_ASSERT(reporter, stream);
 
     SkBitmap decodedBitmap;
index b4edc14..82060b0 100644 (file)
@@ -43,15 +43,13 @@ private:
 
 int DummyRasterizer::gCount;
 
-SkFlattenable* DummyRasterizer::CreateProc(SkReadBuffer&) {
-    return SkNEW(DummyRasterizer);
-}
+SkFlattenable* DummyRasterizer::CreateProc(SkReadBuffer&) { return new DummyRasterizer; }
 
 // Check to make sure that the SkPaint in the layer has its destructor called.
 DEF_TEST(LayerRasterizer_destructor, reporter) {
     {
         SkPaint paint;
-        paint.setRasterizer(SkNEW(DummyRasterizer))->unref();
+        paint.setRasterizer(new DummyRasterizer)->unref();
         REPORTER_ASSERT(reporter, DummyRasterizer::GetCount() == 1);
 
         SkLayerRasterizer::Builder builder;
index 89443f9..c6ffd72 100644 (file)
@@ -14,7 +14,7 @@ namespace {
 
 struct CreateIntFromFloat {
     CreateIntFromFloat(float val) : fVal(val) {}
-    int* operator()() const { return SkNEW_ARGS(int, ((int)fVal)); }
+    int* operator()() const { return new int((int)fVal); }
     float fVal;
 };
 
@@ -24,7 +24,7 @@ void custom_destroy(int* ptr) { *ptr = 99; }
 } // namespace
 
 DEF_TEST(LazyPtr, r) {
-    // Basic usage: calls SkNEW(int).
+    // Basic usage: calls new int.
     SkLazyPtr<int> lazy;
     int* ptr = lazy.get();
     REPORTER_ASSERT(r, ptr);
@@ -48,7 +48,7 @@ DEF_TEST(LazyPtr, r) {
     REPORTER_ASSERT(r, ptr);
     REPORTER_ASSERT(r, 99 == *ptr);
     // Since custom_destroy didn't actually delete ptr, we do now.
-    SkDELETE(ptr);
+    delete ptr;
 }
 
 DEF_TEST(LazyPtr_Threaded, r) {
index 8a9b1fa..57e51f0 100644 (file)
@@ -32,7 +32,7 @@ private:
 SkBitmap make_invalid_bitmap(const SkImageInfo& imageInfo) {
     SkBitmap bitmap;
     bitmap.setInfo(imageInfo);
-    bitmap.setPixelRef(SkNEW_ARGS(InvalidPixelRef, (imageInfo)))->unref();
+    bitmap.setPixelRef(new InvalidPixelRef(imageInfo))->unref();
     return bitmap;
 }
 
index 1d35c08..8af806c 100644 (file)
@@ -384,7 +384,7 @@ private:
 SkFlattenable* DummyImageFilter::CreateProc(SkReadBuffer& buffer) {
     SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 0);
     bool visited = buffer.readBool();
-    return SkNEW_ARGS(DummyImageFilter, (visited));
+    return new DummyImageFilter(visited);
 }
 
 #ifndef SK_IGNORE_TO_STRING
index 0bb75cc..30b1603 100644 (file)
@@ -70,8 +70,8 @@ DEF_TEST(PathOpsOpCircleThreaded, reporter) {
         for (int b = a + 1; b < 7; ++b) {
             for (int c = 0 ; c < 6; ++c) {
                 for (int d = 0; d < 2; ++d) {
-                    *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable,
-                            (&testOpCirclesMain, a, b, c, d, &testRunner));
+                    *testRunner.fRunnables.append() = new PathOpsThreadedRunnable(
+                            &testOpCirclesMain, a, b, c, d, &testRunner);
                 }
             }
             if (!reporter->allowExtendedTest()) goto finish;
index 12eb71b..991d4e7 100644 (file)
@@ -87,8 +87,8 @@ DEF_TEST(PathOpsOpCubicsThreaded, reporter) {
         for (int b = a + 1; b < 7; ++b) {
             for (int c = 0 ; c < 6; ++c) {
                 for (int d = c + 1; d < 7; ++d) {
-                    *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable,
-                            (&testOpCubicsMain, a, b, c, d, &testRunner));
+                    *testRunner.fRunnables.append() =
+                            new PathOpsThreadedRunnable(&testOpCubicsMain, a, b, c, d, &testRunner);
                 }
             }
             if (!reporter->allowExtendedTest()) goto finish;
old mode 100755 (executable)
new mode 100644 (file)
index 3f6d081..7b4b7ce
@@ -99,8 +99,8 @@ DEF_TEST(PathOpsOpLoopsThreaded, reporter) {
         for (int b = a + 1; b < 7; ++b) {
             for (int c = 0 ; c < 6; ++c) {
                 for (int d = c + 1; d < 7; ++d) {
-                    *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable,
-                            (&testOpLoopsMain, a, b, c, d, &testRunner));
+                    *testRunner.fRunnables.append() =
+                            new PathOpsThreadedRunnable(&testOpLoopsMain, a, b, c, d, &testRunner);
                 }
             }
             if (!reporter->allowExtendedTest()) goto finish;
index 9195e4a..4d672e4 100644 (file)
@@ -88,8 +88,8 @@ DEF_TEST(PathOpsRectsThreaded, reporter) {
         for (int b = a + 1; b < 7; ++b) {
             for (int c = 0 ; c < 6; ++c) {
                 for (int d = c + 1; d < 7; ++d) {
-                    *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable,
-                            (&testPathOpsRectsMain, a, b, c, d, &testRunner));
+                    *testRunner.fRunnables.append() = new PathOpsThreadedRunnable(
+                            &testPathOpsRectsMain, a, b, c, d, &testRunner);
                 }
             }
             if (!reporter->allowExtendedTest()) goto finish;
index a4f87df..9ecc1f0 100644 (file)
@@ -116,8 +116,8 @@ DEF_TEST(PathOpsQuadLineIntersectionThreaded, reporter) {
     for (int a = 0; a < 16; ++a) {
         for (int b = 0 ; b < 16; ++b) {
             for (int c = 0 ; c < 16; ++c) {
-                    *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable,
-                            (&testQuadLineIntersectMain, a, b, c, 0, &testRunner));
+                *testRunner.fRunnables.append() = new PathOpsThreadedRunnable(
+                        &testQuadLineIntersectMain, a, b, c, 0, &testRunner);
             }
             if (!reporter->allowExtendedTest()) goto finish;
         }
old mode 100755 (executable)
new mode 100644 (file)
index 8e8c58b..99a54d8
@@ -80,9 +80,8 @@ DEF_TEST(PathOpsSimplifyDegeneratesThreaded, reporter) {
                 int cx = c & 0x03;
                 int cy = c >> 2;
                 bool abcIsATriangle = (bx - ax) * (cy - ay) != (by - ay) * (cx - ax);
-                *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable,
-                        (&testSimplifyDegeneratesMain, a, b, c, abcIsATriangle,
-                        &testRunner));
+                *testRunner.fRunnables.append() = new PathOpsThreadedRunnable(
+                        &testSimplifyDegeneratesMain, a, b, c, abcIsATriangle, &testRunner);
             }
             if (!reporter->allowExtendedTest()) goto finish;
         }
index e3c0bc2..8ab84d7 100644 (file)
@@ -86,8 +86,8 @@ DEF_TEST(PathOpsSimplifyQuadsThreaded, reporter) {
         for (int b = a ; b < 16; ++b) {
             for (int c = b ; c < 16; ++c) {
                 for (int d = c; d < 16; ++d) {
-                    *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable,
-                            (&testSimplifyQuadsMain, a, b, c, d, &testRunner));
+                    *testRunner.fRunnables.append() = new PathOpsThreadedRunnable(
+                            &testSimplifyQuadsMain, a, b, c, d, &testRunner);
                 }
                 if (!reporter->allowExtendedTest()) goto finish;
             }
old mode 100755 (executable)
new mode 100644 (file)
index f8e9a6e..f2c1dfc
@@ -82,8 +82,8 @@ DEF_TEST(PathOpsSimplifyQuadralateralsThreaded, reporter) {
         for (int b = a ; b < 16; ++b) {
             for (int c = b ; c < 16; ++c) {
                 for (int d = c; d < 16; ++d) {
-                    *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable,
-                            (&testSimplifyQuadralateralsMain, a, b, c, d, &testRunner));
+                    *testRunner.fRunnables.append() = new PathOpsThreadedRunnable(
+                            &testSimplifyQuadralateralsMain, a, b, c, d, &testRunner);
                 }
                 if (!reporter->allowExtendedTest()) goto finish;
             }
index 52a78ec..8c4e03c 100644 (file)
@@ -193,8 +193,8 @@ DEF_TEST(PathOpsSimplifyRectsThreaded, reporter) {
         for (int b = a ; b < 8; ++b) {
             for (int c = b ; c < 8; ++c) {
                 for (int d = c; d < 8; ++d) {
-                        *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable,
-                                (&testSimplify4x4RectsMain, a, b, c, d, &testRunner));
+                    *testRunner.fRunnables.append() = new PathOpsThreadedRunnable(
+                            &testSimplify4x4RectsMain, a, b, c, d, &testRunner);
                 }
                 if (!reporter->allowExtendedTest()) goto finish;
             }
old mode 100755 (executable)
new mode 100644 (file)
index ee0ca2b..8d8feee
@@ -90,8 +90,8 @@ DEF_TEST(PathOpsSimplifyTrianglesThreaded, reporter) {
                 if ((bx - ax) * (cy - ay) == (by - ay) * (cx - ax)) {
                     continue;
                 }
-                *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable,
-                        (&testSimplifyTrianglesMain, a, b, c, 0, &testRunner));
+                *testRunner.fRunnables.append() = new PathOpsThreadedRunnable(
+                        &testSimplifyTrianglesMain, a, b, c, 0, &testRunner);
             }
             if (!reporter->allowExtendedTest()) goto finish;
         }
old mode 100755 (executable)
new mode 100644 (file)
index 95421fc..de4f48c
@@ -300,7 +300,7 @@ public:
 
 TestRunner::~TestRunner() {
     for (int index = 0; index < fRunnables.count(); index++) {
-        SkDELETE(fRunnables[index]);
+        delete fRunnables[index];
     }
 }
 
@@ -799,8 +799,8 @@ static void encodeFound(TestState& state) {
         if (!filename.endsWith(".skp")) {
             filename.append(".skp");
         }
-        *testRunner.fRunnables.append() = SkNEW_ARGS(TestRunnableEncode,
-                (&testSkpClipEncode, result.fDirNo, filename.c_str(), &testRunner));
+        *testRunner.fRunnables.append() = new TestRunnableEncode(&testSkpClipEncode, result.fDirNo,
+                                                                 filename.c_str(), &testRunner);
     }
     testRunner.render();
 }
@@ -823,18 +823,17 @@ private:
 
 typedef SkTRegistry<Test*(*)(void*)> TestRegistry;
 
-#define DEF_TEST(name)                                        \
-    static void test_##name();                       \
-    class name##Class : public Test {                                   \
-    public:                                                             \
-        static Test* Factory(void*) { return SkNEW(name##Class); }      \
-    protected:                                                          \
-        void onGetName(SkString* name) override {            \
-            name->set(#name);                                           \
-        }                                                               \
-        void onRun() override { test_##name(); } \
-    };                                                                  \
-    static TestRegistry gReg_##name##Class(name##Class::Factory);       \
+#define DEF_TEST(name)                                                \
+    static void test_##name();                                        \
+    class name##Class : public Test {                                 \
+    public:                                                           \
+        static Test* Factory(void*) { return new name##Class; }       \
+                                                                      \
+    protected:                                                        \
+        void onGetName(SkString* name) override { name->set(#name); } \
+        void onRun() override { test_##name(); }                      \
+    };                                                                \
+    static TestRegistry gReg_##name##Class(name##Class::Factory);     \
     static void test_##name()
 
 DEF_TEST(PathOpsSkpClip) {
@@ -868,8 +867,7 @@ DEF_TEST(PathOpsSkpClipThreaded) {
     int dirNo;
     gDirs.reset();
     while ((dirNo = gDirs.next()) > 0) {
-        *testRunner.fRunnables.append() = SkNEW_ARGS(TestRunnableDir,
-                (&testSkpClipMain, dirNo, &testRunner));
+        *testRunner.fRunnables.append() = new TestRunnableDir(&testSkpClipMain, dirNo, &testRunner);
     }
     testRunner.render();
     TestState state;
@@ -934,8 +932,8 @@ DEF_TEST(PathOpsSkpClipUberThreaded) {
                 int count = sorted.get()[dirNo - firstDirNo].count();
                 if (SkTSearch<SortByName, Less>(sorted.get()[dirNo - firstDirNo].begin(),
                         count, &name, sizeof(&name)) < 0) {
-                    *testRunner.fRunnables.append() = SkNEW_ARGS(TestRunnableFile,
-                            (&testSkpClip, dirNo, filename.c_str(), &testRunner));
+                    *testRunner.fRunnables.append() = new TestRunnableFile(
+                            &testSkpClip, dirNo, filename.c_str(), &testRunner);
                 }
             }
     checkEarlyExit:
index 10501d1..342b560 100644 (file)
@@ -11,7 +11,7 @@
 
 PathOpsThreadedTestRunner::~PathOpsThreadedTestRunner() {
     for (int index = 0; index < fRunnables.count(); index++) {
-        SkDELETE(fRunnables[index]);
+        delete fRunnables[index];
     }
 }
 
index d50c26a..9537561 100644 (file)
@@ -39,8 +39,8 @@ DEF_TEST(PathOpsTightBoundsLines, reporter) {
     int outerCount = reporter->allowExtendedTest() ? 100 : 1;
     for (int index = 0; index < outerCount; ++index) {
         for (int idx2 = 0; idx2 < 10; ++idx2) {
-            *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable,
-                    (&testTightBoundsLines, 0, 0, 0, 0, &testRunner));
+            *testRunner.fRunnables.append() =
+                    new PathOpsThreadedRunnable(&testTightBoundsLines, 0, 0, 0, 0, &testRunner);
         }
     }
     testRunner.render();
@@ -114,8 +114,8 @@ DEF_TEST(PathOpsTightBoundsQuads, reporter) {
     int outerCount = reporter->allowExtendedTest() ? 100 : 1;
     for (int index = 0; index < outerCount; ++index) {
         for (int idx2 = 0; idx2 < 10; ++idx2) {
-            *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable,
-                    (&testTightBoundsQuads, 0, 0, 0, 0, &testRunner));
+            *testRunner.fRunnables.append() =
+                    new PathOpsThreadedRunnable(&testTightBoundsQuads, 0, 0, 0, 0, &testRunner);
         }
     }
     testRunner.render();
index b0bd667..68eb677 100644 (file)
@@ -3577,7 +3577,7 @@ public:
     static void TestPathRef(skiatest::Reporter* reporter) {
         static const int kRepeatCnt = 10;
 
-        SkAutoTUnref<SkPathRef> pathRef(SkNEW(SkPathRef));
+        SkAutoTUnref<SkPathRef> pathRef(new SkPathRef);
 
         SkPathRef::Editor ed(&pathRef);
 
@@ -3758,19 +3758,19 @@ public:
 
         // Check that listener is notified on moveTo().
 
-        SkPathPriv::AddGenIDChangeListener(p, SkNEW(ChangeListener(&changed)));
+        SkPathPriv::AddGenIDChangeListener(p, new ChangeListener(&changed));
         REPORTER_ASSERT(reporter, !changed);
         p.moveTo(10, 0);
         REPORTER_ASSERT(reporter, changed);
 
         // Check that listener is notified on lineTo().
-        SkPathPriv::AddGenIDChangeListener(p, SkNEW(ChangeListener(&changed)));
+        SkPathPriv::AddGenIDChangeListener(p, new ChangeListener(&changed));
         REPORTER_ASSERT(reporter, !changed);
         p.lineTo(20, 0);
         REPORTER_ASSERT(reporter, changed);
 
         // Check that listener is notified on reset().
-        SkPathPriv::AddGenIDChangeListener(p, SkNEW(ChangeListener(&changed)));
+        SkPathPriv::AddGenIDChangeListener(p, new ChangeListener(&changed));
         REPORTER_ASSERT(reporter, !changed);
         p.reset();
         REPORTER_ASSERT(reporter, changed);
@@ -3778,7 +3778,7 @@ public:
         p.moveTo(0, 0);
 
         // Check that listener is notified on rewind().
-        SkPathPriv::AddGenIDChangeListener(p, SkNEW(ChangeListener(&changed)));
+        SkPathPriv::AddGenIDChangeListener(p, new ChangeListener(&changed));
         REPORTER_ASSERT(reporter, !changed);
         p.rewind();
         REPORTER_ASSERT(reporter, changed);
@@ -3787,7 +3787,7 @@ public:
         {
             SkPath q;
             q.moveTo(10, 10);
-            SkPathPriv::AddGenIDChangeListener(q, SkNEW(ChangeListener(&changed)));
+            SkPathPriv::AddGenIDChangeListener(q, new ChangeListener(&changed));
             REPORTER_ASSERT(reporter, !changed);
         }
         // q went out of scope.
index 8a6e8e3..775354c 100644 (file)
@@ -73,7 +73,7 @@ DEF_TEST(PixelRef_GenIDChange, r) {
 
     // Register a listener.
     int count = 0;
-    pixelRef->addGenIDChangeListener(SkNEW_ARGS(TestListener, (&count)));
+    pixelRef->addGenIDChangeListener(new TestListener(&count));
     REPORTER_ASSERT(r, 0 == count);
 
     // No one has looked at our pixelRef's generation ID, so invalidating it doesn't make sense.
@@ -90,7 +90,7 @@ DEF_TEST(PixelRef_GenIDChange, r) {
 
     // Force the generation ID to be recalculated, then add a listener.
     REPORTER_ASSERT(r, 0 != pixelRef->getGenerationID());
-    pixelRef->addGenIDChangeListener(SkNEW_ARGS(TestListener, (&count)));
+    pixelRef->addGenIDChangeListener(new TestListener(&count));
     pixelRef->notifyPixelsChanged();
     REPORTER_ASSERT(r, 1 == count);
 
index e5dea24..c17aae9 100644 (file)
@@ -17,7 +17,7 @@ class TestLooper : public SkDrawLooper {
 public:
 
     SkDrawLooper::Context* createContext(SkCanvas*, void* storage) const override {
-        return SkNEW_PLACEMENT(storage, TestDrawLooperContext);
+        return new (storage) TestDrawLooperContext;
     }
 
     size_t contextSize() const override { return sizeof(TestDrawLooperContext); }
@@ -49,7 +49,7 @@ private:
     };
 };
 
-SkFlattenable* TestLooper::CreateProc(SkReadBuffer&) { return SkNEW(TestLooper); }
+SkFlattenable* TestLooper::CreateProc(SkReadBuffer&) { return new TestLooper; }
 
 static void test_drawBitmap(skiatest::Reporter* reporter) {
     SkBitmap src;
index b510da7..cf8c602 100644 (file)
@@ -51,7 +51,7 @@ struct Stretch {
     }
 };
 
-#define APPEND(record, type, ...) SkNEW_PLACEMENT_ARGS(record.append<type>(), type, (__VA_ARGS__))
+#define APPEND(record, type, ...) new (record.append<type>()) type(__VA_ARGS__)
 
 // Basic tests for the low-level SkRecord code.
 DEF_TEST(Record, r) {
index d5ee845..dff96f9 100644 (file)
@@ -261,7 +261,7 @@ public:
     }
 
     static TestResource* CreateScratch(GrGpu* gpu, SimulatedProperty property, bool cached = true) {
-        return SkNEW_ARGS(TestResource, (gpu, property, cached, kScratchConstructor));
+        return new TestResource(gpu, property, cached, kScratchConstructor);
     }
 
     ~TestResource() {
@@ -342,10 +342,10 @@ static void test_no_key(skiatest::Reporter* reporter) {
     GrResourceCache* cache = mock.cache();
 
     // Create a bunch of resources with no keys
-    TestResource* a = SkNEW_ARGS(TestResource, (context->getGpu()));
-    TestResource* b = SkNEW_ARGS(TestResource, (context->getGpu()));
-    TestResource* c = SkNEW_ARGS(TestResource, (context->getGpu()));
-    TestResource* d = SkNEW_ARGS(TestResource, (context->getGpu()));
+    TestResource* a = new TestResource(context->getGpu());
+    TestResource* b = new TestResource(context->getGpu());
+    TestResource* c = new TestResource(context->getGpu());
+    TestResource* d = new TestResource(context->getGpu());
     a->setSize(11);
     b->setSize(12);
     c->setSize(13);
@@ -404,14 +404,13 @@ static void test_budgeting(skiatest::Reporter* reporter) {
     TestResource* scratch =
             TestResource::CreateScratch(context->getGpu(), TestResource::kB_SimulatedProperty);
     scratch->setSize(10);
-    TestResource* unique = SkNEW_ARGS(TestResource, (context->getGpu()));
+    TestResource* unique = new TestResource(context->getGpu());
     unique->setSize(11);
     unique->resourcePriv().setUniqueKey(uniqueKey);
-    TestResource* wrapped = SkNEW_ARGS(TestResource,
-                                       (context->getGpu(), GrGpuResource::kBorrowed_LifeCycle));
+    TestResource* wrapped = new TestResource(context->getGpu(), GrGpuResource::kBorrowed_LifeCycle);
     wrapped->setSize(12);
-    TestResource* unbudgeted = SkNEW_ARGS(TestResource,
-                                          (context->getGpu(), GrGpuResource::kUncached_LifeCycle));
+    TestResource* unbudgeted =
+            new TestResource(context->getGpu(), GrGpuResource::kUncached_LifeCycle);
     unbudgeted->setSize(13);
 
     // Make sure we can't add a unique key to the wrapped resource
@@ -446,7 +445,7 @@ static void test_budgeting(skiatest::Reporter* reporter) {
                               unbudgeted->gpuMemorySize() == cache->getResourceBytes());
 
     // Now try freeing the budgeted resources first
-    wrapped = SkNEW_ARGS(TestResource, (context->getGpu(), GrGpuResource::kBorrowed_LifeCycle));
+    wrapped = new TestResource(context->getGpu(), GrGpuResource::kBorrowed_LifeCycle);
     scratch->setSize(12);
     unique->unref();
     cache->purgeAllUnlocked();
@@ -499,7 +498,7 @@ static void test_unbudgeted(skiatest::Reporter* reporter) {
     REPORTER_ASSERT(reporter, 1 == cache->getBudgetedResourceCount());
     REPORTER_ASSERT(reporter, 10 == cache->getBudgetedResourceBytes());
 
-    unique = SkNEW_ARGS(TestResource, (context->getGpu()));
+    unique = new TestResource(context->getGpu());
     unique->setSize(11);
     unique->resourcePriv().setUniqueKey(uniqueKey);
     unique->unref();
@@ -509,8 +508,7 @@ static void test_unbudgeted(skiatest::Reporter* reporter) {
     REPORTER_ASSERT(reporter, 21 == cache->getBudgetedResourceBytes());
 
     size_t large = 2 * cache->getResourceBytes();
-    unbudgeted = SkNEW_ARGS(TestResource,
-                            (context->getGpu(), large, GrGpuResource::kUncached_LifeCycle));
+    unbudgeted = new TestResource(context->getGpu(), large, GrGpuResource::kUncached_LifeCycle);
     REPORTER_ASSERT(reporter, 3 == cache->getResourceCount());
     REPORTER_ASSERT(reporter, 21 + large == cache->getResourceBytes());
     REPORTER_ASSERT(reporter, 2 == cache->getBudgetedResourceCount());
@@ -522,8 +520,7 @@ static void test_unbudgeted(skiatest::Reporter* reporter) {
     REPORTER_ASSERT(reporter, 2 == cache->getBudgetedResourceCount());
     REPORTER_ASSERT(reporter, 21 == cache->getBudgetedResourceBytes());
 
-    wrapped = SkNEW_ARGS(TestResource,
-                         (context->getGpu(), large, GrGpuResource::kBorrowed_LifeCycle));
+    wrapped = new TestResource(context->getGpu(), large, GrGpuResource::kBorrowed_LifeCycle);
     REPORTER_ASSERT(reporter, 3 == cache->getResourceCount());
     REPORTER_ASSERT(reporter, 21 + large == cache->getResourceBytes());
     REPORTER_ASSERT(reporter, 2 == cache->getBudgetedResourceCount());
@@ -775,7 +772,7 @@ static void test_duplicate_unique_key(skiatest::Reporter* reporter) {
     make_unique_key<0>(&key, 0);
     
     // Create two resources that we will attempt to register with the same unique key.
-    TestResource* a = SkNEW_ARGS(TestResource, (context->getGpu()));
+    TestResource* a = new TestResource(context->getGpu());
     a->setSize(11);
     
     // Set key on resource a.
@@ -792,7 +789,7 @@ static void test_duplicate_unique_key(skiatest::Reporter* reporter) {
     REPORTER_ASSERT(reporter, 1 == TestResource::NumAlive());
 
     // Create resource b and set the same key. It should replace a's unique key cache entry.
-    TestResource* b = SkNEW_ARGS(TestResource, (context->getGpu()));
+    TestResource* b = new TestResource(context->getGpu());
     b->setSize(12);
     b->resourcePriv().setUniqueKey(key);
     REPORTER_ASSERT(reporter, b == cache->findAndRefUniqueResource(key));
@@ -812,7 +809,7 @@ static void test_duplicate_unique_key(skiatest::Reporter* reporter) {
     // Now replace b with c, but make sure c can start with one unique key and change it to b's key.
     // Also make b be unreffed when replacement occurs.
     b->unref();
-    TestResource* c = SkNEW_ARGS(TestResource, (context->getGpu()));
+    TestResource* c = new TestResource(context->getGpu());
     GrUniqueKey differentKey;
     make_unique_key<0>(&differentKey, 1);
     c->setSize(13);
@@ -849,7 +846,7 @@ static void test_duplicate_unique_key(skiatest::Reporter* reporter) {
     {
         GrUniqueKey key2;
         make_unique_key<0>(&key2, 0);
-        SkAutoTUnref<TestResource> d(SkNEW_ARGS(TestResource, (context->getGpu())));
+        SkAutoTUnref<TestResource> d(new TestResource(context->getGpu()));
         int foo = 4132;
         SkAutoTUnref<SkData> data(SkData::NewWithCopy(&foo, sizeof(foo)));
         key2.setCustomData(data.get());
@@ -873,8 +870,8 @@ static void test_purge_invalidated(skiatest::Reporter* reporter) {
     make_unique_key<0>(&key3, 3);
     
     // Add three resources to the cache. Only c is usable as scratch.
-    TestResource* a = SkNEW_ARGS(TestResource, (context->getGpu()));
-    TestResource* b = SkNEW_ARGS(TestResource, (context->getGpu()));
+    TestResource* a = new TestResource(context->getGpu());
+    TestResource* b = new TestResource(context->getGpu());
     TestResource* c = TestResource::CreateScratch(context->getGpu(),
                                                   TestResource::kA_SimulatedProperty);
     a->resourcePriv().setUniqueKey(key1);
@@ -939,9 +936,8 @@ static void test_cache_chained_purge(skiatest::Reporter* reporter) {
     make_unique_key<0>(&key1, 1);
     make_unique_key<0>(&key2, 2);
 
-
-    TestResource* a = SkNEW_ARGS(TestResource, (context->getGpu()));
-    TestResource* b = SkNEW_ARGS(TestResource, (context->getGpu()));
+    TestResource* a = new TestResource(context->getGpu());
+    TestResource* b = new TestResource(context->getGpu());
     a->resourcePriv().setUniqueKey(key1);
     b->resourcePriv().setUniqueKey(key2);
 
@@ -978,11 +974,11 @@ static void test_resource_size_changed(skiatest::Reporter* reporter) {
         GrContext* context = mock.context();
         GrResourceCache* cache = mock.cache();
 
-        TestResource* a = SkNEW_ARGS(TestResource, (context->getGpu()));
+        TestResource* a = new TestResource(context->getGpu());
         a->resourcePriv().setUniqueKey(key1);
         a->unref();
 
-        TestResource* b = SkNEW_ARGS(TestResource, (context->getGpu()));
+        TestResource* b = new TestResource(context->getGpu());
         b->resourcePriv().setUniqueKey(key2);
         b->unref();
 
@@ -1007,12 +1003,12 @@ static void test_resource_size_changed(skiatest::Reporter* reporter) {
         GrContext* context = mock.context();
         GrResourceCache* cache = mock.cache();
 
-        TestResource* a = SkNEW_ARGS(TestResource, (context->getGpu()));
+        TestResource* a = new TestResource(context->getGpu());
         a->setSize(100);
         a->resourcePriv().setUniqueKey(key1);
         a->unref();
 
-        TestResource* b = SkNEW_ARGS(TestResource, (context->getGpu()));
+        TestResource* b = new TestResource(context->getGpu());
         b->setSize(100);
         b->resourcePriv().setUniqueKey(key2);
         b->unref();
@@ -1061,7 +1057,7 @@ static void test_timestamp_wrap(skiatest::Reporter* reporter) {
             GrUniqueKey key;
             make_unique_key<0>(&key, j);
 
-            TestResource* r = SkNEW_ARGS(TestResource, (context->getGpu()));
+            TestResource* r = new TestResource(context->getGpu());
             r->resourcePriv().setUniqueKey(key);
             if (random.nextU() % kLockedFreq) {
                 // Make this is purgeable.
@@ -1110,7 +1106,7 @@ static void test_flush(skiatest::Reporter* reporter) {
     {
         // Insert a resource and send a flush notification kFlushCount times.
         for (int i = 0; i < kFlushCount; ++i) {
-            TestResource* r = SkNEW_ARGS(TestResource, (context->getGpu()));
+            TestResource* r = new TestResource(context->getGpu());
             GrUniqueKey k;
             make_unique_key<1>(&k, i);
             r->resourcePriv().setUniqueKey(k);
@@ -1141,7 +1137,7 @@ static void test_flush(skiatest::Reporter* reporter) {
     {
         GrGpuResource* refedResources[kFlushCount >> 1];
         for (int i = 0; i < kFlushCount; ++i) {
-            TestResource* r = SkNEW_ARGS(TestResource, (context->getGpu()));
+            TestResource* r = new TestResource(context->getGpu());
             GrUniqueKey k;
             make_unique_key<1>(&k, i);
             r->resourcePriv().setUniqueKey(k);
@@ -1196,12 +1192,12 @@ static void test_large_resource_count(skiatest::Reporter* reporter) {
 
         TestResource* resource;
 
-        resource = SkNEW_ARGS(TestResource, (context->getGpu()));
+        resource = new TestResource(context->getGpu());
         resource->resourcePriv().setUniqueKey(key1);
         resource->setSize(1);
         resource->unref();
 
-        resource = SkNEW_ARGS(TestResource, (context->getGpu()));
+        resource = new TestResource(context->getGpu());
         resource->resourcePriv().setUniqueKey(key2);
         resource->setSize(1);
         resource->unref();
index bb12d66..58ab781 100644 (file)
@@ -97,10 +97,10 @@ DEF_TEST(BitmapCache_add_rect, reporter) {
 
     SkAutoTDelete<SkResourceCache> cache;
     if (factory) {
-        cache.reset(SkNEW_ARGS(SkResourceCache, (factory)));
+        cache.reset(new SkResourceCache(factory));
     } else {
         const size_t byteLimit = 100 * 1024;
-        cache.reset(SkNEW_ARGS(SkResourceCache, (byteLimit)));
+        cache.reset(new SkResourceCache(byteLimit));
     }
     SkBitmap cachedBitmap;
     make_bitmap(&cachedBitmap, SkImageInfo::MakeN32Premul(5, 5), allocator);
@@ -243,10 +243,10 @@ DEF_TEST(BitmapCache_discarded_bitmap, reporter) {
     
     SkAutoTDelete<SkResourceCache> cache;
     if (factory) {
-        cache.reset(SkNEW_ARGS(SkResourceCache, (factory)));
+        cache.reset(new SkResourceCache(factory));
     } else {
         const size_t byteLimit = 100 * 1024;
-        cache.reset(SkNEW_ARGS(SkResourceCache, (byteLimit)));
+        cache.reset(new SkResourceCache(byteLimit));
     }
     SkBitmap cachedBitmap;
     make_bitmap(&cachedBitmap, SkImageInfo::MakeN32Premul(5, 5), allocator);
index 212b0f6..23cd30c 100644 (file)
@@ -164,7 +164,7 @@ public:
 
 SkpSkGrThreadedTestRunner::~SkpSkGrThreadedTestRunner() {
     for (int index = 0; index < fRunnables.count(); index++) {
-        SkDELETE(fRunnables[index]);
+        delete fRunnables[index];
     }
 }
 
@@ -477,7 +477,7 @@ void TestResult::testOne() {
         }
     }
 finish:
-    SkDELETE(pic);
+    delete pic;
 }
 
 static SkString makeStatusString(int dirNo) {
@@ -705,8 +705,8 @@ DEF_TEST(SkpSkGrThreaded, reporter) {
                     goto skipOver;
                 }
             }
-            *testRunner.fRunnables.append() = SkNEW_ARGS(SkpSkGrThreadedRunnable,
-                    (&testSkGrMain, dirIndex, filename.c_str(), &testRunner));
+            *testRunner.fRunnables.append() = new SkpSkGrThreadedRunnable(
+                    &testSkGrMain, dirIndex, filename.c_str(), &testRunner);
     skipOver:
             ;
         }
index fac283d..771fc9e 100644 (file)
@@ -86,7 +86,7 @@ static void test_empty_image(skiatest::Reporter* reporter) {
     REPORTER_ASSERT(reporter, NULL == SkImage::NewRasterCopy(info, NULL, 0));
     REPORTER_ASSERT(reporter, NULL == SkImage::NewRasterData(info, NULL, 0));
     REPORTER_ASSERT(reporter, NULL == SkImage::NewFromRaster(info, NULL, 0, NULL, NULL));
-    REPORTER_ASSERT(reporter, NULL == SkImage::NewFromGenerator(SkNEW(EmptyGenerator)));
+    REPORTER_ASSERT(reporter, NULL == SkImage::NewFromGenerator(new EmptyGenerator));
 }
 
 static void test_empty_surface(skiatest::Reporter* reporter, GrContext* ctx) {
index 7ed1c39..c2ae07c 100644 (file)
@@ -29,7 +29,7 @@ static void check_fill(skiatest::Reporter* r,
     const size_t totalBytes = imageInfo.getSafeSize(rowBytes) + offset;
 
     // Create fake image data where every byte has a value of 0
-    SkAutoTDeleteArray<uint8_t> storage(SkNEW_ARRAY(uint8_t, totalBytes));
+    SkAutoTDeleteArray<uint8_t> storage(new uint8_t[totalBytes]);
     memset(storage.get(), 0, totalBytes);
     // Adjust the pointer in order to test on different memory alignments
     uint8_t* imageData = storage.get() + offset;
index 8c1e8e4..6a9b5f5 100644 (file)
@@ -61,12 +61,12 @@ static void TestTSet_basic(skiatest::Reporter* reporter) {
 namespace {
 SkTArray<int>* make() {
     typedef SkTArray<int> IntArray;
-    return SkNEW(IntArray);
+    return new IntArray;
 }
 
 template <int N> SkTArray<int>* make_s() {
     typedef SkSTArray<N, int> IntArray;
-    return SkNEW(IntArray);
+    return new IntArray;
 }
 }
 
@@ -97,14 +97,14 @@ static void test_swap(skiatest::Reporter* reporter) {
                     for (int i = 0; i < kSizes[dataSizeB]; ++i) {
                         REPORTER_ASSERT(reporter, curr++ == (*a)[i]);
                     }
-                    SkDELETE(b);
+                    delete b;
 
                     a->swap(a);
                     curr = kSizes[dataSizeA];
                     for (int i = 0; i < kSizes[dataSizeB]; ++i) {
                         REPORTER_ASSERT(reporter, curr++ == (*a)[i]);
                     }
-                    SkDELETE(a);
+                    delete a;
                 }
             }
         }
index 6f67382..cf2a239 100644 (file)
@@ -107,7 +107,7 @@ static void text_blob_cache_inner(skiatest::Reporter* reporter, GrContextFactory
             if (normal) {
                 paint.setTypeface(orig);
             } else {
-                SkAutoTUnref<SkTypeface> typeface(SkNEW_ARGS(SkRandomTypeface, (orig, paint, true)));
+                SkAutoTUnref<SkTypeface> typeface(new SkRandomTypeface(orig, paint, true));
                 paint.setTypeface(typeface);
             }
 
index 150bf3b..fbd35d0 100644 (file)
@@ -104,7 +104,7 @@ public:
       }
       fStatus->endTest(fTest.name, !reporter.fError, elapsed,
                        reporter.fTestCount);
-      SkDELETE(this);
+      delete this;
   }
 
 private:
@@ -189,7 +189,7 @@ int test_main() {
         } else if (test.needsGpu) {
             gpuTests.push_back(&test);
         } else {
-            cpuTests.add(SkNEW_ARGS(SkTestRunnable, (test, &status)));
+            cpuTests.add(new SkTestRunnable(test, &status));
         }
     }
 
@@ -203,8 +203,7 @@ int test_main() {
 
     // Run GPU tests on this thread.
     for (int i = 0; i < gpuTests.count(); i++) {
-        SkNEW_ARGS(SkTestRunnable, (*gpuTests[i], &status, grContextFactoryPtr))
-                ->run();
+        (new SkTestRunnable(*gpuTests[i], &status, grContextFactoryPtr))->run();
     }
 
     // Block until threaded tests finish.
index f708f53..9a86d85 100644 (file)
@@ -44,10 +44,10 @@ void PictureBenchmark::setTimersToShow(bool wall,
 Timer* PictureBenchmark::setupTimer(bool useGLTimer) {
 #if SK_SUPPORT_GPU
     if (useGLTimer && fRenderer != NULL && fRenderer->isUsingGpuDevice()) {
-        return SkNEW_ARGS(Timer, (fRenderer->getGLContext()));
+        return new Timer(fRenderer->getGLContext());
     }
 #endif
-    return SkNEW_ARGS(Timer, (NULL));
+    return new Timer(NULL);
 }
 
 PictureRenderer* PictureBenchmark::setRenderer(sk_tools::PictureRenderer* renderer) {
index 34b08f5..ee8e981 100644 (file)
@@ -131,7 +131,7 @@ SkCanvas* PictureRenderer::setupCanvas(int width, int height) {
         case kBitmap_DeviceType: {
             SkBitmap bitmap;
             sk_tools::setup_bitmap(&bitmap, width, height);
-            canvas.reset(SkNEW_ARGS(SkCanvas, (bitmap)));
+            canvas.reset(new SkCanvas(bitmap));
         }
         break;
 #if SK_SUPPORT_GPU
@@ -165,7 +165,7 @@ SkCanvas* PictureRenderer::setupCanvas(int width, int height) {
             if (!device) {
                 return NULL;
             }
-            canvas.reset(SkNEW_ARGS(SkCanvas, (device)));
+            canvas.reset(new SkCanvas(device));
             break;
         }
 #endif
@@ -179,7 +179,7 @@ SkCanvas* PictureRenderer::setupCanvas(int width, int height) {
             canvas->setAllowSoftClip(false);
         }
 
-        canvas.reset(SkNEW_ARGS(FlagsFilterCanvas, (canvas.get(), fDrawFilters)));
+        canvas.reset(new FlagsFilterCanvas(canvas.get(), fDrawFilters));
     }
 
     this->scaleToScaleFactor(canvas);
@@ -408,7 +408,7 @@ bool PipePictureRenderer::render(SkBitmap** out) {
     writer.endRecording();
     fCanvas->flush();
     if (out) {
-        *out = SkNEW(SkBitmap);
+        *out = new SkBitmap;
         setup_bitmap(*out, SkScalarCeilToInt(fPicture->cullRect().width()),
                            SkScalarCeilToInt(fPicture->cullRect().height()));
         fCanvas->readPixels(*out, 0, 0);
@@ -453,7 +453,7 @@ bool SimplePictureRenderer::render(SkBitmap** out) {
     }
     fCanvas->flush();
     if (out) {
-        *out = SkNEW(SkBitmap);
+        *out = new SkBitmap;
         setup_bitmap(*out, SkScalarCeilToInt(fPicture->cullRect().width()),
                            SkScalarCeilToInt(fPicture->cullRect().height()));
         fCanvas->readPixels(*out, 0, 0);
@@ -694,7 +694,7 @@ bool TiledPictureRenderer::render(SkBitmap** out) {
 
     SkBitmap bitmap;
     if (out) {
-        *out = SkNEW(SkBitmap);
+        *out = new SkBitmap;
         setup_bitmap(*out, SkScalarCeilToInt(fPicture->cullRect().width()),
                            SkScalarCeilToInt(fPicture->cullRect().height()));
         setup_bitmap(&bitmap, fTileWidth, fTileHeight);
@@ -794,7 +794,7 @@ SkString TiledPictureRenderer::getConfigNameInternal() {
 
 void PlaybackCreationRenderer::setup() {
     SkAutoTDelete<SkBBHFactory> factory(this->getFactory());
-    fRecorder.reset(SkNEW(SkPictureRecorder));
+    fRecorder.reset(new SkPictureRecorder);
     SkCanvas* canvas = fRecorder->beginRecording(SkIntToScalar(this->getViewWidth()),
                                                  SkIntToScalar(this->getViewHeight()),
                                                  factory.get(),
@@ -821,7 +821,7 @@ SkBBHFactory* PictureRenderer::getFactory() {
         case kNone_BBoxHierarchyType:
             return NULL;
         case kRTree_BBoxHierarchyType:
-            return SkNEW(SkRTreeFactory);
+            return new SkRTreeFactory;
     }
     SkASSERT(0); // invalid bbhType
     return NULL;
index bd718a0..7a2fc25 100644 (file)
@@ -110,7 +110,7 @@ sk_tools::PictureRenderer* parseRenderer(SkString& error, PictureTool tool) {
     if (FLAGS_mode.count() >= 1) {
         mode = FLAGS_mode[0];
         if (0 == strcmp(mode, "record")) {
-            renderer.reset(SkNEW_ARGS(sk_tools::RecordPictureRenderer, RENDERER_ARGS));
+            renderer.reset(new sk_tools::RecordPictureRenderer RENDERER_ARGS);
         } else if (0 == strcmp(mode, "tile") || 0 == strcmp(mode, "pow2tile")
                    || 0 == strcmp(mode, "copyTile")) {
             useTiles = true;
@@ -134,10 +134,10 @@ sk_tools::PictureRenderer* parseRenderer(SkString& error, PictureTool tool) {
 
             heightString = FLAGS_mode[2];
         } else if (0 == strcmp(mode, "playbackCreation") && kBench_PictureTool == tool) {
-            renderer.reset(SkNEW_ARGS(sk_tools::PlaybackCreationRenderer, RENDERER_ARGS));
+            renderer.reset(new sk_tools::PlaybackCreationRenderer RENDERER_ARGS);
         // undocumented
         } else if (0 == strcmp(mode, "rerecord") && kRender_PictureTool == tool) {
-            renderer.reset(SkNEW_ARGS(sk_tools::RecordPictureRenderer, RENDERER_ARGS));
+            renderer.reset(new sk_tools::RecordPictureRenderer RENDERER_ARGS);
         } else if (0 == strcmp(mode, "simple")) {
             // Allow 'mode' to be set to 'simple', but do not create a renderer, so we can
             // ensure that pipe does not override a mode besides simple. The renderer will
@@ -175,12 +175,12 @@ sk_tools::PictureRenderer* parseRenderer(SkString& error, PictureTool tool) {
                 x = y = 4;
             }
 #if SK_SUPPORT_GPU
-            tiledRenderer.reset(SkNEW_ARGS(sk_tools::CopyTilesRenderer, (grContextOpts, x, y)));
+            tiledRenderer.reset(new sk_tools::CopyTilesRenderer(grContextOpts, x, y));
 #else
-            tiledRenderer.reset(SkNEW_ARGS(sk_tools::CopyTilesRenderer, (x, y)));
+            tiledRenderer.reset(new sk_tools::CopyTilesRenderer(x, y));
 #endif
         } else {
-            tiledRenderer.reset(SkNEW_ARGS(sk_tools::TiledPictureRenderer, RENDERER_ARGS));
+            tiledRenderer.reset(new sk_tools::TiledPictureRenderer RENDERER_ARGS);
         }
 
         if (isPowerOf2Mode) {
@@ -241,12 +241,12 @@ sk_tools::PictureRenderer* parseRenderer(SkString& error, PictureTool tool) {
                 error.printf("Pipe is incompatible with other modes.\n");
                 return NULL;
             }
-            renderer.reset(SkNEW_ARGS(sk_tools::PipePictureRenderer, RENDERER_ARGS));
+            renderer.reset(new sk_tools::PipePictureRenderer RENDERER_ARGS);
         }
     }
 
     if (NULL == renderer) {
-        renderer.reset(SkNEW_ARGS(sk_tools::SimplePictureRenderer, RENDERER_ARGS));
+        renderer.reset(new sk_tools::SimplePictureRenderer RENDERER_ARGS);
     }
 
     if (FLAGS_viewport.count() > 0) {
index b24672a..0763d5c 100644 (file)
@@ -57,20 +57,20 @@ VisualBench::VisualBench(void* hwnd, int argc, char** argv)
     , fLoops(1)
     , fState(kPreWarmLoops_State)
     , fBenchmark(NULL)
-    , fResults(SkNEW(ResultsWriter)) {
+    , fResults(new ResultsWriter) {
     SkCommandLineFlags::Parse(argc, argv);
 
     this->setTitle();
     this->setupBackend();
 
-    fBenchmarkStream.reset(SkNEW(VisualBenchmarkStream));
+    fBenchmarkStream.reset(new VisualBenchmarkStream);
 
     // Print header
     SkDebugf("curr/maxrss\tloops\tflushes\tmin\tmedian\tmean\tmax\tstddev\tbench\n");
 
     // setup json logging if required
     if (!FLAGS_outResultsFile.isEmpty()) {
-        fResults.reset(SkNEW(NanoJSONResultsWriter(FLAGS_outResultsFile[0])));
+        fResults.reset(new NanoJSONResultsWriter(FLAGS_outResultsFile[0]));
     }
 
     if (1 == FLAGS_properties.count() % 2) {
index e3eb44d..f8d01a1 100644 (file)
@@ -93,7 +93,7 @@ Benchmark* VisualBenchmarkStream::innerNext() {
         if (gm->runAsBench()) {
             fSourceType = "gm";
             fBenchType  = "micro";
-            return SkNEW_ARGS(GMBench, (gm.detach()));
+            return new GMBench(gm.detach());
         }
     }
 
@@ -108,7 +108,7 @@ Benchmark* VisualBenchmarkStream::innerNext() {
         SkString name = SkOSPath::Basename(path.c_str());
         fSourceType = "skp";
         fBenchType = "playback";
-        return SkNEW_ARGS(VisualSKPBench, (name.c_str(), pic.get()));
+        return new VisualSKPBench(name.c_str(), pic.get());
     }
 
     return NULL;
index b29f4d1..865bb51 100644 (file)
@@ -431,13 +431,9 @@ int tool_main(int argc, char** argv) {
     SkAutoTDelete<PictureJSONResultsWriter> jsonWriter;
     if (FLAGS_jsonLog.count() == 1) {
         SkASSERT(FLAGS_builderName.count() == 1 && FLAGS_gitHash.count() == 1);
-        jsonWriter.reset(SkNEW(PictureJSONResultsWriter(
-                        FLAGS_jsonLog[0],
-                        FLAGS_builderName[0],
-                        FLAGS_buildNumber,
-                        FLAGS_timestamp,
-                        FLAGS_gitHash[0],
-                        FLAGS_gitNumber)));
+        jsonWriter.reset(new PictureJSONResultsWriter(FLAGS_jsonLog[0], FLAGS_builderName[0],
+                                                      FLAGS_buildNumber, FLAGS_timestamp,
+                                                      FLAGS_gitHash[0], FLAGS_gitNumber));
         gWriter.add(jsonWriter.get());
     }
 
index ec9949b..2ea45c2 100644 (file)
@@ -18,7 +18,7 @@ template <typename T> static void ignore_result(const T&) {}
 bool SkFlagInfo::CreateStringFlag(const char* name, const char* shortName,
                                   SkCommandLineFlags::StringArray* pStrings,
                                   const char* defaultValue, const char* helpString) {
-    SkFlagInfo* info = SkNEW_ARGS(SkFlagInfo, (name, shortName, kString_FlagType, helpString));
+    SkFlagInfo* info = new SkFlagInfo(name, shortName, kString_FlagType, helpString);
     info->fDefaultString.set(defaultValue);
 
     info->fStrings = pStrings;
@@ -334,7 +334,7 @@ void SkCommandLineFlags::Parse(int argc, char** argv) {
     gHead = NULL;
     while (flag != NULL) {
         SkFlagInfo* next = flag->next();
-        SkDELETE(flag);
+        delete flag;
         flag = next;
     }
     if (helpPrinted) {
index 465d4a0..ae504cb 100644 (file)
@@ -262,7 +262,7 @@ public:
      */
     static bool CreateBoolFlag(const char* name, const char* shortName, bool* pBool,
                                bool defaultValue, const char* helpString) {
-        SkFlagInfo* info = SkNEW_ARGS(SkFlagInfo, (name, shortName, kBool_FlagType, helpString));
+        SkFlagInfo* info = new SkFlagInfo(name, shortName, kBool_FlagType, helpString);
         info->fBoolValue = pBool;
         *info->fBoolValue = info->fDefaultBool = defaultValue;
         return true;
@@ -283,7 +283,7 @@ public:
      */
     static bool CreateIntFlag(const char* name, int32_t* pInt,
                               int32_t defaultValue, const char* helpString) {
-        SkFlagInfo* info = SkNEW_ARGS(SkFlagInfo, (name, NULL, kInt_FlagType, helpString));
+        SkFlagInfo* info = new SkFlagInfo(name, NULL, kInt_FlagType, helpString);
         info->fIntValue = pInt;
         *info->fIntValue = info->fDefaultInt = defaultValue;
         return true;
@@ -294,7 +294,7 @@ public:
      */
     static bool CreateDoubleFlag(const char* name, double* pDouble,
                                  double defaultValue, const char* helpString) {
-        SkFlagInfo* info = SkNEW_ARGS(SkFlagInfo, (name, NULL, kDouble_FlagType, helpString));
+        SkFlagInfo* info = new SkFlagInfo(name, NULL, kDouble_FlagType, helpString);
         info->fDoubleValue = pDouble;
         *info->fDoubleValue = info->fDefaultDouble = defaultValue;
         return true;
index 4e13f7e..9b80ef4 100644 (file)
@@ -115,7 +115,7 @@ public:
 static SkWStream* open_stream(const SkString& outputDir,
                               const SkString& inputFilename) {
     if (outputDir.isEmpty()) {
-        return SkNEW(NullWStream);
+        return new NullWStream;
     }
 
     SkString outputPath;
@@ -123,8 +123,7 @@ static SkWStream* open_stream(const SkString& outputDir,
         return NULL;
     }
 
-    SkAutoTDelete<SkFILEWStream> stream(
-            SkNEW_ARGS(SkFILEWStream, (outputPath.c_str())));
+    SkAutoTDelete<SkFILEWStream> stream(new SkFILEWStream(outputPath.c_str()));
     if (!stream.get() ||  !stream->isValid()) {
         SkDebugf("Could not write to file %s\n", outputPath.c_str());
         return NULL;
index 3920831..8cda966 100644 (file)
@@ -273,7 +273,7 @@ static bool render_picture(const SkString& inputPath, const SkString* writePath,
 
     if (!success || ((FLAGS_validate || FLAGS_writeWholeImage) && bitmap == NULL)) {
         SkDebugf("Failed to draw the picture.\n");
-        SkDELETE(bitmap);
+        delete bitmap;
         return false;
     }
 
@@ -290,10 +290,9 @@ static bool render_picture(const SkString& inputPath, const SkString* writePath,
             arbbh.set(referenceRenderer, sk_tools::PictureRenderer::kNone_BBoxHierarchyType);
         } else {
 #if SK_SUPPORT_GPU
-            referenceRenderer = SkNEW_ARGS(sk_tools::SimplePictureRenderer,
-                                           (renderer.getGrContextOptions()));
+            referenceRenderer = new sk_tools::SimplePictureRenderer(renderer.getGrContextOptions());
 #else
-            referenceRenderer = SkNEW(sk_tools::SimplePictureRenderer);
+            referenceRenderer = new sk_tools::SimplePictureRenderer;
 #endif
         }
         SkAutoTUnref<sk_tools::PictureRenderer> aurReferenceRenderer(referenceRenderer);
@@ -303,23 +302,23 @@ static bool render_picture(const SkString& inputPath, const SkString* writePath,
 
         if (!success || NULL == referenceBitmap || NULL == referenceBitmap->getPixels()) {
             SkDebugf("Failed to draw the reference picture.\n");
-            SkDELETE(bitmap);
-            SkDELETE(referenceBitmap);
+            delete bitmap;
+            delete referenceBitmap;
             return false;
         }
 
         if (success && (bitmap->width() != referenceBitmap->width())) {
             SkDebugf("Expected image width: %i, actual image width %i.\n",
                      referenceBitmap->width(), bitmap->width());
-            SkDELETE(bitmap);
-            SkDELETE(referenceBitmap);
+            delete bitmap;
+            delete referenceBitmap;
             return false;
         }
         if (success && (bitmap->height() != referenceBitmap->height())) {
             SkDebugf("Expected image height: %i, actual image height %i",
                      referenceBitmap->height(), bitmap->height());
-            SkDELETE(bitmap);
-            SkDELETE(referenceBitmap);
+            delete bitmap;
+            delete referenceBitmap;
             return false;
         }
 
@@ -336,13 +335,13 @@ static bool render_picture(const SkString& inputPath, const SkString* writePath,
                              x, y, FLAGS_maxComponentDiff,
                              *referenceBitmap->getAddr32(x, y),
                              *bitmap->getAddr32(x, y));
-                    SkDELETE(bitmap);
-                    SkDELETE(referenceBitmap);
+                    delete bitmap;
+                    delete referenceBitmap;
                     return false;
                 }
             }
         }
-        SkDELETE(referenceBitmap);
+        delete referenceBitmap;
 
         for (int i = 1; i <= 255; ++i) {
             if(diffs[i] > 0) {
@@ -373,7 +372,7 @@ static bool render_picture(const SkString& inputPath, const SkString* writePath,
             success &= sk_tools::write_bitmap_to_disk(*bitmap, *writePath, NULL, outputFilename);
         }
     }
-    SkDELETE(bitmap);
+    delete bitmap;
 
     return success;
 }
index 06008c6..6d6fda9 100644 (file)
@@ -59,13 +59,13 @@ SkTypeface* create_font(const char* name, SkTypeface::Style style) {
         if (fontData->fFontCache) {
             font = SkSafeRef(fontData->fFontCache);
         } else {
-            font = SkNEW_ARGS(SkTestFont, (*fontData));
+            font = new SkTestFont(*fontData);
             SkDEBUGCODE(font->fDebugName = sub->fName);
             SkDEBUGCODE(font->fDebugStyle = sub->fStyle);
             fontData->fFontCache = SkSafeRef(font);
         }
     }
-    return SkNEW_ARGS(SkTestTypeface, (font, SkFontStyle(style)));
+    return new SkTestTypeface(font, SkFontStyle(style));
 }
 
 }
index d145460..5add0df 100644 (file)
@@ -28,7 +28,7 @@ SkDiffContext::SkDiffContext() {
 
 SkDiffContext::~SkDiffContext() {
     if (fDiffers) {
-        SkDELETE_ARRAY(fDiffers);
+        delete[] fDiffers;
     }
 }
 
@@ -57,14 +57,14 @@ void SkDiffContext::setLongNames(const bool useLongNames) {
 void SkDiffContext::setDiffers(const SkTDArray<SkImageDiffer*>& differs) {
     // Delete whatever the last array of differs was
     if (fDiffers) {
-        SkDELETE_ARRAY(fDiffers);
+        delete[] fDiffers;
         fDiffers = NULL;
         fDifferCount = 0;
     }
 
     // Copy over the new differs
     fDifferCount = differs.count();
-    fDiffers = SkNEW_ARRAY(SkImageDiffer*, fDifferCount);
+    fDiffers = new SkImageDiffer* [fDifferCount];
     differs.copy(fDiffers);
 }
 
index 392a342..3563642 100644 (file)
@@ -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 <cmath>
 #include <math.h>
 
@@ -25,12 +31,10 @@ struct Image2D {
           height(h) {
         SkASSERT(w > 0);
         SkASSERT(h > 0);
-        image = SkNEW_ARRAY(T, w * h);
+        image = new T[w * h];
     }
 
-    ~Image2D() {
-        SkDELETE_ARRAY(image);
-    }
+    ~Image2D() { delete[] image; }
 
     void readPixel(int x, int y, T* pixel) const {
         SkASSERT(x >= 0);
@@ -66,17 +70,17 @@ struct ImageArray
     ImageArray(int w, int h, int s)
         : slices(s) {
         SkASSERT(s > 0);
-        image = SkNEW_ARRAY(Image2D<T>*, s);
+        image = new Image2D<T>* [s];
         for (int sliceIndex = 0; sliceIndex < slices; sliceIndex++) {
-            image[sliceIndex] = SkNEW_ARGS(Image2D<T>, (w, h));
+            image[sliceIndex] = new Image2D<T>(w, h);
         }
     }
 
     ~ImageArray() {
         for (int sliceIndex = 0; sliceIndex < slices; sliceIndex++) {
-            SkDELETE(image[sliceIndex]);
+            delete image[sliceIndex];
         }
-        SkDELETE_ARRAY(image);
+        delete[] image;
     }
 
     Image2D<T>* getLayer(int z) const {
@@ -296,9 +300,9 @@ static double pmetric(const ImageLAB* baselineLAB, const ImageLAB* testLAB, int*
     ImageL3D baselineL(width, height, maxLevels);
     ImageL3D testL(width, height, maxLevels);
     ImageL scratchImageL(width, height);
-    float* cyclesPerDegree = SkNEW_ARRAY(float, maxLevels);
-    float* thresholdFactorFrequency = SkNEW_ARRAY(float, maxLevels - 2);
-    float* contrast = SkNEW_ARRAY(float, maxLevels - 2);
+    float* cyclesPerDegree = new float[maxLevels];
+    float* thresholdFactorFrequency = new float[maxLevels - 2];
+    float* contrast = new float[maxLevels - 2];
 
     lab_to_l(baselineLAB, baselineL.getLayer(0));
     lab_to_l(testLAB, testL.getLayer(0));
@@ -311,7 +315,7 @@ static double pmetric(const ImageLAB* baselineLAB, const ImageLAB* testLAB, int*
 
     // Contrast sensitivity is based on image dimensions. Therefore it cannot be statically
     // generated.
-    float* contrastSensitivityTable = SkNEW_ARRAY(float, maxLevels * 1000);
+    float* contrastSensitivityTable = new float[maxLevels * 1000];
     for (int levelIndex = 0; levelIndex < maxLevels; levelIndex++) {
         for (int csLum = 0; csLum < 1000; csLum++) {
            contrastSensitivityTable[levelIndex * 1000 + csLum] =
@@ -435,10 +439,10 @@ static double pmetric(const ImageLAB* baselineLAB, const ImageLAB* testLAB, int*
         }
     }
 
-    SkDELETE_ARRAY(cyclesPerDegree);
-    SkDELETE_ARRAY(contrast);
-    SkDELETE_ARRAY(thresholdFactorFrequency);
-    SkDELETE_ARRAY(contrastSensitivityTable);
+    delete[] cyclesPerDegree;
+    delete[] contrast;
+    delete[] thresholdFactorFrequency;
+    delete[] contrastSensitivityTable;
     return 1.0 - (double)(*poiCount) / (width * height);
 }