aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkPDFPage.h
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2015-03-25 11:29:18 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-25 11:29:18 -0700
commitf41061cc8dc717b63efe75d2357a3176f04153ec (patch)
tree62b6e16dd3ea56e5bb0bd2eb8c58e74565974c40 /src/pdf/SkPDFPage.h
parent05245900bf6d49068b1668da1b38890a41e09bc5 (diff)
SKPDF: refactor pdfcatalog and pdfdocument
SkPDFCatalog: - remove first-page-specific code (no longer needed, never used) (e.g. addObject()). - Make use of SkHashMap for lookups (simplifies code). - inline all small methods - emitXrefTable moved to SkPDFDocument.cpp - no longer store offsets in this data structure (moved to SkPDFDocument.cpp) - setFileOffset gone. - own substitute refs directly. SkPDFDocument::EmitPDF() - All sites that call into SkPDFCatalog modified. - catalog.addObject only called in a single place, after the resouceSet is built - offsets moved to local array. SkPDFPage: - finalizePage no longer deals with SkPDFCatalog or resource sets. - GeneratePageTree no longer deals with SkPDFCatalog SkPDFObjRef - emitObject respects the substitution map Unit Tests: - respect SkPDFCatalog::addObject signature change. SkTHash: - #include SkChecksum for SkGoodHash - Copyright notice added Review URL: https://codereview.chromium.org/1033543002
Diffstat (limited to 'src/pdf/SkPDFPage.h')
-rw-r--r--src/pdf/SkPDFPage.h17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/pdf/SkPDFPage.h b/src/pdf/SkPDFPage.h
index 99a913441b..cf31b0af70 100644
--- a/src/pdf/SkPDFPage.h
+++ b/src/pdf/SkPDFPage.h
@@ -36,20 +36,9 @@ public:
/** Before a page and its contents can be sized and emitted, it must
* be finalized. No changes to the PDFDevice will be honored after
- * finalizePage has been called. This function adds the page content
- * to the passed catalog, so it must be called for each document
- * that the page is part of.
- * @param catalog The catalog to add page content objects to.
- * @param firstPage Indicate if this is the first page of a document.
- * @param newResourceObjects All the resource objects (recursively) used on
- * the page are added to this array. This gives
- * the caller a chance to deduplicate resources
- * across pages.
- * @param knownResourceObjects The set of resources to be ignored.
+ * finalizePage has been called.
*/
- void finalizePage(SkPDFCatalog* catalog, bool firstPage,
- const SkTSet<SkPDFObject*>& knownResourceObjects,
- SkTSet<SkPDFObject*>* newResourceObjects);
+ void finalizePage();
/** Add destinations for this page to the supplied dictionary.
* @param dict Dictionary to add destinations to.
@@ -63,13 +52,11 @@ public:
* it must be torn down explicitly. The first page is not added to
* the pageTree dictionary array so the caller can handle it specially.
* @param pages The ordered vector of page objects.
- * @param catalog The catalog to add new objects into.
* @param pageTree An output vector with all of the internal and leaf
* nodes of the pageTree.
* @param rootNode An output parameter set to the root node.
*/
static void GeneratePageTree(const SkTDArray<SkPDFPage*>& pages,
- SkPDFCatalog* catalog,
SkTDArray<SkPDFDict*>* pageTree,
SkPDFDict** rootNode);