Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Unified Diff: include/core/SkDocument.h

Issue 935843007: Remove unused parameters to SkDocument::CreatePDF (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove SkPicture::EncodeBitmap Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/core/SkPicture.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | include/core/SkPicture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698