aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkDocument.h
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2015-02-19 18:50:05 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-02-19 18:50:05 -0800
commit8c92dc1dc281649f9e6b0ff534c25bc89dded3ea (patch)
treeed0cd2a6ea481cfe8c1359490bdd2f5dac3e47bd /include/core/SkDocument.h
parent8e65712486c66108677a9b0a55ad3e7ca94db555 (diff)
Remove unused parameters to SkDocument::CreatePDF
All image compression currently uses (losseless) Deflate, not Jpeg. All clients simply use SkDocument::CreatePDF(stream). SampleApp and SkLua still use SkDocument::CreatePDF(path). Review URL: https://codereview.chromium.org/935843007
Diffstat (limited to 'include/core/SkDocument.h')
-rw-r--r--include/core/SkDocument.h66
1 files changed, 25 insertions, 41 deletions
diff --git a/include/core/SkDocument.h b/include/core/SkDocument.h
index 83098aa65c..db8113f0e2 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();