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

Unified Diff: include/core/SkDocument.h

Issue 1505763003: SkDocument::setDCTEncoder() for old versions of webkit (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-12-09 (Wednesday) 13:41:21 EST Created 5 years 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 | src/doc/SkDocument_PDF.cpp » ('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 316d15a253429ea07c7b40e102a8e22f36e8e6d8..6ee96b9ce3afed5e69eb1e0fcf20d9a72ac71951 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[],
« no previous file with comments | « no previous file | src/doc/SkDocument_PDF.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698