diff options
author | Mike Reed <reed@google.com> | 2017-12-15 05:23:54 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-15 05:24:09 +0000 |
commit | 800f5541bb0f4ea0f6923592355bdb64f156d8b3 (patch) | |
tree | fcad288bcdd54f3a59349aed7fbc5c326ae3cb31 /include | |
parent | 7f846f273ceaa5a3a8880e9af260f94bd1e614b6 (diff) |
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 <reed@google.com>
> Reviewed-by: Hal Canary <halcanary@google.com>
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 <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkDocument.h | 46 |
1 files changed, 46 insertions, 0 deletions
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<SkDocument> MakePDF(SkWStream* stream, + SkScalar dpi, + const PDFMetadata& metadata, + sk_sp<SkPixelSerializer> jpegEncoder, + bool pdfa); + /** + * Create a PDF-backed document, writing the results into a file. + */ + static sk_sp<SkDocument> MakePDF(const char outputFilePath[], + SkScalar dpi = SK_ScalarDefaultRasterDPI); + static sk_sp<SkDocument> MakePDF(SkWStream* stream, SkScalar dpi); +#endif + /** * Create a PDF-backed document, writing the results into a * SkWStream. |