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

Unified Diff: src/core/SkDataTable.cpp

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkComposeShader.cpp ('k') | src/core/SkDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkDataTable.cpp
diff --git a/src/core/SkDataTable.cpp b/src/core/SkDataTable.cpp
index e2644a05c98d0bd886657ff72fc2fc12292058c5..20bc4308530c7625e8463c71c979b3217a030c2e 100644
--- a/src/core/SkDataTable.cpp
+++ b/src/core/SkDataTable.cpp
@@ -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();
« no previous file with comments | « src/core/SkComposeShader.cpp ('k') | src/core/SkDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698