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

Unified Diff: src/doc/SkDocument_PDF.cpp

Issue 1038523004: SkPDF SkPDFObject::addResources signature simplified (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-03-25 (Wednesday) 15:53:41 EDT Created 5 years, 9 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 | « gyp/tests.gypi ('k') | src/pdf/SkPDFBitmap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/doc/SkDocument_PDF.cpp
diff --git a/src/doc/SkDocument_PDF.cpp b/src/doc/SkDocument_PDF.cpp
index ae0386ab1a389272f531eba51c5e29765c60f619..fcbba3830677c4b313e59b7e2333bfdd40ca2c56 100644
--- a/src/doc/SkDocument_PDF.cpp
+++ b/src/doc/SkDocument_PDF.cpp
@@ -211,19 +211,14 @@ static bool emit_pdf_document(const SkTDArray<const SkPDFDevice*>& pageDevices,
// Build font subsetting info before proceeding.
perform_font_subsetting(pageDevices, &catalog);
- SkTSet<SkPDFObject*> resourceSet;
- if (resourceSet.add(docCatalog.get())) {
- docCatalog->addResources(&resourceSet, &catalog);
+ if (catalog.addObject(docCatalog.get())) {
+ docCatalog->addResources(&catalog);
}
- for (int i = 0; i < resourceSet.count(); ++i) {
- SkAssertResult(catalog.addObject(resourceSet[i]));
- }
-
size_t baseOffset = SkToOffT(stream->bytesWritten());
emit_pdf_header(stream);
SkTDArray<int32_t> offsets;
- for (int i = 0; i < resourceSet.count(); ++i) {
- SkPDFObject* object = resourceSet[i];
+ for (int i = 0; i < catalog.objects().count(); ++i) {
+ SkPDFObject* object = catalog.objects()[i];
offsets.push(SkToS32(stream->bytesWritten() - baseOffset));
SkASSERT(object == catalog.getSubstituteObject(object));
SkASSERT(catalog.getObjectNumber(object) == i + 1);
« no previous file with comments | « gyp/tests.gypi ('k') | src/pdf/SkPDFBitmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698