From ee41b7556dfab48509d61854d256ee523cb8ee4c Mon Sep 17 00:00:00 2001 From: halcanary Date: Thu, 23 Jun 2016 14:08:11 -0700 Subject: 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 --- tests/PDFPrimitivesTest.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'tests/PDFPrimitivesTest.cpp') 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); -- cgit v1.2.3