diff options
author | vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2010-10-26 19:48:49 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2010-10-26 19:48:49 +0000 |
commit | a518086928494319b8968abc09808eff492c194f (patch) | |
tree | 5301b6c2f21c3ff61b39332b62692ea93a77c9d8 /include/pdf | |
parent | 35fc62b960db6739b19c59576085663796951e47 (diff) |
Several cleanups:
Fix the spelling of resource in several places
Make getResouce(resourceList) part of SkPDFObject
make SkDynamicMemoryWStream::getOffset and SkPDFPage::getMediaBox const
Add a temporary NOT_IMPLEMENTED macro instead of using SkASSERT
Review URL: http://codereview.appspot.com/2721041
git-svn-id: http://skia.googlecode.com/svn/trunk@619 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/pdf')
-rw-r--r-- | include/pdf/SkPDFDevice.h | 11 | ||||
-rw-r--r-- | include/pdf/SkPDFDocument.h | 2 | ||||
-rw-r--r-- | include/pdf/SkPDFPage.h | 10 | ||||
-rw-r--r-- | include/pdf/SkPDFTypes.h | 9 |
4 files changed, 22 insertions, 10 deletions
diff --git a/include/pdf/SkPDFDevice.h b/include/pdf/SkPDFDevice.h index b972dd4752..7310229bb7 100644 --- a/include/pdf/SkPDFDevice.h +++ b/include/pdf/SkPDFDevice.h @@ -20,6 +20,8 @@ #include "SkRefCnt.h" #include "SkDevice.h" #include "SkString.h" +#include "SkPaint.h" +#include "SkPath.h" class SkPDFArray; class SkPDFDevice; @@ -101,14 +103,14 @@ public: */ const SkRefPtr<SkPDFDict>& getResourceDict(); - /** Get the list of resouces (PDF objects) used on this page - * @param resouceList A list to append the resouces to. + /** Get the list of resources (PDF objects) used on this page. + * @param resourceList A list to append the resources to. */ - void getResouces(SkTDArray<SkPDFObject*>* resouceList); + void getResources(SkTDArray<SkPDFObject*>* resourceList) const; /** Returns the media box for this device. */ - SkRefPtr<SkPDFArray> getMediaBox(); + SkRefPtr<SkPDFArray> getMediaBox() const; /** Returns a string with the page contents. * @param flipOrigin Flip the origin between top and bottom. @@ -144,6 +146,7 @@ private: void appendRectangle(SkScalar x, SkScalar y, SkScalar w, SkScalar h); void closePath(); void strokePath(); + void paintPath(SkPaint::Style style, SkPath::FillType fill); void internalDrawBitmap(const SkMatrix& matrix, const SkBitmap& bitmap, const SkPaint& paint); diff --git a/include/pdf/SkPDFDocument.h b/include/pdf/SkPDFDocument.h index 91dd379214..54b86c4a29 100644 --- a/include/pdf/SkPDFDocument.h +++ b/include/pdf/SkPDFDocument.h @@ -57,7 +57,7 @@ private: SkTDArray<SkPDFDict*> fPageTree; SkRefPtr<SkPDFDict> fDocCatalog; SkTDArray<SkPDFObject*> fPageResources; - int fSecondPageFirstResouceIndex; + int fSecondPageFirstResourceIndex; SkRefPtr<SkPDFDict> fTrailerDict; diff --git a/include/pdf/SkPDFPage.h b/include/pdf/SkPDFPage.h index 7e96212bbf..0831cb504e 100644 --- a/include/pdf/SkPDFPage.h +++ b/include/pdf/SkPDFPage.h @@ -45,11 +45,11 @@ public: * 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 resouceObjects The resource objects used on the page are added - * to this array. This gives the caller a chance - * to deduplicate resources across pages. + * @param catalog The catalog to add page content objects to. + * @param firstPage Indicate if this is the first page of a document. + * @param resourceObjects The resource objects used on the page are added + * to this array. This gives the caller a chance + * to deduplicate resources across pages. */ void finalizePage(SkPDFCatalog* catalog, bool firstPage, SkTDArray<SkPDFObject*>* resourceObjects); diff --git a/include/pdf/SkPDFTypes.h b/include/pdf/SkPDFTypes.h index 2066352167..a281628a23 100644 --- a/include/pdf/SkPDFTypes.h +++ b/include/pdf/SkPDFTypes.h @@ -55,6 +55,15 @@ public: */ virtual size_t getOutputSize(SkPDFCatalog* catalog, bool indirect); + /** If this object explicitly depends on other objects, add them to the + * end of the list. This only applies to higher level object, where + * the depenency is explicit and introduced by the class. i.e. an + * SkPDFImage added to an SkPDFDevice, but not an SkPDFObjRef added to + * an SkPDFArray. + * @param resourceList The list to append dependant resources to. + */ + virtual void getResources(SkTDArray<SkPDFObject*>* resourceList); + /** Helper function to output an indirect object. * @param catalog The object catalog to use. * @param stream The writable output stream to send the output to. |