From a518086928494319b8968abc09808eff492c194f Mon Sep 17 00:00:00 2001 From: "vandebo@chromium.org" Date: Tue, 26 Oct 2010 19:48:49 +0000 Subject: 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 --- include/pdf/SkPDFDevice.h | 11 +++++++---- include/pdf/SkPDFDocument.h | 2 +- include/pdf/SkPDFPage.h | 10 +++++----- include/pdf/SkPDFTypes.h | 9 +++++++++ 4 files changed, 22 insertions(+), 10 deletions(-) (limited to 'include/pdf') 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& 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* resouceList); + void getResources(SkTDArray* resourceList) const; /** Returns the media box for this device. */ - SkRefPtr getMediaBox(); + SkRefPtr 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 fPageTree; SkRefPtr fDocCatalog; SkTDArray fPageResources; - int fSecondPageFirstResouceIndex; + int fSecondPageFirstResourceIndex; SkRefPtr 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* 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* 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. -- cgit v1.2.3