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

Unified Diff: src/core/SkPictureData.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/SkPicture.cpp ('k') | src/core/SkPictureFlat.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPictureData.cpp
diff --git a/src/core/SkPictureData.cpp b/src/core/SkPictureData.cpp
index 6ae03a3f2ea8e81bb74a37b461237eec5524ad95..e70cd66de8930b81390efda82e598d272781bbd9 100644
--- a/src/core/SkPictureData.cpp
+++ b/src/core/SkPictureData.cpp
@@ -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)) {
« no previous file with comments | « src/core/SkPicture.cpp ('k') | src/core/SkPictureFlat.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698