aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PDFPrimitivesTest.cpp
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2016-06-23 14:08:11 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-23 14:08:11 -0700
commitee41b7556dfab48509d61854d256ee523cb8ee4c (patch)
treeed9ac2e07b8af0d19abef0d469195aac57bf3e74 /tests/PDFPrimitivesTest.cpp
parent28a838e532250fcca9673aca6c4616193a5a139d (diff)
SkPDF: alloc less memory for strings
before: micros bench 250.98 WritePDFText nonrendering after: micros bench 107.10 WritePDFText nonrendering Also, be slightly more space-efficient in encoding strings. Also, add a bench. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2099463002 Review-Url: https://codereview.chromium.org/2099463002
Diffstat (limited to 'tests/PDFPrimitivesTest.cpp')
-rw-r--r--tests/PDFPrimitivesTest.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/PDFPrimitivesTest.cpp b/tests/PDFPrimitivesTest.cpp
index e438bfef78..9e2a89e609 100644
--- a/tests/PDFPrimitivesTest.cpp
+++ b/tests/PDFPrimitivesTest.cpp
@@ -217,9 +217,11 @@ static void TestPDFUnion(skiatest::Reporter* reporter) {
SkString stringComplexInput("\ttest ) string ( foo");
SkPDFUnion stringComplex = SkPDFUnion::String(stringComplexInput);
- ASSERT_EMIT_EQ(reporter,
- stringComplex,
- "<0974657374202920737472696E67202820666F6F>");
+ ASSERT_EMIT_EQ(reporter, stringComplex, "(\\011test \\) string \\( foo)");
+
+ SkString binaryStringInput("\1\2\3\4\5\6\7\10\11\12\13\14\15\16\17\20");
+ SkPDFUnion binaryString = SkPDFUnion::String(binaryStringInput);
+ ASSERT_EMIT_EQ(reporter, binaryString, "<0102030405060708090A0B0C0D0E0F10>");
SkString nameInput("Test name\twith#tab");
SkPDFUnion name = SkPDFUnion::Name(nameInput);