diff options
author | halcanary <halcanary@google.com> | 2015-12-10 08:59:43 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-10 08:59:43 -0800 |
commit | 712fdf7603c62820b21174da9b0a2071c174936b (patch) | |
tree | 52f88b6e297f2bce7b940adb9cfe052178076758 /include/core/SkDocument.h | |
parent | a06e6ab3fafb8c8712bc296f72c3f8b88856f1fe (diff) |
SkDocument::setDCTEncoder() for old versions of webkit
Review URL: https://codereview.chromium.org/1505763003
Diffstat (limited to 'include/core/SkDocument.h')
-rw-r--r-- | include/core/SkDocument.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/core/SkDocument.h b/include/core/SkDocument.h index 316d15a253..6ee96b9ce3 100644 --- a/include/core/SkDocument.h +++ b/include/core/SkDocument.h @@ -16,6 +16,7 @@ #include "SkTime.h" class SkCanvas; +class SkPixelSerializer; class SkWStream; /** SK_ScalarDefaultDPI is 72 DPI. @@ -58,6 +59,24 @@ public: SkScalar dpi = SK_ScalarDefaultRasterDPI); /** + * @param jpegEncoder For PDF documents, if a jpegEncoder is set, + * use it to encode SkImages and SkBitmaps as [JFIF]JPEGs. + * This feature is deprecated and is only supplied for + * backwards compatability. + * + * The prefered method to create PDFs with JPEG images is + * to use SkImage::NewFromEncoded() and not jpegEncoder. + * Chromium uses NewFromEncoded. + * + * If the encoder is unset, or if jpegEncoder->onEncode() + * returns NULL, fall back on encoding images losslessly + * with Deflate. + */ + static SkDocument* CreatePDF(SkWStream*, + SkScalar dpi, + SkPixelSerializer* jpegEncoder); + + /** * Create a PDF-backed document, writing the results into a file. */ static SkDocument* CreatePDF(const char outputFilePath[], |