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

Unified Diff: tests/PDFPrimitivesTest.cpp

Issue 846023003: In SkPDFDocument::emitPDF(), stop pre-calculating file offsets. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit: space between functions Created 5 years, 11 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.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PDFPrimitivesTest.cpp
diff --git a/tests/PDFPrimitivesTest.cpp b/tests/PDFPrimitivesTest.cpp
index 9421fc9597af7b4680f590192dc3d28658add3e9..3a4c6f6ab0b73b54eb97f1fae280107b558aeb19 100644
--- a/tests/PDFPrimitivesTest.cpp
+++ b/tests/PDFPrimitivesTest.cpp
@@ -228,12 +228,18 @@ static void TestSubstitute(skiatest::Reporter* reporter) {
SkDynamicMemoryWStream buffer;
proxy->emit(&buffer, &catalog, false);
- catalog.emitSubstituteResources(&buffer, false);
+ SkTSet<SkPDFObject*>* substituteResources =
+ catalog.getSubstituteList(false);
+ for (int i = 0; i < substituteResources->count(); ++i) {
+ (*substituteResources)[i]->emit(&buffer, &catalog, true);
+ }
char objectResult[] = "2 0 obj\n<</Value 33\n>>\nendobj\n";
- REPORTER_ASSERT(
- reporter,
- catalog.setFileOffset(proxy.get(), 0) == strlen(objectResult));
+ catalog.setFileOffset(proxy.get(), 0);
+
+ size_t outputSize = catalog.getSubstituteObject(proxy.get())
+ ->getOutputSize(&catalog, true);
+ REPORTER_ASSERT(reporter, outputSize == strlen(objectResult));
char expectedResult[] =
"<</Value 33\n>>1 0 obj\n<</InnerValue 44\n>>\nendobj\n";
« no previous file with comments | « src/pdf/SkPDFTypes.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698