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

Unified Diff: src/core/SkStream.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/SkSmallAllocator.h ('k') | src/core/SkTLList.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkStream.cpp
diff --git a/src/core/SkStream.cpp b/src/core/SkStream.cpp
index f32f68a10ab668f06323d690166eaf7b892398b5..8b2e8ab4ce71fd5811e498edddb506259e4e5181 100644
--- a/src/core/SkStream.cpp
+++ b/src/core/SkStream.cpp
@@ -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;
« no previous file with comments | « src/core/SkSmallAllocator.h ('k') | src/core/SkTLList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698