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

Unified Diff: src/pdf/SkPDFTypes.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/pdf/SkPDFTypes.h ('k') | src/pipe/SkGPipePriv.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFTypes.cpp
diff --git a/src/pdf/SkPDFTypes.cpp b/src/pdf/SkPDFTypes.cpp
index 9bb9dee49760840924cee3b022ee90db5d7dcf73..43361fcf44df5e5b1fd3b2631d465e30603f8329 100644
--- a/src/pdf/SkPDFTypes.cpp
+++ b/src/pdf/SkPDFTypes.cpp
@@ -38,7 +38,7 @@ SkPDFUnion::~SkPDFUnion() {
SkPDFUnion& SkPDFUnion::operator=(SkPDFUnion&& other) {
if (this != &other) {
this->~SkPDFUnion();
- SkNEW_PLACEMENT_ARGS(this, SkPDFUnion, (other.move()));
+ new (this) SkPDFUnion(other.move());
}
return *this;
}
@@ -56,8 +56,7 @@ SkPDFUnion SkPDFUnion::copy() const {
switch (fType) {
case Type::kNameSkS:
case Type::kStringSkS:
- SkNEW_PLACEMENT_ARGS(pun(u.fSkString), SkString,
- (*pun(fSkString)));
+ new (pun(u.fSkString)) SkString (*pun(fSkString));
return u.move();
case Type::kObjRef:
case Type::kObject:
@@ -226,13 +225,13 @@ SkPDFUnion SkPDFUnion::String(const char* value) {
SkPDFUnion SkPDFUnion::Name(const SkString& s) {
SkPDFUnion u(Type::kNameSkS);
- SkNEW_PLACEMENT_ARGS(pun(u.fSkString), SkString, (s));
+ new (pun(u.fSkString)) SkString(s);
return u.move();
}
SkPDFUnion SkPDFUnion::String(const SkString& s) {
SkPDFUnion u(Type::kStringSkS);
- SkNEW_PLACEMENT_ARGS(pun(u.fSkString), SkString, (s));
+ new (pun(u.fSkString)) SkString(s);
return u.move();
}
@@ -298,9 +297,7 @@ void SkPDFArray::addResources(SkPDFObjNumMap* catalog,
}
}
-void SkPDFArray::append(SkPDFUnion&& value) {
- SkNEW_PLACEMENT_ARGS(fValues.append(), SkPDFUnion, (value.move()));
-}
+void SkPDFArray::append(SkPDFUnion&& value) { new (fValues.append()) SkPDFUnion(value.move()); }
void SkPDFArray::appendInt(int32_t value) {
this->append(SkPDFUnion::Int(value));
@@ -378,8 +375,8 @@ void SkPDFDict::addResources(SkPDFObjNumMap* catalog,
void SkPDFDict::set(SkPDFUnion&& name, SkPDFUnion&& value) {
Record* rec = fRecords.append();
SkASSERT(name.isName());
- SkNEW_PLACEMENT_ARGS(&rec->fKey, SkPDFUnion, (name.move()));
- SkNEW_PLACEMENT_ARGS(&rec->fValue, SkPDFUnion, (value.move()));
+ new (&rec->fKey) SkPDFUnion(name.move());
+ new (&rec->fValue) SkPDFUnion(value.move());
}
int SkPDFDict::size() const { return fRecords.count(); }
« no previous file with comments | « src/pdf/SkPDFTypes.h ('k') | src/pipe/SkGPipePriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698