Index: include/core/SkDocument.h |
diff --git a/include/core/SkDocument.h b/include/core/SkDocument.h |
index 83098aa65c082db0f9f05fdad5082a3c15c3de38..db8113f0e2501b53281ec1951e1239e47d76a793 100644 |
--- a/include/core/SkDocument.h |
+++ b/include/core/SkDocument.h |
@@ -35,50 +35,33 @@ public: |
SK_DECLARE_INST_COUNT(SkDocument) |
/** |
- * Create a PDF-backed document, writing the results into a file. |
- * If there is an error trying to create the doc, returns NULL. |
- * encoder sets the DCTEncoder for images, to encode a bitmap |
- * as JPEG (DCT). |
- * rasterDpi - the DPI at which features without native PDF support |
- * will be rasterized (e.g. draw image with perspective, |
- * draw text with perspective, ...) |
- * A larger DPI would create a PDF that reflects the original |
- * intent with better fidelity, but it can make for larger |
- * PDF files too, which would use more memory while rendering, |
- * and it would be slower to be processed or sent online or |
- * to printer. |
+ * Create a PDF-backed document, writing the results into a SkWStream. |
+ * |
+ * PDF pages are sized in point units. 1 pt == 1/72 inch == 127/360 mm. |
+ * |
+ * @param SkWStream* A PDF document will be written to this |
+ * stream. The document may write to the stream at |
+ * anytime during its lifetime, until either close() is |
+ * called or the document is deleted. |
+ * @param dpi The DPI (pixels-per-inch) at which features without |
+ * native PDF support will be rasterized (e.g. draw image |
+ * with perspective, draw text with perspective, ...) A |
+ * larger DPI would create a PDF that reflects the |
+ * original intent with better fidelity, but it can make |
+ * for larger PDF files too, which would use more memory |
+ * while rendering, and it would be slower to be processed |
+ * or sent online or to printer. |
+ * @returns NULL if there is an error, otherwise a newly created |
+ * PDF-backed SkDocument. |
*/ |
- static SkDocument* CreatePDF( |
- const char filename[], |
- SkPicture::EncodeBitmap encoder = NULL, |
- SkScalar rasterDpi = SK_ScalarDefaultRasterDPI); |
+ static SkDocument* CreatePDF(SkWStream*, |
+ SkScalar dpi = SK_ScalarDefaultRasterDPI); |
/** |
- * Create a PDF-backed document, writing the results into a stream. |
- * If there is an error trying to create the doc, returns NULL. |
- * |
- * The document may write to the stream at anytime during its lifetime, |
- * until either close() is called or the document is deleted. Once close() |
- * has been called, and all of the data has been written to the stream, |
- * if there is a Done proc provided, it will be called with the stream. |
- * The proc can delete the stream, or whatever it needs to do. |
- * encoder sets the DCTEncoder for images, to encode a bitmap |
- * as JPEG (DCT). |
- * Done - clean up method intended to allow deletion of the stream. |
- * Its aborted parameter is true if the cleanup is due to an abort |
- * call. It is false otherwise. |
- * rasterDpi - the DPI at which features without native PDF support |
- * will be rasterized (e.g. draw image with perspective, |
- * draw text with perspective, ...) |
- * A larger DPI would create a PDF that reflects the original |
- * intent with better fidelity, but it can make for larger |
- * PDF files too, which would use more memory while rendering, |
- * and it would be slower to be processed or sent online or |
- * to printer. */ |
- static SkDocument* CreatePDF( |
- SkWStream*, void (*Done)(SkWStream*,bool aborted) = NULL, |
- SkPicture::EncodeBitmap encoder = NULL, |
- SkScalar rasterDpi = SK_ScalarDefaultRasterDPI); |
+ * Create a PDF-backed document, writing the results into a file. |
+ */ |
+ static SkDocument* CreatePDF(const char outputFilePath[], |
+ SkScalar dpi = SK_ScalarDefaultRasterDPI); |
/** |
* Begin a new page for the document, returning the canvas that will draw |
@@ -112,6 +95,7 @@ public: |
protected: |
SkDocument(SkWStream*, void (*)(SkWStream*, bool aborted)); |
+ |
// note: subclasses must call close() in their destructor, as the base class |
// cannot do this for them. |
virtual ~SkDocument(); |