diff options
author | halcanary <halcanary@google.com> | 2015-08-26 13:07:48 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-26 13:07:49 -0700 |
commit | 385fe4d4b62d7d1dd76116dd570df3290a2f487b (patch) | |
tree | 53d982ff238828331e86acd44071a44162a8688c /src/lazy | |
parent | 5015176adf046ef906a2313b6e6b64b72cc84898 (diff) |
Style Change: SkNEW->new; SkDELETE->delete
DOCS_PREVIEW= https://skia.org/?cl=1316123003
Review URL: https://codereview.chromium.org/1316123003
Diffstat (limited to 'src/lazy')
-rw-r--r-- | src/lazy/SkCachingPixelRef.cpp | 7 | ||||
-rw-r--r-- | src/lazy/SkCachingPixelRef.h | 4 | ||||
-rw-r--r-- | src/lazy/SkDiscardableMemoryPool.cpp | 5 | ||||
-rw-r--r-- | src/lazy/SkDiscardablePixelRef.cpp | 13 |
4 files changed, 13 insertions, 16 deletions
diff --git a/src/lazy/SkCachingPixelRef.cpp b/src/lazy/SkCachingPixelRef.cpp index 3edd0de4fb..f65e5454a7 100644 --- a/src/lazy/SkCachingPixelRef.cpp +++ b/src/lazy/SkCachingPixelRef.cpp @@ -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. } diff --git a/src/lazy/SkCachingPixelRef.h b/src/lazy/SkCachingPixelRef.h index 818db22b19..1057441d5e 100644 --- a/src/lazy/SkCachingPixelRef.h +++ b/src/lazy/SkCachingPixelRef.h @@ -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); diff --git a/src/lazy/SkDiscardableMemoryPool.cpp b/src/lazy/SkDiscardableMemoryPool.cpp index 70072c6b8c..898d7661fb 100644 --- a/src/lazy/SkDiscardableMemoryPool.cpp +++ b/src/lazy/SkDiscardableMemoryPool.cpp @@ -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); diff --git a/src/lazy/SkDiscardablePixelRef.cpp b/src/lazy/SkDiscardablePixelRef.cpp index 4f9178e6e1..01bfd83eee 100644 --- a/src/lazy/SkDiscardablePixelRef.cpp +++ b/src/lazy/SkDiscardablePixelRef.cpp @@ -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; } |