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(); } |