aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/pdf/SkPDFCatalog.h
diff options
context:
space:
mode:
authorGravatar vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-07-20 17:39:01 +0000
committerGravatar vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-07-20 17:39:01 +0000
commit421d6443fbd3a913dfa32b6492c4a2969bc6314b (patch)
tree5c02a30275d78adf764e0c91437bada0c6dcbd33 /include/pdf/SkPDFCatalog.h
parentf6c3ebdeb135dcdb9af225bd7af77f1fe1f92787 (diff)
[PDF] Make stream compression optional on a per device basis.
There are a lot of small pieces to make this change work: - SkPDFDocument (and SkPDFCatalog) take flags to disable compression (and font embedding - not implemented yet, can disable font subsetting for now). - SkPDFStream now defers compression until the size/emit step. - Classes that *had* a stream (because they didn't know the stream size at construction time) now *are* streams to make the substitution work correctly. - The SkPDFShader implementation got pulled apart into two classes, one that is a SkPDFDict, and one that is a SkPDFStream (making the common ancestor SkPDFObject). - Added helper methods in SkPDFObject for children that have simple resource lists. - Added an iterator to SkPDFDict so that a substitute SkPDFStream can get a copy of the stream dictionary. - Change SkPDFDocument to have a pointer to an SkPDFCatalog to remove a new circular header reference. Review URL: http://codereview.appspot.com/4700045 git-svn-id: http://skia.googlecode.com/svn/trunk@1911 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/pdf/SkPDFCatalog.h')
-rw-r--r--include/pdf/SkPDFCatalog.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/pdf/SkPDFCatalog.h b/include/pdf/SkPDFCatalog.h
index 4f8f8c1ece..3a644e6a5a 100644
--- a/include/pdf/SkPDFCatalog.h
+++ b/include/pdf/SkPDFCatalog.h
@@ -19,6 +19,7 @@
#include <sys/types.h>
+#include "SkPDFDocument.h"
#include "SkPDFTypes.h"
#include "SkRefCnt.h"
#include "SkTDArray.h"
@@ -32,7 +33,7 @@ class SK_API SkPDFCatalog {
public:
/** Create a PDF catalog.
*/
- SkPDFCatalog();
+ explicit SkPDFCatalog(SkPDFDocument::Flags flags);
~SkPDFCatalog();
/** Add the passed object to the catalog. Refs obj.
@@ -62,6 +63,10 @@ public:
*/
size_t getObjectNumberSize(SkPDFObject* obj);
+ /** Return the document flags in effect for this catalog/document.
+ */
+ SkPDFDocument::Flags getDocumentFlags() const { return fDocumentFlags; }
+
/** Output the cross reference table for objects in the catalog.
* Returns the total number of objects.
* @param stream The writable output stream to send the output to.
@@ -127,6 +132,8 @@ private:
// Next object number to assign on the first page.
uint32_t fNextFirstPageObjNum;
+ SkPDFDocument::Flags fDocumentFlags;
+
int findObjectIndex(SkPDFObject* obj) const;
int assignObjNum(SkPDFObject* obj);