From 800f5541bb0f4ea0f6923592355bdb64f156d8b3 Mon Sep 17 00:00:00 2001 From: Mike Reed Date: Fri, 15 Dec 2017 05:23:54 +0000 Subject: Revert "remove SK_SUPPORT_LEGACY_PDF_PIXELSERIALIZER dead code" This reverts commit 7f846f273ceaa5a3a8880e9af260f94bd1e614b6. Reason for revert: missed callsite in google3 Original change's description: > remove SK_SUPPORT_LEGACY_PDF_PIXELSERIALIZER dead code > > Bug: skia: > Change-Id: Ia88f3e2fdf6d5c6e5128eaefda0d68c7042ae7a2 > Reviewed-on: https://skia-review.googlesource.com/85500 > Commit-Queue: Mike Reed > Reviewed-by: Hal Canary TBR=halcanary@google.com,reed@google.com Change-Id: I232dc24831bd8d52e9cbbc7ee58177af0617574a No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/85600 Reviewed-by: Mike Reed Commit-Queue: Mike Reed --- include/core/SkDocument.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'include') diff --git a/include/core/SkDocument.h b/include/core/SkDocument.h index 82b8a4ff25..df7cd73c3a 100644 --- a/include/core/SkDocument.h +++ b/include/core/SkDocument.h @@ -10,6 +10,9 @@ #include "SkBitmap.h" #include "SkPicture.h" +#ifdef SK_SUPPORT_LEGACY_PDF_PIXELSERIALIZER +#include "SkPixelSerializer.h" +#endif #include "SkRect.h" #include "SkRefCnt.h" #include "SkString.h" @@ -112,6 +115,49 @@ public: int fEncodingQuality = 101; }; +#ifdef SK_SUPPORT_LEGACY_PDF_PIXELSERIALIZER + /** + * 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 stream 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. + * @param metadata a PDFmetadata object. Any fields may be left + * empty. + * @param pdfa Iff true, include XMP metadata, a document UUID, + * and sRGB output intent information. This adds length + * to the document and makes it non-reproducable, but are + * necessary features for PDF/A-2b conformance + * + * @returns NULL if there is an error, otherwise a newly created + * PDF-backed SkDocument. + */ + static sk_sp MakePDF(SkWStream* stream, + SkScalar dpi, + const PDFMetadata& metadata, + sk_sp jpegEncoder, + bool pdfa); + /** + * Create a PDF-backed document, writing the results into a file. + */ + static sk_sp MakePDF(const char outputFilePath[], + SkScalar dpi = SK_ScalarDefaultRasterDPI); + static sk_sp MakePDF(SkWStream* stream, SkScalar dpi); +#endif + /** * Create a PDF-backed document, writing the results into a * SkWStream. -- cgit v1.2.3