diff options
Diffstat (limited to 'src/gpu/gl')
25 files changed, 89 insertions, 99 deletions
diff --git a/src/gpu/gl/GrGLAssembleInterface.cpp b/src/gpu/gl/GrGLAssembleInterface.cpp index 9b07246ef3..adb11df809 100644 --- a/src/gpu/gl/GrGLAssembleInterface.cpp +++ b/src/gpu/gl/GrGLAssembleInterface.cpp @@ -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); diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index af0fa78f7e..19d6a8092d 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -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); } diff --git a/src/gpu/gl/GrGLContext.cpp b/src/gpu/gl/GrGLContext.cpp index ee840b3aab..b4fb3ea219 100644 --- a/src/gpu/gl/GrGLContext.cpp +++ b/src/gpu/gl/GrGLContext.cpp @@ -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)); } diff --git a/src/gpu/gl/GrGLCreateNullInterface.cpp b/src/gpu/gl/GrGLCreateNullInterface.cpp index 886aacdcb8..37d0285009 100644 --- a/src/gpu/gl/GrGLCreateNullInterface.cpp +++ b/src/gpu/gl/GrGLCreateNullInterface.cpp @@ -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; diff --git a/src/gpu/gl/GrGLExtensions.cpp b/src/gpu/gl/GrGLExtensions.cpp index 5ccb3393d4..f2d54ff687 100644 --- a/src/gpu/gl/GrGLExtensions.cpp +++ b/src/gpu/gl/GrGLExtensions.cpp @@ -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; diff --git a/src/gpu/gl/GrGLFragmentProcessor.h b/src/gpu/gl/GrGLFragmentProcessor.h index c46b00218f..05ee375a9a 100644 --- a/src/gpu/gl/GrGLFragmentProcessor.h +++ b/src/gpu/gl/GrGLFragmentProcessor.h @@ -20,7 +20,7 @@ public: virtual ~GrGLFragmentProcessor() { for (int i = 0; i < fChildProcessors.count(); ++i) { - SkDELETE(fChildProcessors[i]); + delete fChildProcessors[i]; } } diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index 9cc699cecf..92cfba1c7d 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -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); diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h index defb81a382..4be8a76fba 100644 --- a/src/gpu/gl/GrGLGpu.h +++ b/src/gpu/gl/GrGLGpu.h @@ -341,7 +341,7 @@ private: public: HWGeometryState() { fVBOVertexArray = NULL; this->invalidate(); } - ~HWGeometryState() { SkDELETE(fVBOVertexArray); } + ~HWGeometryState() { delete fVBOVertexArray; } void invalidate() { fBoundVertexArrayIDIsValid = false; diff --git a/src/gpu/gl/GrGLGpuProgramCache.cpp b/src/gpu/gl/GrGLGpuProgramCache.cpp index 11e237a73c..c6b673b95b 100644 --- a/src/gpu/gl/GrGLGpuProgramCache.cpp +++ b/src/gpu/gl/GrGLGpuProgramCache.cpp @@ -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 { diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp index ffc2ea0bcb..fca7bf2d2f 100644 --- a/src/gpu/gl/GrGLInterface.cpp +++ b/src/gpu/gl/GrGLInterface.cpp @@ -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; diff --git a/src/gpu/gl/GrGLNameAllocator.cpp b/src/gpu/gl/GrGLNameAllocator.cpp index 94792f1fab..49d4564fb9 100644 --- a/src/gpu/gl/GrGLNameAllocator.cpp +++ b/src/gpu/gl/GrGLNameAllocator.cpp @@ -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; } diff --git a/src/gpu/gl/GrGLPathRendering.cpp b/src/gpu/gl/GrGLPathRendering.cpp index 7c77155b6c..22b12bf988 100644 --- a/src/gpu/gl/GrGLPathRendering.cpp +++ b/src/gpu/gl/GrGLPathRendering.cpp @@ -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 diff --git a/src/gpu/gl/SkGLContext.cpp b/src/gpu/gl/SkGLContext.cpp index 8975a989d1..75fbf2bac5 100644 --- a/src/gpu/gl/SkGLContext.cpp +++ b/src/gpu/gl/SkGLContext.cpp @@ -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; diff --git a/src/gpu/gl/SkNullGLContext.cpp b/src/gpu/gl/SkNullGLContext.cpp index c59fb98ad2..dddea763ad 100644 --- a/src/gpu/gl/SkNullGLContext.cpp +++ b/src/gpu/gl/SkNullGLContext.cpp @@ -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 diff --git a/src/gpu/gl/builders/GrGLPathProgramBuilder.cpp b/src/gpu/gl/builders/GrGLPathProgramBuilder.cpp index 9bebe0d89e..426676f1e3 100644 --- a/src/gpu/gl/builders/GrGLPathProgramBuilder.cpp +++ b/src/gpu/gl/builders/GrGLPathProgramBuilder.cpp @@ -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( diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp index 2db568693d..39d8ec56a2 100644 --- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp +++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp @@ -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]; } } diff --git a/src/gpu/gl/debug/GrDebugGL.h b/src/gpu/gl/debug/GrDebugGL.h index 9192725d1d..ae6a978363 100644 --- a/src/gpu/gl/debug/GrDebugGL.h +++ b/src/gpu/gl/debug/GrDebugGL.h @@ -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; } } diff --git a/src/gpu/gl/debug/GrFakeRefObj.h b/src/gpu/gl/debug/GrFakeRefObj.h index 27e27ce3ce..30580516fa 100644 --- a/src/gpu/gl/debug/GrFakeRefObj.h +++ b/src/gpu/gl/debug/GrFakeRefObj.h @@ -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 diff --git a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp index 8b0f8c5d53..ef52fb6763 100644 --- a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp +++ b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp @@ -836,7 +836,7 @@ private: //////////////////////////////////////////////////////////////////////////////// const GrGLInterface* GrGLCreateDebugInterface() { - GrGLInterface* interface = SkNEW(GrDebugGLInterface); + GrGLInterface *interface = new GrDebugGLInterface; interface->fStandard = kGL_GrGLStandard; diff --git a/src/gpu/gl/debug/SkDebugGLContext.h b/src/gpu/gl/debug/SkDebugGLContext.h index 6a4d9fc38b..0a61f72cb2 100644 --- a/src/gpu/gl/debug/SkDebugGLContext.h +++ b/src/gpu/gl/debug/SkDebugGLContext.h @@ -18,7 +18,7 @@ public: if (kGLES_GrGLStandard == forcedGpuAPI) { return NULL; } - return SkNEW(SkDebugGLContext); + return new SkDebugGLContext; } private: void onPlatformMakeCurrent() const override {} diff --git a/src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp b/src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp index 9ed57a37a3..9bdedf7ef0 100644 --- a/src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp +++ b/src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp @@ -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; diff --git a/src/gpu/gl/glx/SkCreatePlatformGLContext_glx.cpp b/src/gpu/gl/glx/SkCreatePlatformGLContext_glx.cpp index 7933757186..cabd4431eb 100644 --- a/src/gpu/gl/glx/SkCreatePlatformGLContext_glx.cpp +++ b/src/gpu/gl/glx/SkCreatePlatformGLContext_glx.cpp @@ -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; diff --git a/src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp b/src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp index d2d8569938..4754c01557 100644 --- a/src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp +++ b/src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp @@ -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; diff --git a/src/gpu/gl/mesa/SkMesaGLContext.h b/src/gpu/gl/mesa/SkMesaGLContext.h index fa3df7b7c7..1548bfd8ee 100644 --- a/src/gpu/gl/mesa/SkMesaGLContext.h +++ b/src/gpu/gl/mesa/SkMesaGLContext.h @@ -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; diff --git a/src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp b/src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp index 8a4c5db5b3..0517f73ee4 100644 --- a/src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp +++ b/src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp @@ -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; |