Index: src/pdf/SkPDFTypes.cpp |
diff --git a/src/pdf/SkPDFTypes.cpp b/src/pdf/SkPDFTypes.cpp |
index 285da38513127e47ed12bacdf1329b242c03110f..19635ab84e1cde894d3f717041e30fa2dff8fbf3 100644 |
--- a/src/pdf/SkPDFTypes.cpp |
+++ b/src/pdf/SkPDFTypes.cpp |
@@ -110,18 +110,6 @@ static void write_name_escaped(SkWStream* o, const char* name) { |
} |
} |
-static void write_string(SkWStream* o, const SkString& s) { |
- o->write(s.c_str(), s.size()); |
-} |
- |
-static SkString format_string(const SkString& s) { |
- return SkPDFUtils::FormatString(s.c_str(), s.size()); |
-} |
- |
-static SkString format_string(const char* s) { |
- return SkPDFUtils::FormatString(s, strlen(s)); |
-} |
- |
void SkPDFUnion::emitObject(SkWStream* stream, |
const SkPDFObjNumMap& objNumMap, |
const SkPDFSubstituteMap& substitutes) const { |
@@ -142,14 +130,16 @@ void SkPDFUnion::emitObject(SkWStream* stream, |
return; |
case Type::kString: |
SkASSERT(fStaticString); |
- write_string(stream, format_string(fStaticString)); |
+ SkPDFUtils::WriteString(stream, fStaticString, |
+ strlen(fStaticString)); |
return; |
case Type::kNameSkS: |
stream->writeText("/"); |
write_name_escaped(stream, pun(fSkString)->c_str()); |
return; |
case Type::kStringSkS: |
- write_string(stream, format_string(*pun(fSkString))); |
+ SkPDFUtils::WriteString(stream, pun(fSkString)->c_str(), |
+ pun(fSkString)->size()); |
return; |
case Type::kObjRef: |
stream->writeDecAsText(objNumMap.getObjectNumber( |